简体   繁体   中英

couldn't find the plugin “eslint-plugin-promise”

I've done the followings to use eslint globally so not repeat on every new project but I am not able to get the eslint plugin part to work. what step am I missing:

  • installed eslint (& the eslint-plugin-promise ) globally
  • created a.eslintrc file in my home directory,and included these in it
    {
     "env": {
     "browser": true,
     "es6": true,
     "node": true
     },
      "plugins": [
        "promise"
      ]
    }

and I expect that when I run eslint in any directory the plugin to be known. so in my work directory I add a.eslintrc.json with all the rules I wanted to apply but I get these errors:

   1:1  error  Definition for rule 'promise/always-return' was not found    promise/always-return
   1:1  error  Definition for rule 'promise/catch-or-return' was not found  promise/catch-or-return
   1:1  error  Definition for rule 'promise/no-nesting' was not found       promise/no-nesting

Now if I add this to local.eslintrc

  "plugins": [
    "promise",
  ],

I get this error: ESLint couldn't find the plugin "eslint-plugin-promise". and recommends me to install it locally. but that's exactly what I want to avoid.

Try to upgrade to the latest version of ESLint and make sure it's configured properly in .eslintrc.json

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM