eslint-plugin-checkbugs
v0.0.2
Published
Checks for common sources of bugs and logic errors
Maintainers
Readme
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 eslintNext, install eslint-plugin-checkbugs:
$ npm install eslint-plugin-checkbugs --save-dev
$ yarn add --dev eslint-plugin-checkbugsNote: 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 |
Included rules built-in to ESLint
| Rule Name | Options | Added in |
| :-------- | :------ | :------: |
| no-compare-neg-zero | | 0.0.1 |
| no-cond-assign | | 0.0.1 |
| no-constant-condition | | 0.0.1 |
| no-control-regex | | 0.0.1 |
| no-dup-args | | 0.0.1 |
| no-dup-keys | | 0.0.1 |
| no-empty | | 0.0.1 |
| no-empty-character-class | | 0.0.1 |
| no-ex-assign | | 0.0.1 |
| no-extra-boolean-cast | | 0.0.1 |
| curly | | 0.0.1 |
| no-func-assign | | 0.0.1 |
| no-inner-declarations | | 0.0.1 |
| no-invalid-regexp | | 0.0.1 |
| no-irregular-whitespace | | 0.0.1 |
| no-obj-calls | | 0.0.1 |
| no-regex-spaces | | 0.0.1 |
| no-sparse-arrays | | 0.0.1 |
| no-unexpected-multiline | | 0.0.1 |
| no-unreachable | | 0.0.1 |
| no-unsafe-finally | | 0.0.1 |
| no-unsafe-negation | | 0.0.1 |
| use-isnan | | 0.0.1 |
| valid-typeof | | 0.0.1 |
| array-callback-return | | 0.0.1 |
| block-scoped-var | | 0.0.1 |
| no-case-declarations | | 0.0.1 |
| no-empty-pattern | | 0.0.1 |
| no-global-assign | | 0.0.1 |
| no-new-wrappers | | 0.0.1 |
| no-octal | | 0.0.1 |
| no-redeclare | | 0.0.1 |
| no-unused-expressions | {allowShortCircuit: true} | 0.0.1 |
| no-unmodified-loop-condition | | 0.0.1 |
| no-unused-labels | | 0.0.1 |
| no-useless-concat | | 0.0.1 |
| no-useless-escape | | 0.0.1 |
| no-delete-var | | 0.0.1 |
| no-shadow-restricted-names | | 0.0.1 |
| no-undef | | 0.0.1 |
| no-unused-vars | | 0.0.1 |
| no-use-before-define | {functions: false, classes: false} | 0.0.1 |
| constructor-super | | 0.0.1 |
| no-class-assign | | 0.0.1 |
| no-confusing-arrow | | 0.0.1 |
| no-const-assign | | 0.0.1 |
| no-dupe-class-members | | 0.0.1 |
| no-duplicate-imports | | 0.0.1 |
| no-new-symbol | | 0.0.1 |
| no-this-before-super | | 0.0.1 |
| no-useless-computed-key | | 0.0.1 |
