Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

VS Code shows no ESLint errors after moving to eslint.config.js

Errornpx eslint . prints errors but the editor shows no squiggles

Short answer

The extension has its own settings and does not just run your terminal command. On ESLint 8.57 the extension still defaults to the old config format, a config in a subfolder needs eslint.workingDirectories, and a file type missing from eslint.validate is skipped. The ESLint output channel shows which case you are in.

  • Applies to VS Code, vscode-eslint extension, ESLint 9, ESLint 10
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Open View, Output and choose ESLint in the dropdown, then open a file. The log says which ESLint it loaded and which config it found.

    npx eslint --version
    ls eslint.config.* 2>/dev/null
  2. 2Match what you see, then jump to its fix

    1. 1ESLint is 8.57.x and the project has eslint.config.js.ESLint 8.57 with the extension still using eslintrcFix
    2. 2The VS Code workspace root has no eslint.config.js; the file sits in apps/web or similar.The config lives in a subfolder or monorepo packageFix
    3. 3Only TypeScript or only some file types show no errors.The file type is not in eslint.validateFix
    4. 4ESLint is 10 or later and settings.json still has eslint.useFlatConfig: false or an overrideConfigFile that points to .eslintrc.The project runs ESLint 10 and an old setting still points at a legacy fileFix

What does the error look like?

  • npx eslint . prints errors but the editor shows no squiggles
  • The ESLint output channel reports no config found, or the file is ignored

Cause 1 of 4

ESLint 8.57 with the extension still using eslintrc

1Check

The extension honors eslint.useFlatConfig from ESLint 8.57.0; on 8.57 up to 9.x exclusive it defaults to false. From 9.0.0 it defaults to true.

npx eslint --version

2Fix

Turn the setting on, or upgrade ESLint to 9 or later.

// .vscode/settings.json
{
  "eslint.useFlatConfig": true
}

3Verify

Run ESLint: Restart ESLint Server from the command palette and re-open the file.

# Command palette: ESLint: Restart ESLint Server

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 2 of 4

The config lives in a subfolder or monorepo package

1Check

eslint.workingDirectories controls the directory ESLint uses to resolve config and ignore files. The default is the workspace folder or file location. The auto mode infers it from package.json and config files.

find . -name "eslint.config.*" -not -path "*/node_modules/*"

2Fix

Point the extension at the folder, or use auto mode.

// .vscode/settings.json
{
  "eslint.workingDirectories": [{ "mode": "auto" }]
}

3Verify

Restart the ESLint server and open a file from the subfolder.

# Command palette: ESLint: Restart ESLint Server

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 3 of 4

The file type is not in eslint.validate

1Check

When eslint.validate is set, only the language ids in it are validated. A leftover array from the eslintrc days can exclude typescriptreact or another id.

grep -n "eslint" .vscode/settings.json

2Fix

Add the missing language ids, or remove the setting so the defaults apply.

// .vscode/settings.json
{
  "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"]
}

3Verify

Restart the ESLint server; open a .tsx file with a known violation.

# Command palette: ESLint: Restart ESLint Server

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 4 of 4

The project runs ESLint 10 and an old setting still points at a legacy file

1Check

From ESLint 10 the useFlatConfig setting is ignored because flat config cannot be turned off, and ESLint searches from each file's directory upward for eslint.config.*.

grep -n "useFlatConfig\|overrideConfigFile" .vscode/settings.json

2Fix

Remove the legacy settings and let the extension find eslint.config.js (supported extensions include .js, .mjs, .cjs, .ts, .mts).

// .vscode/settings.json: delete these keys
// "eslint.useFlatConfig": false,
// "eslint.options": { "overrideConfigFile": ".eslintrc.json" }

3Verify

Restart the ESLint server and watch the Output channel.

# Command palette: ESLint: Restart ESLint Server

Confirmed by raw.githubusercontent.com

Did this fix it?

How do I stop it coming back?

  • Commit .vscode/settings.json with the ESLint settings so the whole team has the same behaviour.
  • After changing config or settings, always run ESLint: Restart ESLint Server.
  • For remote setups (WSL, Remote SSH, Dev Containers) set the options in the remote settings and reload the window.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Related fixes

Web apps

tsconfig rejects allowImportingTsExtensions

An error that allowImportingTsExtensions needs noEmit or emitDeclarationOnly

allowImportingTsExtensions lets files import each other with .ts or .tsx extensions, and TypeScript only allows it together with noEmit or emitDeclarationOnly.

2 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.