Skip to content

Deprecate linting without type information #754

@ajafff

Description

@ajafff

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"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions