-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Enhancement: Allow altering the file names that project: true
searches for
#7383
Comments
Following up: in #6754 we added an Since that flag is experimental -and will be for quite some time-, we still don't have a stable way for situations where At any rate, I think we'd want to see an API suggestion before marking this as purely
I like that idea. Maybe, On the other hand, it could get confusing having this object shape have project: {
ignore: ['./packages/ignore-me/tsconfig.json'],
include: ['tsconfig.eslint.json', 'tsconfig.json'],
relative: true,
} edit: switched from |
project: true
searches for
project: true
searches forproject: true
searches for
As we look towards our language service future - the question I'd have is if people have these weird setups that require include/exclude lists to make them work - how do they work within their IDE where it doesn't have that same config? Ideally considering we're using the same infra that the IDE supports - we should work "out of the box" in exactly the same way that the IDE works and have the same config that they have. |
In terms of the here and now - I wonder if this is something we should be doing? I'm of two minds as I don't know if there's a really clean way to do this "relative name plus relative lookup" config in a way that wouldn't just add more complexity to the config than if the user had manually specified things. |
Copying over my proposals from #7943
|
I quite like |
I really like the idea of "parserOptions": {
// TODO: Try "project": true https://typescript-eslint.io/blog/parser-options-project-true/
// This wouldn't work for tsconfig.spec.ts though
// https://typescript-eslint.io/blog/parser-options-project-true/#investigating-custom-tsconfig-names
"project": [
"tsconfig?(.*).json",
"projects/*/tsconfig?(.*).json",
"*/tsconfig?(.*).json" // For example: e2e/tsconfig.json
],
// TODO: Consider use a tsconfig.eslint.json instead
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/README.md#parseroptionscreatedefaultprogram
"deprecated__createDefaultProgram": true, to: (trying to use the widest tsconfig first to reduce the number of Programs) "parserOptions": {
"project": {
nearest: [
"tsconfig.eslint.json", // pickup *all* files to be linted
"tsconfig.editor.json", // pickup *all* project files to get import suggestions in editor, created by nx
"tsconfig.app.json", // Angular base
"tsconfig.spec.json", // jest
"tsconfig.json", // base, including e2e tests
// Not including tsconfig.prod.ts as it shouldn't have any extra files
],
}
} Not sure if "ignore" would be useful to me / would allow me using a simple glob then ignoring (I know the removal of |
@Samuel-Therrien-Beslogic have you tried |
Before You File a Proposal Please Confirm You Have Done The Following...
Relevant Package
parser
My proposal is suitable for this project
Description
Currently, the
project: true
option allows TypeScript-ESLint to auto-detect the tsconfig.json file within each package of a monorepo, however a relatively common setup is to use atsconfig.eslint.json
file for eslint setup. This means that instead of being able to utiliseproject: true
, each package needs an eslintrc file that points to the project file, or globs need to be used in the base configuration. Neither of these are ideal either for massive duplication reasons or for performance reasons.Ideally, another option would be added to allow setting the filename that the parser looks for when
project
is set totrue
. This would allow utilising atsconfig.eslint.json
file without needing to manually define it in all used locations.Additional Info
This is a repost of @me4502's #7056 to avoid many comments. The comments dig into how to avoid needing this scenario in the first place. They're a good read!
The text was updated successfully, but these errors were encountered: