-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Relevant Package
typescript-estree
Playground Link
No response
Repro Code
The logic in getProjectConfigFiles
compares the length of parseSettings.filePath
(dirname) and parseSettings.tsconfigRootDir
to stop looking for the config.
But when tsconfigRootDir
is not set in the .eslintrc.js
config, they can be totally different paths, for example, depending where VSCode was installed (value used for tsconfigRootDir
) for tooling.
Then, it is correct to stop looking for config "only" if the parseSettings.filePath
starts with tsconfigRootDir
, otherwise just keep looking up to the root.
typescript-eslint/packages/typescript-estree/src/parseSettings/getProjectConfigFiles.ts
Line 53 in a4b633b
directory.length >= parseSettings.tsconfigRootDir.length |
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/<rule-name>": ["error", ...<options>],
},
parserOptions: {
project: true
}
};
tsconfig
Expected Result
The config file should be found.
Actual Result
The config file is not found because it stops prematurely.
Additional Info
No response
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
5.58.0 |
@typescript-eslint/parser |
5.58.0 |
@typescript-eslint/scope-manager |
5.58.0 |
@typescript-eslint/typescript-estree |
5.58.0 |
@typescript-eslint/type-utils |
5.58.0 |
@typescript-eslint/utils |
5.58.0 |
TypeScript |
5.0.4 |
ESLint |
8.38.0 |
node |
18.14.1 |