Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
507 views
in Technique[技术] by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...