0.0.2 • Published 7 years ago
eslint-plugin-checkbugs v0.0.2
eslint-plugin-checkbugs
Checks for common sources of bugs and logic errors
Installation
You'll first need to install ESLint with NPM, Yarn, or your favorite package manager:
$ npm i eslint --save-dev
$ yarn add --dev eslint
Next, install eslint-plugin-checkbugs
:
$ npm install eslint-plugin-checkbugs --save-dev
$ yarn add --dev eslint-plugin-checkbugs
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-checkbugs
globally.
Usage
Add checkbugs
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"checkbugs"
]
}
Then you may extend from presets and/or configure the individual rules you want to use under the rules section.
{
"extends": [
"eslint:recommended",
"plugin:checkbugs/recommended"
]
}
{
"rules": {
"checkbugs/rule-name": 2
}
}
Supported Rules
Rule Name | Added in | Recommended |
---|---|---|
no-backwards-assign-ops | 0.0.1 | Warn |
no-bad-odd-checks | 0.0.1 | Error |
no-bool-math | 0.0.1 | Error |
no-bool-num-compares | 0.0.1 | Error |
no-comma-in-indexing | 0.0.1 | Error |
no-double-comparison | 0.0.1 | Error |
no-emptyexpr-choice-loop | 0.0.1 | Error |
no-identical-bitwise-sides | 0.0.1 | Error |
no-identical-comparison-sides | 0.0.1 | Error |
no-identical-logical-sides | 0.0.1 | Error |
no-identical-math-sides | 0.0.1 | Warn |
no-invalid-sharedlogic-part | 0.0.1 | Error |
no-modulo-one | 0.0.1 | Warn |
no-modulo-then-multiply | 0.0.1 | Warn |
no-overwritten-increment | 0.0.1 | Error |
no-same-assignment | 0.0.1 | Error |
no-same-if-else-blocks | 0.0.1 | Warn |
no-same-if-elseif-condition | 0.0.1 | Error |
no-same-switchcase-blocks | 0.0.1 | Warn |
no-same-switchcase-condition | 0.0.1 | Error |
no-similar-compare-expression | 0.0.1 | Error |
no-triple-negation | 0.0.1 | Error |
no-ungrouped-bshift-add | 0.0.1 | Warn |
no-useless-zeros | 0.0.1 | Warn |