-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
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
- this might still be the case if we keep the current behavior of linting without type information if the file has
- 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 togethereven though you didn't explicitly enable--project
- especially if you get an error like
- Certain features don't work without type information
- Caching Add caching based on file content and external references #752 needs a Program
- Globbing doesn't use the FileSystem abstraction. although there is WIP: use FileSystem for globbing #418 to fix this, I'd rather not spend too much time on this
- Watch mode (once implemented) would need a Program
- 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/parserand@typescript-eslint/eslint-plugineasier (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"
Reactions are currently unavailable