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.

Failed to load plugin 'prettier' declared in 'CLIOptions'. Cannot find module eslint-plugin-prettier.

See original GitHub issue

What version of eslint are you using? 6.0.1

What version of prettier are you using? 1.18.2

What version of eslint-plugin-prettier are you using? 3.1.0

Please paste any applicable config files that you’re using (e.g. .prettierrc or .eslintrc files) .eslintrc

{
    "parser": "babel-eslint",
    "extends": [
        "eslint:recommended",
        "plugin:import/errors",
        "plugin:import/warnings",
        "prettier"
    ],
    "plugins": ["import", "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
    }
}

package.json dependencies list

{
    "devDependencies": {
        "@babel/core": "^7.4.5",
        "@babel/plugin-proposal-class-properties": "^7.4.4",
        "@babel/plugin-proposal-object-rest-spread": "^7.4.4",
        "@babel/plugin-syntax-dynamic-import": "^7.2.0",
        "@babel/plugin-transform-async-to-generator": "^7.4.4",
        "@babel/plugin-transform-runtime": "^7.4.4",
        "@babel/preset-env": "^7.4.5",
        "babel-eslint": "^10.0.2",
        "babel-loader": "^8.0.6",
        "copy-webpack-plugin": "^5.0.3",
        "eslint": "^6.0.1",
        "eslint-config-prettier": "^5.1.0",
        "eslint-plugin-import": "^2.18.0",
        "eslint-plugin-prettier": "^3.1.0",
        "html-webpack-plugin": "^3.2.0",
        "prettier": "^1.18.2",
        "serverless-kubeless": "^0.7.1",
        "serverless-webpack": "^5.3.1",
        "webpack": "^4.35.0",
        "webpack-cli": "^3.3.5",
        "webpack-dev-server": "^3.7.2",
        "webpack-node-externals": "^1.7.2"
    },
    "dependencies": {
        "apollo-server-lambda": "^2.6.4",
        "babel-polyfill": "^6.26.0",
        "graphql": "^14.0.2",
        "moment": "^2.24.0",
        "oauth": "^0.9.15",
        "twitter": "^1.7.1"
    }
}

What source code are you linting? Javascript

What did you expect to happen? For the code to lint

What actually happened? Keep getting this error in VSCode terminal. Only for JS files. JSON and RC files lint just fine. image

I’ve set things up with this plugin countless times for countless projects, and have never faced this issue. This is so weird. 😕

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:40
  • Comments:6

github_iconTop GitHub Comments

6reactions
samrith-scommented, Jun 25, 2019

Removing prettier from the plugins array, just thew the same error, with plugin/import.

Filed an issue with vscode-eslint:#696. Can we leave this open for discussion in the meanwhile?

5reactions
samrith-scommented, Jun 25, 2019

@sevenmay Yes, the lint command works. But Formatting on Save, doesn’t work at all. Even after running eslint --fix, it throws the above error when I hit save on any JS file.

But eslint --fix fix the code right?

Made me think that could be a problem with the ESLint extension. Some issues with new versions of eslint and eslint-plugin-prettier

Yeah, most definitely an issue with vscode-eslint. No plugins seem to work anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to load plugin 'prettier' declared in '.eslintrc.js': Cannot ...
The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc). 2. If ESLint is installed globally, then make sure ' ......
Read more >
VSCode failed to load plugin cannot find module 'eslint-plugin ...
I'm installing eslint and Prettier in my project and trying to get automatic code formatting to ...
Read more >
[eslint] failed to load plugin 'prettier' declared in '.eslintrc.js'
The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc). 2. If ESLint is installed globally, then make sure 'eslint-plugin-...
Read more >
Error: Failed to load plugin prettier: Cannot find module 'eslint ...
Error : Failed to load plugin prettier: Cannot find module 'eslint-plugin-prettier' I always get the above error when using...
Read more >
eslint-plugin-prettier - npm
Runs prettier as an eslint rule. Latest version: 4.2.1, last published: 6 months ago. Start using eslint-plugin-prettier in your project by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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