Closed timfee closed 5 months ago
See if the "vscode eslint extension" logs can help you track this down. You might be able to access them through the command palette. Otherwise they're accessible through that bottom panel somewhere (the one with ports, output, terminal, ...). I'd also look to see if there is a verbose mode you can toggle for the eslint extension.
Either way, if you're seeing the issue only through the vscode (while usage through the cli is as expected) then it's likely to be an issue with the extension/its configuration.
seems to get "stuck" in resolving the project directory to the first path I open in a session, and uses that path to validate all other packages
Can this help give you more control over the faulty auto behavior? https://github.com/microsoft/vscode-eslint/blob/553e632fb4cf073fce1549fb6c3c1b5140a52ebb/README.md?plain=1#L262
Thank you for the note :)
Yeah, I've tried the different tweaks at the extension level - leading me to believe it may be something weird with the extension and/or latest ESLint.
I wasn't sure if I was doing something wrong with this config.
For example, I wanted to have an eslint for typescript, one for Nextjs apps, and one generic node - and to have them extendable and stackable (sort of like the default create-turbo setup), so this is the meta context behind this quest :)
Ah, so I found the culprit:
When I specify my project directory this way, it works:
typescript: {
- tsconfigPath: "./tsconfig.json",
+ parserOptions: {
+ project: "./tsconfig.json",
+ },
},
Describe the bug
When I have several eslint instances in my monorepo that reference a common package, Visual Studio seems to get "stuck" in resolving the project directory to the first path I open in a session, and uses that path to validate all other packages.
I tried "auto" as well as explicitly listing
workingDirectories
in my config file, and have used the nightly version of ESLint with flat-file support, as well as the prod version with the experimental enable flag set to true.Repro
https://github.com/antfu/eslint-config/assets/3246342/74264639-f6ca-4739-881e-0879dbac3eee
turbo lint
from the workspace root and observe no errors.Not sure if this is an issue with the IDE, or if maybe my strategy to implement this cleanly is wrong, but wanted to share in case the issue was something here. (Cross-posted to https://github.com/microsoft/vscode-eslint/issues/1840 in case it was the extension)
Reproduction
https://github.com/timfee/eslint-repro
System Info
Used Package Manager
pnpm
Validations