eslint-plugin-complex-if-condition

0.1.0 • Public • Published

eslint-plugin-complex-if-condition

checks whether the if condition is too complex

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-complex-if-condition:

npm install eslint-plugin-complex-if-condition --save-dev

Usage

Add complex-if-condition to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "complex-if-condition"
    ]
}

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

{
    "rules": {
        "complex-if-condition/count": ["warn", 4]
    }
}

Supported Rules

count

It checks the number of binary expressions in an if condition. It accepts an optional number as the second parameter which is the maximum number of binary expressions allowed in a condition. It has a default value of 3.

Package Sidebar

Install

npm i eslint-plugin-complex-if-condition

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

4.64 kB

Total Files

6

Last publish

Collaborators

  • minweishen