New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expectError doesn't work with // @ts-nocheck and others #192
Comments
I don’t think there’s a way to do it currently. I think this would be a good feature to add to a possible editor integration or an eslint plugin. For now, if the error squigglies are too bothersome for you, you could isolate all of your |
Ok, i see. I wish the behavior of expectError in this regard was the same as for expectType: VSCode marks it as error only if expectType fails. So for expectError it should really mark it red only if expectError itself fails, that is, when the passed expression actually does not have an error. |
See #196 for discussion on this. |
For my test files, since a lot of testing is for ts errors, I don't want the errors to be flagged red in VSCode (since they are expected), so i used // @ts-nocheck. However, after this, all expectError(...) checks fail with "Expected an error, but found none".
I also tried with // @ts-expect-error and // @ts-ignore, same problem.
Or is there any other way to tell VSCode not to flag expected errors and still have expectError(...) working correctly?
The text was updated successfully, but these errors were encountered: