Skip to content

Learn-form-Zakas/eslint-plugin-await-require-catch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-await-require-catch

要求使用await为前缀的函数时需要添加链式调用.catch(), 本ESLint插件支持自动代码补齐

Installation npm version npm dm

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-await-require-catch:

$ npm install eslint-plugin-await-require-catch --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-await-require-catch globally.

Usage

Add await-require-catch to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
   "plugins": ["await-require-catch"],
}

Then configure the rules you want to use under the rules section.

{
   "rules": {
        "await-require-catch/await-require-catch": 1
    }
}

About

await function add .catch() to avoid error: 'Uncaught (in promise)'

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published