-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
Hi there,
So this is something that seems to have happened quite recently. I have installed eslint and eslint-plugin-react globally using npm i -g
I have an .eslintrc file in my home folder like so:
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"plugins": [
"react"
],
"extends": ["eslint:recommended", "plugin:react/recommended"],
"globals": {
"$": true
},
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"modules": true
}
},
"rules": {
"brace-style": "error",
"camelcase": ["error", { "properties": "never" }],
"comma-dangle": ["error", "never"],
"func-call-spacing": ["error", "never"],
"eqeqeq": "warn",
"indent": [ "error", 2, { "SwitchCase": 1 } ],
"key-spacing": [ "error", { "beforeColon": false } ],
"no-console": "off",
"no-fallthrough": "warn",
"prefer-const": "error",
"quotes": [ "error", "single" ],
"semi": [ "error", "never" ],
"react/prop-types": [ 0 ]
}
}I get the following error when I try to lint a file from the command line:
Oops! Something went wrong! :(
ESLint: 6.0.1.
ESLint couldn't find the plugin "eslint-plugin-react".
(The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "/path/to/project/folder".)
It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
npm install eslint-plugin-react@latest --save-dev
The plugin "eslint-plugin-react" was referenced from the config file in "PersonalConfig".
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.
I appreciate I could probably fix the issue by installing the plugin to devDependencies, but I would like to keep it global.
Any ideas?
lffg, harobed, LvChengbin, avissian, huanganqing and 11 more
Metadata
Metadata
Assignees
Labels
No labels