1.0.1 • Published 6 years ago

eslint-plugin-return-early-dont-assign v1.0.1

Weekly downloads
59
License
MIT
Repository
github
Last release
6 years ago

eslint-plugin-return-early-dont-assign

Avoid assignment when you could just return.

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-return-early-dont-assign:

$ npm install eslint-plugin-return-early-dont-assign --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-return-early-dont-assign globally.

Usage

Add return-early-dont-assign to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "return-early-dont-assign"
    ]
}

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

{
    "rules": {
        "return-early-dont-assign/return-early-dont-assign": 2
    }
}

Supported Rules

  • return-early-dont-assign

Check docs for synopsis.

Special shoutout

This is my first ESLint plugin/rule and the following links helped make it happen: