eslint-plugin-max-return-statements-per-function
v0.2.0
Published
ESLint rule to limit the number of return statements in a function
Downloads
41
Maintainers
Readme
eslint-plugin-max-return-statements-per-function
This rule reproduces one of codeclimate's default checks, return statements
, with ESLint.
Installation
npm
npm install --save-dev eslint-plugin-max-return-statements-per-function
yarn
yarn add -D eslint-plugin-max-return-statements-per-function
Usage
The rule takes one option, which is the maximum number of return statements in a function. The default is 4.
You can set the option like this in .eslintrc.js
:
module.exports = {
plugins: ["max-return-statements-per-function"],
rules: {
"max-return-statements-per-function/max-return-statements-per-function": ["error", 4],
},
};
License
MIT