question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ESLint fails to load plugins when using ESLint 6.x

See original GitHub issue

I 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. image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:186
  • Comments:173 (30 by maintainers)

github_iconTop GitHub Comments

89reactions
UncleClaptoncommented, Jul 2, 2019

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:

  • Problem began with ESLint 6. All versions of ESLint 5 I tried worked fine.
  • Same error occurs for all plugins (import, babel, react, react-hooks, jsx-a11y in my case), eslint just reports the first one and gives up.
  • ESLint 6 runs fine in CLI and other editors using the same config ESLint running under the extension fails out on.

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

79reactions
Luxiyalucommented, Jul 3, 2019

I was getting the same error for react-hooks config, and unchecking the VSCode option Use 'prettier-tslint' instead of 'prettier' dissipated the error for me.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found