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
Finally eslint has support for class fields in version 8.0.0-rc.0! So I upgraded in package.json in my existing project created half a year ago with the terrific npm init @open-wc command.
I expected (or at least hoped :) fingers crossed) that it would work right out the box so that I could start using private class fields in my code without the linter crashing on syntax errors.
Actual Behavior
Upgrading to that verison in my project makes the @open-wc/eslint-config configuration crash.
➜ open-wc-project ✗ npx eslint --ext .js,.html . --ignore-path .gitignore
Oops! Something went wrong! :(
ESLint: 8.0.0-rc.0
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Failed to load plugin 'import' declared in'package.json » @open-wc/eslint-config » /home/user/open-wc-project/node_modules/eslint-config-airbnb-base/index.js » /home/user/open-wc-project/node_modules/eslint-config-airbnb-base/rules/imports.js': Package subpath './lib/util/glob-util' is not defined by "exports"in /home/user/open-wc-project/node_modules/eslint/package.json
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (/home/user/open-wc-project/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (/home/user/open-wc-project/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js:43:34)
I manually installed the latest import plugin and it worked
npm install eslint-plugin-import
infact, I think, if you remove the node_modules and package_lock.json file, and do a fresh npm install, that will also solve the problem.
my node_modules was somehow having an older version of eslint-plugin-import.
try checking version
Expected behavior
Finally eslint has support for class fields in version 8.0.0-rc.0! So I upgraded in package.json in my existing project created half a year ago with the terrific
npm init @open-wc
command.I expected (or at least hoped :) fingers crossed) that it would work right out the box so that I could start using private class fields in my code without the linter crashing on syntax errors.
Actual Behavior
Upgrading to that verison in my project makes the @open-wc/eslint-config configuration crash.
Additional context
Most relevant parts of package.json:
Running prettier seem to fail the files with private fields as well, but at least it does not crash so it is not as large of a blocker:
Thanks for all the great work you have put into making modern JavaScript accessible for more developers! 👍
The text was updated successfully, but these errors were encountered: