Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
samrith-s opened this issue Jun 25, 2019 · 6 comments

Comments

@samrith-s
Copy link

samrith-s commented Jun 25, 2019

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. :/

@sevenmay
Copy link

I have the same problem inside VSCode with the ESLint extension.
But if I run "eslint --fix ..." in terminal it works just fine. @samrith-s have you tried it?

@samrith-s
Copy link
Author

@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.

@sevenmay
Copy link

@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

@samrith-s
Copy link
Author

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?

@samrith-s
Copy link
Author

@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.

@samrith-s
Copy link
Author

Closing this issue as it is not at all related to the plugin as previously thought.

dpinol added a commit to hubtype/botonic that referenced this issue Jul 25, 2019
eslint not upgraded to 6.1 because error "Cannot find module eslint-plugin-prettier."
prettier/eslint-plugin-prettier#208

prettier/eslint-plugin-prettier#208
node-nlp >3.4 required to tree-shake Chinese & Japanese dependencies
jest 24.8 is supposed to be faster
ts-mockito 2.4 can now mock interfaces
dpinol added a commit to hubtype/botonic that referenced this issue Jul 25, 2019
eslint not upgraded to 6.1 because error "Cannot find module eslint-plugin-prettier."
prettier/eslint-plugin-prettier#208

prettier/eslint-plugin-prettier#208
node-nlp >3.4 required to tree-shake Chinese & Japanese dependencies
jest 24.8 is supposed to be faster
ts-mockito 2.4 can now mock interfaces
dpinol added a commit to hubtype/botonic that referenced this issue Jul 26, 2019
eslint not upgraded to 6.1 because error "Cannot find module eslint-plugin-prettier."
prettier/eslint-plugin-prettier#208

prettier/eslint-plugin-prettier#208
node-nlp >3.4 required to tree-shake Chinese & Japanese dependencies
jest 24.8 is supposed to be faster
ts-mockito 2.4 can now mock interfaces
dpinol added a commit to hubtype/botonic that referenced this issue Jul 26, 2019
eslint not upgraded to 6.1 because error "Cannot find module eslint-plugin-prettier."
prettier/eslint-plugin-prettier#208

prettier/eslint-plugin-prettier#208
node-nlp >3.4 required to tree-shake Chinese & Japanese dependencies
jest 24.8 is supposed to be faster
ts-mockito 2.4 can now mock interfaces
ericmarcos pushed a commit to hubtype/botonic that referenced this issue Jul 26, 2019
eslint not upgraded to 6.1 because error "Cannot find module eslint-plugin-prettier."
prettier/eslint-plugin-prettier#208

prettier/eslint-plugin-prettier#208
node-nlp >3.4 required to tree-shake Chinese & Japanese dependencies
jest 24.8 is supposed to be faster
ts-mockito 2.4 can now mock interfaces
imOscarCrespo pushed a commit to hubtype/botonic that referenced this issue Aug 22, 2019
eslint not upgraded to 6.1 because error "Cannot find module eslint-plugin-prettier."
prettier/eslint-plugin-prettier#208

prettier/eslint-plugin-prettier#208
node-nlp >3.4 required to tree-shake Chinese & Japanese dependencies
jest 24.8 is supposed to be faster
ts-mockito 2.4 can now mock interfaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants