-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Enhancement: Allow parserOptions.project to be (true | string)[]? #7384
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
Comments
This is kind-of doable right now with eslint overrides config, eg: module.exports = {
parserOptions: { project: true },
rules: { ... },
overrides: [
{
// idk if this would 100% work but as an example...
files: require('./tsconfig.eslint.json').includes,
parserOptions: {
project: ['./tsconfig.eslint.json'],
tsconfigRootDir: __dirname,
},
},
],
} This would cause ESLint to pass |
The complicated thing about allowing The big wins from relative mode are: (b) is big because it means when you do
But as soon as you introduce BOTH - we now have this confusing approach in the form of "when should we load what config?" Also with I'm of two minds about this... I don't really love the idea. I think I'd need to see a solid usecase to be convinced it's a good idea to implement it. |
Marking as I personally am much less excited about it now that |
With our release of project services and the release of flat configs - I don't see much value in this. |
Before You File a Proposal Please Confirm You Have Done The Following...
Relevant Package
parser
My proposal is suitable for this project
Description
In #6084 we added the ability to specify
parserOptions.project: true
. Doing so indicates each file should be linted with the closest tsconfig.json to that file.But, what if a repo wants a different TSConfig for files that it matches, and
true
for all other files? For example, maybe it'd want:tsconfig.eslint.json
to apply for*.(c)js
filestsconfig.json
for all other filesWhat if we allow specifiers like
project: ['tsconfig.eslint.json', true]
? In essence, this would be allowing configs to includetrue
inside the already-presentstring[]
option that says to find the first matching TSConfig.Example repro case here: https://github.com/JoshuaKGoldberg/repros/tree/typescript-eslint-parserOptions-project-string-true
Additional Info
Somewhat of a sibling issue to #7383. If we end up allowing an object with a type name then this issue would be to change
project
to(boolean | string | ThatNewProjectSpecifierType)[]
.The text was updated successfully, but these errors were encountered: