Skip to content
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

Add settings for all of the TypeScript rules that require type information #2

Closed
whymarrh opened this issue Jan 21, 2020 · 1 comment · Fixed by #250
Closed

Add settings for all of the TypeScript rules that require type information #2

whymarrh opened this issue Jan 21, 2020 · 1 comment · Fixed by #250

Comments

@whymarrh
Copy link
Contributor

Some of rules available in the TypeScript plugin require type information:[1]

💭 = requires type information

But a caveat exists:[2]

But wait - I hear you exclaim - why would you ever not want type-aware rules?

Well (for full disclosure) there is a catch; by including parserOptions.project in your config, you are essentially asking TypeScript to do a build of your project before ESLint can do its linting. For small projects this takes a negligible amount of time (a few seconds); for large projects, it can take longer (30s or more).

Most of our users are fine with this, as they think the power of type-aware static analysis is worth it. Additionally, most users primarily consume lint errors via IDE plugins which, through some caching magic, do not suffer the same penalties. This means that generally they usually only run a complete lint before a push, or via their CI, where the extra time really doesn't matter.

We strongly recommend you do use it, but the above information is included so that you can make your own, informed decision.

I suspect that the performance hit isn't significant, as noted. I'm in the "he power of type-aware static analysis is worth it" camp. We should add these rules.

@rekmarks
Copy link
Member

I endorse this effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants