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

Deprecate linting without type information #754

Open
ajafff opened this issue Jan 31, 2021 · 0 comments
Open

Deprecate linting without type information #754

ajafff opened this issue Jan 31, 2021 · 0 comments

Comments

@ajafff
Copy link
Member

ajafff commented Jan 31, 2021

Motivation:

  • There's a lot of code related to linting without type information.
  • Some rules work slightly different with and without type information
    • this might still be the case if we keep the current behavior of linting without type information if the file has // @ts-nocheck
  • Additional testing overhead
  • Linting without type information has no real benefit besides a little less startup time
  • If you use TypeScript, you should also have a tsconfig.json or jsconfig.json
  • Automatically looking for a tsconfig.json if no files are listed can be surprising
    • especially if you get an error like Options '--ext' and '--project' cannot be used together even though you didn't explicitly enable --project
  • Certain features don't work without type information
  • Linting in editors also works with type information out of the box when using the LanguageService plugin
  • Makes the documentation a less confusing
  • Makes integrating @typescript-eslint/parser and @typescript-eslint/eslint-plugin easier (Investigate adding compatibility for ESLint rules #517)

TBD:

What to do with the current behavior regarding // @ts-nocheck?

  • keep as is, rules still need to check if type information is available
  • remove it, always use type information, makes rules a lot easier
  • completely ignore these files? OTOH could have added a disable comment for the linter as well
  • make it configurable
    • name?
    • what are the options to choose? "lint all files" vs. "lint only checked files"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Stable Release
  
Evaluating
Development

No branches or pull requests

1 participant