eslint-plugin-await-require-catch
要求使用以await
为前缀的函数时需要添加链式调用.catch()
, 本ESLint插件支持自动代码补齐
Installation
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
}
}