-
Notifications
You must be signed in to change notification settings - Fork 217
Add ExpectType to eslint-plugin #843
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of small comments/questions.
packages/eslint-plugin/test/__file_snapshots__/types/expect/index.d.ts.lint
Show resolved
Hide resolved
packages/eslint-plugin/test/__file_snapshots__/types/expect/index.d.ts.lint
Show resolved
Hide resolved
packages/eslint-plugin/test/__file_snapshots__/types/expect/expect-tests.ts.lint
Outdated
Show resolved
Hide resolved
I just remembered that this message appears with this PR:
This happens often, some 1400 times the last time I ran the entire thing. |
Oh, that's tslint giving that message, not eslint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary to address here, but does it really make sense to keep ExpectRule responsible for reporting program diagnostics?
It's the expect rule that loops over every TS version, so it's the only one that can report these errors. I have disabled that reporting when in the editor though (since tsserver is there), but if we want to do it outside of the plugin we're going to have to move the looping logic over to dtslint and then duplicate the programs too (or, do some sort of program sharing). |
This moves the expect rule from tslint to eslint. By default in the editor, it will run ExpectType on the builtin version of TypeScript. But when run via dtslint, it will run all TS versions (and also convert diagnostics into lint errors).
This leaves npm-naming as the only remaining tslint rule.
TODO:
Delete tslint???