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

How to configure eslint for a mono repo ? #1934

Open
SummySumanth opened this issue Sep 26, 2024 · 1 comment
Open

How to configure eslint for a mono repo ? #1934

SummySumanth opened this issue Sep 26, 2024 · 1 comment
Labels
info-needed Issue requires more information from poster

Comments

@SummySumanth
Copy link

I have a mono repo, having both frontend and backend in same repository, I want to specify eslint config in respective folders and have those apply in their directory itself (backend config in backend and frontend config in frontend), but eslint plugin in vscode keeps picking .eslintrc.json file instead of eslint.config.js, how to fix this ?

my project structure is as following

/.vscode
  └── settings.json
/app
  └── .vite
/backend
  └── eslint.config.js
  └── (files)
/frontend
  └── eslint.config.js
  └── (files)

./vscode/settings.json

{
  "eslint.workingDirectories": [
      {
          "directory": "../frontend",
          "changeProcessCWD": true,
          "overrideConfigFile": "./../frontend/eslint.config.js"
      },
      {
          "directory": "../backend",
          "changeProcessCWD": true,
          "overrideConfigFile": "./../backend/eslint.config.js"
      }
  ],
}

Error in vscode plugin output

[Error - 02:13:46] Request textDocument/diagnostic failed.
Message: Request textDocument/diagnostic failed with message: Cannot read config file: /project/backend/.eslintrc.json
Error: ENOENT: no such file or directory, open '/project/backend/.eslintrc.json'
Code: -32603 

Originally posted by @SummySumanth in eslint/eslint#18958

@dbaeumer
Copy link
Member

"overrideConfigFile" can't be specified on a working directory.

From how I understand your setup a working directory configuration like ["./frontend", "./backend"] should work

If not please provide me with a GitHub repository I can clone with a minimal setup that demos what you are seeing.

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants