eslint-plugin-promise-catch
v1.0.1
Published
eslint plugin to sanitize promises catch block
Downloads
2
Maintainers
Readme
eslint-plugin-promise-catch
eslint plugin to sanitize catch promise block
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-promise-catch
:
$ npm install eslint-plugin-promise-catch --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-promise-catch
globally.
Usage
Add promise-catch
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"promise-catch"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"promise-catch/throw-or-log": [2, {
"customLoggers": true
// allow any CallExpression to be a logging function
}]
}
}