Skip to content
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

eslint.config.js: Configuration file only detected at root of workspace #1578

Closed
kiriDevs opened this issue Jan 12, 2023 · 2 comments
Closed

Comments

@kiriDevs
Copy link

kiriDevs commented Jan 12, 2023

I read through the thread in #1518 because I was looking for support for the new eslint.config.js. After switching to the pre-release of the extension and setting eslint.experimental.useFlatConfig to true in my workspace settings, the whole thing seemed to work... more than before, I guess. Ok, seriously, thanks for adding this and publishing it, and so quickly at that.

But, turns out: The extension only recognizes an eslint.config.js file if it's at the root of the workspace (as in, the folder that is opened in VSCode). With the issues there still are with watching the config file, I understand that this might be an issue (as in: not feasibly possible at the moment). However, because I didn't see any mention of this particular point in that thread, I was unsure if this was known, and just wanted to make sure.

I hope this will be possible again in the final release, I can see this being a blocker for monorepos and similar workplace scenarios.

EDIT: It only automatically recognizes an eslint.config.js file if it's at the root of the workspace. If I manually specify eslint.options.overrideConfigFile it uses it just fine.

@MariaSolOs
Copy link
Member

@kiriDevs Did you set eslint.workingDirectories accordingly? There's more information about the setting in the README.

@kiriDevs
Copy link
Author

kiriDevs commented Jan 13, 2023

No, I hadn't. Just set it to { "mode": "auto" } and that actually achieves the behavior I expected. Reading the part about it in the README, it does make sense that it doesn't work without changing it. I had just kind of assumed I didn't need to because it worked out of the box when using .eslintrc.* files (somehow, since apparently that shouldn't be the case with { "mode": "location" } as the default value?)

Thanks for the hint @MariaSolOs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants