ESLint fails to load plugins when using ESLint 6.x
See original GitHub issueI have the following packages installed as dev deps:
{
"babel-eslint": "^10.0.2",
"eslint": "^6.0.1",
"eslint-config-prettier": "^5.1.0",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-prettier": "^3.1.0",
}
And this is my .eslintrc
file:
{
"parser": "babel-eslint",
"plugins": ["import", "prettier"],
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"prettier"
],
"settings": {
"import/resolver": {
"node": {
"extensions": [".js"]
}
}
},
"env": {
"es6": true,
"browser": false,
"node": true,
"jquery": false,
"jest": true
},
"rules": {
"quotes": 0,
"no-console": 1,
"no-debugger": 1,
"no-var": 1,
"no-trailing-spaces": 0,
"eol-last": 0,
"no-underscore-dangle": 0,
"no-alert": 0,
"no-lone-blocks": 0,
"import/extensions": 1,
"import/no-named-as-default": 0,
"prettier/prettier": [
"error",
{
"singleQuote": true
}
]
},
"globals": {
"Atomics": false,
"SharedArrayBuffer": false
}
}
I have Format on Save
on. When I run eslint --fix
, it works properly. But when I hit save, I get the following error. It doesn’t work for any plugin, even though I have all of them installed.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:186
- Comments:173 (30 by maintainers)
Top Results From Across the Web
Failed to load plugin 'import' declared in '... » eslint-config ...
js This can happen for a couple of reasons: - The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc)....
Read more >Error: Failed to load plugin declared in '.eslintrc' : WEB-44691
In WebStorm preferences — manually configured ESLint with the path to the global ESLint package. Added "plugins": ["fp"] to the .eslint.rc file to...
Read more >eslint/eslint - Gitter
It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: npm install eslint-plugin-vue@latest --save-dev The plugin " ...
Read more >ESLint - npm
Start using eslint in your project by running `npm i eslint`. There are no other projects in the npm registry using eslint.
Read more >Migrating to v6.0.0 - ESLint - Pluggable JavaScript Linter
As of April 2019, Node.js 6 will be at EOL and will no longer be ... If you are unable to upgrade, we...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi there!
I ran into this today while updating our ESLint config repository (found here).
I’ve done some digging and found that it’s probably an incompatibility between vscode-eslint and ESLint 6, but without more detailed error reporting from the extension I can’t pinpoint the problem.
Here’s some major things I noted while testing:
import
,babel
,react
,react-hooks
,jsx-a11y
in my case), eslint just reports the first one and gives up.I hope this helps find the root cause! I’m going to continue trying to find a workaround to make ESLint 6 work, but so far the only thing I’ve found is to downgrade to ESLint 5.16.0
I was getting the same error for
react-hooks
config, and unchecking the VSCode optionUse 'prettier-tslint' instead of 'prettier'
dissipated the error for me.