idahogurl / vs-code-prettier-eslint

A Visual Studio Code Extension to format JavaScript and TypeScript code using the prettier-eslint package.
MIT License
184 stars 46 forks source link

not compatible with eslint 9+? #222

Open nullbio opened 1 month ago

nullbio commented 1 month ago

I think this is because the plugin does not appear to be compatible with eslint 9?

Error: Could not warm up worker. Formatting a file for the first time may take longer than usual.
Message: Invalid Options:
- Unknown options: ignorePath, resolvePluginsRelativeTo, rulePaths, useEslintrc
- 'resolvePluginsRelativeTo' has been removed.
- 'ignorePath' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.
Stacktrace: Error: Invalid Options:
- Unknown options: ignorePath, resolvePluginsRelativeTo, rulePaths, useEslintrc
- 'resolvePluginsRelativeTo' has been removed.
- 'ignorePath' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.
    at processOptions (/node_modules/eslint/lib/eslint/eslint-helpers.js:839:15)
    at new ESLint (/node_modules/eslint/lib/eslint/eslint.js:593:34)
    at getESLint (/node_modules/prettier-eslint/dist/utils.js:337:12)
    at getESLintConfig (/node_modules/prettier-eslint/dist/index.js:268:39)
    at analyze (/node_modules/prettier-eslint/dist/index.js:80:77)
    at format (/node_modules/prettier-eslint/dist/index.js:50:13)
    at file:///home/node/.vscode-server/extensions/rvest.vs-code-prettier-eslint-6.0.0/dist/worker.mjs:1:1516

Here's a github issue having the same errors due to version incompatibility, hence why I assume this is the reason:

https://github.com/vercel/next.js/issues/64409

dpnova commented 1 month ago

Confirmed here too

mattbrannon commented 1 month ago

ESLint version 9 deprecated .eslintrc files in favor of what they call "flat configs" which essentially are just javascript objects with a similar but slightly different structure. https://eslint.org/docs/latest/use/configure/configuration-files

If you're trying to use the new config format, it won't work until the extension is updated.

You should be able to do one of the following to get things working:

kevin82222 commented 2 weeks ago

Wow! I hope it can be supported.