eslint-plugin-promise-catch

eslint plugin to sanitize promises catch block

Usage no npm install needed!

<script type="module">
  import eslintPluginPromiseCatch from 'https://cdn.skypack.dev/eslint-plugin-promise-catch';
</script>

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

Supported Rules