eslint-plugin-abcsize
Calculate the Assignment/Branch/Condition Size Metric
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-abcsize
:
$ npm install eslint-plugin-abcsize --save-dev
Usage
Add abcsize
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"abcsize"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"abcsize/rule-name": 2
}
}
You can also extend the recommended configuration which will raise errors when the ABC Size of a function exceeds 15.
{
"extends": ["plugin:abcsize/recommended"]
}
Supported Rules
-
abcsize
Validate against a maximum ABC size.