vscode-eslint: "Unknown options: extensions" error using flat config

With the move to ESlint 9.0 I enabled the use of flat config in VSC. But the ESlint extension complains:

[Info  - 12:25:52 PM] ESLint server is starting.
[Info  - 12:25:52 PM] ESLint server running in node v18.18.2
[Info  - 12:25:52 PM] ESLint server is running.
[Info  - 12:25:57 PM] ESLint library loaded from: D:\Projects\STMng\node_modules\eslint\lib\api.js
[Error - 12:25:57 PM] An unexpected error occurred:
[Error - 12:25:57 PM] Error: Invalid Options:
- Unknown options: extensions
- 'extensions' has been removed.
    at processOptions (D:\Projects\STMng\node_modules\eslint\lib\eslint\eslint-helpers.js:805:15)
    at new ESLint (D:\Projects\STMng\node_modules\eslint\lib\eslint\eslint.js:592:34)
    at q (c:\Users\mvalle\.vscode\extensions\dbaeumer.vscode-eslint-2.4.4\server\out\eslintServer.js:1:18577)
    at E (c:\Users\mvalle\.vscode\extensions\dbaeumer.vscode-eslint-2.4.4\server\out\eslintServer.js:1:19075)
    at e.validate (c:\Users\mvalle\.vscode\extensions\dbaeumer.vscode-eslint-2.4.4\server\out\eslintServer.js:1:24921)
    at c:\Users\mvalle\.vscode\extensions\dbaeumer.vscode-eslint-2.4.4\server\out\eslintServer.js:1:220305

Apparently the extension works.

Version: 1.88.0 Commit: 5c3e652f63e798a5ac2f31ffd0d863669328dc4c Date: 2024-04-03T13:26:18.741Z Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.88.0 Chrome/120.0.6099.291 Electron/28.2.8 Safari/537.36

About this issue

  • Original URL
  • State: closed
  • Created 3 months ago
  • Reactions: 5
  • Comments: 19 (6 by maintainers)

Most upvoted comments

I’ve caught the issue! It turns out that there was an extension configuration option in my User/settings.json file. I removed it and ESLint is back to normal now:

In file: ~/Library/Application\ Support/Code/User/settings.json

 "eslint.options": {
    "extensions": [ ".html", ".js", ".vue", ".jsx" ]
},

image

@crystalfp @asakurayoh1987 If you’re having the same issue, check your User settings.json for the config I mentioned.

Does linting work for you correctly in the terminal. If so, can you please provide me with a GitHub repository I can clone with a minimal setup that demos the problem.

Hi ~ I had the same problem…

I tried to make a mini reproduction: https://github.com/pdsuwwz/eslint-v9-mini-repo

It works on the terminal:

image

but vscode-eslint still reports errors:

image