You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I've been trying to set up eslint in our workspaces, and I can confirm that eslint has been correctly installed and configured: running yarn eslint src/**/*.vue for example runs as expected. We are having trouble getting the vscode-eslint extension to work with yarn.
On startup, we are seeing the following error in the ESLint Output tab (Ctrl + Shift + U on any vue or js file):
[Info - 1:54:23 PM] ESLint server is starting.
[Info - 1:54:23 PM] ESLint server running in node v18.18.2
[Info - 1:54:23 PM] ESLint server is running.
[Info - 1:54:26 PM] ESLint library loaded from: P:\M*************\frontend\.yarn\sdks\eslint\lib\unsupported-api.js
Uncaught exception received.
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from P:\M*************\frontend\eslint.config.js
Did you mean to import @eslint-js-npm-9.3.0-de76de965f-5af317c8bc.zip/node_modules/@eslint/js/src/index.js?
at new NodeError (node:internal/errors:405:5)
at packageResolve (node:internal/modules/esm/resolve:863:9)
at moduleResolve (node:internal/modules/esm/resolve:912:20)
at defaultResolve (node:internal/modules/esm/resolve:1105:11)
at nextResolve (node:internal/modules/esm/loader:166:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:840:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:429:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36)
Uncaught exception received.
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from P:\M*************\frontend\eslint.config.js
Did you mean to import @eslint-js-npm-9.3.0-de76de965f-5af317c8bc.zip/node_modules/@eslint/js/src/index.js?
at new NodeError (node:internal/errors:405:5)
at packageResolve (node:internal/modules/esm/resolve:863:9)
at moduleResolve (node:internal/modules/esm/resolve:912:20)
at defaultResolve (node:internal/modules/esm/resolve:1105:11)
at nextResolve (node:internal/modules/esm/loader:166:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:840:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:429:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36)
Uncaught exception received.
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from P:\M*************\frontend\eslint.config.js
Did you mean to import @eslint-js-npm-9.3.0-de76de965f-5af317c8bc.zip/node_modules/@eslint/js/src/index.js?
at new NodeError (node:internal/errors:405:5)
at packageResolve (node:internal/modules/esm/resolve:863:9)
at moduleResolve (node:internal/modules/esm/resolve:912:20)
at defaultResolve (node:internal/modules/esm/resolve:1105:11)
at nextResolve (node:internal/modules/esm/loader:166:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:840:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:429:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36)
Uncaught exception received.
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from P:\M*************\frontend\eslint.config.js
Did you mean to import @eslint-js-npm-9.3.0-de76de965f-5af317c8bc.zip/node_modules/@eslint/js/src/index.js?
at new NodeError (node:internal/errors:405:5)
at packageResolve (node:internal/modules/esm/resolve:863:9)
at moduleResolve (node:internal/modules/esm/resolve:912:20)
at defaultResolve (node:internal/modules/esm/resolve:1105:11)
at nextResolve (node:internal/modules/esm/loader:166:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:840:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:429:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36)
Expected Behaviour
Eslint server starting up correctly via yarn, and listing problems in the vscode Problems tab.
Reproduce
Run the following commands:
yarn add -D eslint@8.56.0 < this is necessary for @typescript-eslint/parser which does not support version 9.x yarn add -D @eslint/js typescript-eslint eslint-plugin-vue vue-eslint-parser @typescript-eslint/parser yarn install
Place the following eslint.config.js file in the root folder:
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginVue from "eslint-plugin-vue";
import vueParser from 'vue-eslint-parser';
import typescriptParser from '@typescript-eslint/parser';
export default [
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs["flat/recommended"],
{
languageOptions: {
parser: vueParser,
parserOptions: {
parser: typescriptParser,
sourceType: "module",
},
},
rules: {
// override/add rules settings here
'vue/multi-word-component-names': 'off',
semi: "warn",
"prefer-const": "warn",
},
},
];
Running yarn install or yarn dlx @yarnpkg/sdks does not fix this issue, even though both of these commands complete without errors.
If we run npm install, then the ESLint extension works properly, because it can find all related packages. We refuse however to use npm in our projects for the amount of overhead it produces.
Whilst the error shows only one package as the culprit, changing the order of packages in the eslint.config.js file shows that placing any package at the top will default it as the culprit for the error.
The text was updated successfully, but these errors were encountered:
Hi there, I've been trying to set up eslint in our workspaces, and I can confirm that eslint has been correctly installed and configured: running
yarn eslint src/**/*.vue
for example runs as expected. We are having trouble getting the vscode-eslint extension to work with yarn.On startup, we are seeing the following error in the ESLint Output tab (
Ctrl
+Shift
+U
on any vue or js file):Expected Behaviour
Eslint server starting up correctly via yarn, and listing problems in the vscode Problems tab.
Reproduce
yarn add -D eslint@8.56.0
< this is necessary for@typescript-eslint/parser
which does not support version9.x
yarn add -D @eslint/js typescript-eslint eslint-plugin-vue vue-eslint-parser @typescript-eslint/parser
yarn install
eslint.config.js
file in the root folder:settings.json
:Of Note
yarn install
oryarn dlx @yarnpkg/sdks
does not fix this issue, even though both of these commands complete without errors.npm install
, then the ESLint extension works properly, because it can find all related packages. We refuse however to usenpm
in our projects for the amount of overhead it produces.eslint.config.js
file shows that placing any package at the top will default it as the culprit for the error.The text was updated successfully, but these errors were encountered: