-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
Impossible rules #104
Comments
Flow can already be compiled to JavaScript, that's how we run in the browser (https://flowtype.org/try/), if you want to experiment with doing eslint rules that consume Flow I can help you out with that. I suspect it will be slower than you want because Flow is more meant for incremental checks with a server running in the background. Where eslint can get away with starting up cold. It's not that slow, but you will notice the difference. |
That'd be really awesome! I'd love to work on that! |
Added it to my team's backlog. |
Writing rules targeted at TypeScript and taking advantage of its type information would solve many of these problems. |
I'm playing around with the new Typescript eslint parser, and I think I'd like to try my hand at a POC implementation of some of these. Will still have to ignore non or untyped nodes, but I think many of these are possible now with @typescript-eslint |
@RichiCoder1 Awesome! 👍 I would be happy to host them over at |
typescript-eslint/typescript-eslint#283
typescript-eslint/typescript-eslint#284
|
Closing as old and resolved. Many rules are now possible thanks to typescript. The ones mentioned now exist. If new ideas come up, I think it would be best tracked in the unicorn plugin repo |
I thought I'd collect some rules I'd like to see that are impossible with the current ESLint. For posterity.
RegExp#exec()
overString#match()
- Requires type analysis..includes()
over.indexOf()
- While it's possible today with some assumption. It's not perfect and would be improved with some type analysis..startsWith()
/.endsWith()
over regex/indexOf/slice/etc - Only the regex case is possible today. With type analysis, we could do all the cases in that issue.Comment on other things that would be cool if ESLint didn't have its current limits.
The text was updated successfully, but these errors were encountered: