Skip to content

Could not find config file. - at assertConfigurationExists #1985

Open
@FoundersHQ

Description

@FoundersHQ
[Info  - 10:21:30] ESLint server is starting.
[Info  - 10:21:30] ESLint server running in node v20.18.1
[Info  - 10:21:30] ESLint server is running.
[Info  - 10:21:30] ESLint library loaded from: /Users/shettayyy/localshiva/edenomics/node_modules/eslint/lib/api.js
[Info  - 10:21:34] ESLint library loaded from: /Users/shettayyy/localshiva/edenomics/node_modules/.pnpm/eslint@9.19.0/node_modules/eslint/lib/api.js
[Error - 10:22:39] Calculating config file for file:///Users/shettayyy/localshiva/edenomics/.vscode/settings.json) failed.
Error: Could not find config file.
    at assertConfigurationExists (/Users/shettayyy/localshiva/edenomics/node_modules/eslint/lib/config/config-loader.js:80:23)
    at LegacyConfigLoader.loadConfigArrayForFile (/Users/shettayyy/localshiva/edenomics/node_modules/eslint/lib/config/config-loader.js:335:9)
    at async ESLint.calculateConfigForFile (/Users/shettayyy/localshiva/edenomics/node_modules/eslint/lib/eslint/eslint.js:1057:25)
    at async ESLint.isPathIgnored (/Users/shettayyy/localshiva/edenomics/node_modules/eslint/lib/eslint/eslint.js:1096:24)
    at async /Users/shettayyy/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/server/out/eslintServer.js:1:24295
    at async Object.M [as withClass] (/Users/shettayyy/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/server/out/eslintServer.js:1:19807)
    at async t.workspace.getConfiguration.then.O.then.m.validate (/Users/shettayyy/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/server/out/eslintServer.js:1:24255)
    at async /Users/shettayyy/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/server/out/eslintServer.js:1:234417
    at async /Users/shettayyy/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/server/out/eslintServer.js:1:63886
[Error - 10:22:44] Calculating config file for file:///Users/shettayyy/localshiva/edenomics/turbo.json) failed.
Error: Could not find config file.
    at assertConfigurationExists (/Users/shettayyy/localshiva/edenomics/node_modules/eslint/lib/config/config-loader.js:80:23)
    at LegacyConfigLoader.loadConfigArrayForFile (/Users/shettayyy/localshiva/edenomics/node_modules/eslint/lib/config/config-loader.js:335:9)
    at async ESLint.calculateConfigForFile (/Users/shettayyy/localshiva/edenomics/node_modules/eslint/lib/eslint/eslint.js:1057:25)
    at async ESLint.isPathIgnored (/Users/shettayyy/localshiva/edenomics/node_modules/eslint/lib/eslint/eslint.js:1096:24)
    at async /Users/shettayyy/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/server/out/eslintServer.js:1:24295
    at async Object.M [as withClass] (/Users/shettayyy/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/server/out/eslintServer.js:1:19807)
    at async t.workspace.getConfiguration.then.O.then.m.validate (/Users/shettayyy/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/server/out/eslintServer.js:1:24255)
    at async /Users/shettayyy/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/server/out/eslintServer.js:1:234417
    at async /Users/shettayyy/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/server/out/eslintServer.js:1:63886

I have set up my project using turborepo and I see the above errors whenever I open any file present in the root repo like .vscode/settings.json or turbo.json.

I have provided the working directories like so -

  "eslint.workingDirectories": [
    { "pattern": "./packages/*/" },
    { "pattern": "./apps/*/" }
  ],

under workspace settings.json yet it tries to find the config at the root. I would like the linter to be active only for the working directories and not try to find the eslint config at the root. At present, the way I circumvent this issue is by adding eslint.config.js at the root with the following -

export default {
  ignores: ["**/node_modules/**", "**/dist/**"], // Add any other paths you want to ignore
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunities

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions