0.2.0 • Published 2 years ago

eslint-plugin-max-return-statements-per-function v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

eslint-plugin-max-return-statements-per-function

npm version

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