-
Notifications
You must be signed in to change notification settings - Fork 0
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
Unexpected errors do not error #13
Comments
Hey thanks for trying this out. The plugin here isn't meant as a drop in replacement for dtslint as a tool. In particular, eslint doesn't do general type checking for typescript, linting is a layer on top of that. The expectation is you'd still do your normal typechecking with the typescript compiler. Lint rules are sugar on top of that. In fact tho this what dtslint does, it runs |
But if we do that, |
fair point. There isn't much we can do tho as an eslint plugin, You'd need a typescript plugin perhaps? Our workflow for tests is that we don't explicitly typecheck them, beyond normal editor support. For test related things that we want to test/make assertions on, we use the |
My worry is that if we don't type check the tests, then when the source code changes, there might be new (unexpected) type errors in the tests. In that case, the tests wouldn't fail during CI, so no-one would notice unless they opened the tests in their editor! |
Would it not be possible for the lint rule to throw a linting error if the file contains errors which are not marked as expected? This is what the TSLint rule appears to be doing. |
FWIW this version works as I would expect: https://github.com/ibezkrovnyi/eslint-plugin-expect-type |
Hi, thanks for your work on this project!
If my tests have an unexpected error, e.g.
… then ESLint will return no errors.
The TSLint variant inside dtslint did not have this problem.
The text was updated successfully, but these errors were encountered: