Configs: add a config that turns off all type-aware linting #6215
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
preset config change
Proposal for an addition, removal, or general change to a preset config
Before You File a Proposal Please Confirm You Have Done The Following...
Description
Our current guidance on how to setup an ESLint config is to turn everything on in the root of the config and be done with it. This advice includes turning on type-aware linting on all files.
However for a lot of codebases this can create a crappy experience because there are a lot of files NOT included in a tsconfig that ESLint will run over. This in turn causes the dreaded "The file must be included in at least one of the projects provided" error.
There's not really a good way around this right now, sadly. Our advice is pretty long winded and not the easiest thing to put into practice, especially if you don't actually want to lint the file with type-info. Possible workarounds include:
.eslintignore
the files.tsconfig.eslint.json
that includes the files.parserOptions.project
on the files.overrides
config.All of those options suck for a user because:
.js
files with poor-to-no types or are config files where most type-aware rules aren't going to catch anything useful (if anything at all)I realised that we're in a good position to help people automate this. We know what rules need type-info - so why not generate a config for it? That way the solution to the problem can simply be "use overrides to disable type-aware linting by extending this config", i.e.
This would be a substantially better UX and is a pretty clean solution!
Impacted Configurations
No response
Additional Info
No response
The text was updated successfully, but these errors were encountered: