eslint-plugin-promise-catch

1.0.1 • Public • Published

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
        }]
    }
}

Supported Rules

Package Sidebar

Install

npm i eslint-plugin-promise-catch

Weekly Downloads

19

Version

1.0.1

License

ISC

Unpacked Size

48.5 kB

Total Files

7

Last publish

Collaborators

  • jakwuh