-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Enhancement: Disallow parserOptions.project: [] (prefer false and/or null?) #8210
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
I don't think people would consciously write module.exports = {
projects: [
// TODO: bla bla
// "tsconfig1.json",
// TODO: bla bla
// "tsconfig2.json",
],
}; module.exports = {
projects: getProjects().map(...),
}; And in both cases preventing the empty array seems unnecessarily uncharitable. |
I think I remember why I use typescript-eslint/packages/typescript-estree/src/parseSettings/getProjectConfigFiles.ts Lines 25 to 33 in 958feca
I don't like |
And |
The issue with using That's why our
It looks like this might be slightly different in flat configs though - arrays override but objects merge. We should treat an empty array the same as off, regardless. |
So, are we still doing this? To me it sounds like putting an extra patch on something that was very logical in the first place. |
Yeah I no longer have motivation to push for anything here. The differences make sense and I'm happy with the status quo. Thanks all 😄 |
Before You File a Proposal Please Confirm You Have Done The Following...
Relevant Package
typescript-estree
My proposal is suitable for this project
Description
Forwarding @fisker's #8136 (comment) here: right now, it seems there are three ways to turn off
parserOptions.project
in some way:false
null
[]
That last one,
[]
, is something I didn't know anybody was using (thanks @fisker for mentioning!). My interpretation ofparserOptions.project
set to an array is that providing aproject
array says explicitly that there is a list of projects. So not providing any projects in that list means you'll never find the types. If there's no difference between that andfalse
/null
, then this is an ambiguity we need to at least document.Proposal: as a breaking change for v7, if we see an empty array, perhaps we should throw an error (à la #6403) asking the user to either put projects in it, use v7's name for
EXPERIMENTAL_useProjectService
, or set it tofalse
/null
?Additional Info
Adding to the
v7v8 milestone as we should really lock this down while we have the change to make breaking changes if needed.The text was updated successfully, but these errors were encountered: