1.1.0 ā¢ Published 2 years ago
eslint-plugin-autofix v1.1.0
eslint-plugin-autofix
Install & usage
$ npm i eslint-plugin-autofix -D
add prefix "autofix" to the rulename in eslintrc:
{
"plugins": ["autofix"],
"rules": {
"autofix/no-debugger": "error"
}
}
Supported rules
āļø indicates that a rule is recommended for all users. š indicates that a rule is fixable.
Name | āļø | š | Description |
---|---|---|---|
array-bracket-newline | š | enforce linebreaks after opening and before closing array brackets | |
array-bracket-spacing | š | enforce consistent spacing inside array brackets | |
array-element-newline | š | enforce line breaks after each array element | |
arrow-body-style | š | require braces around arrow function bodies | |
arrow-parens | š | require parentheses around arrow function arguments | |
arrow-spacing | š | enforce consistent spacing before and after the arrow in arrow functions | |
block-spacing | š | disallow or enforce spaces inside of blocks after opening block and before closing block | |
brace-style | š | enforce consistent brace style for blocks | |
capitalized-comments | š | enforce or disallow capitalization of the first letter of a comment | |
comma-dangle | š | require or disallow trailing commas | |
comma-spacing | š | enforce consistent spacing before and after commas | |
comma-style | š | enforce consistent comma style | |
computed-property-spacing | š | enforce consistent spacing inside computed property brackets | |
curly | š | enforce consistent brace style for all control statements | |
dot-location | š | enforce consistent newlines before and after dots | |
dot-notation | š | enforce dot notation whenever possible | |
eol-last | š | require or disallow newline at the end of files | |
eqeqeq | š | require the use of === and !== | |
func-call-spacing | š | require or disallow spacing between function identifiers and their invocations | |
function-call-argument-newline | š | enforce line breaks between arguments of a function call | |
function-paren-newline | š | enforce consistent line breaks inside function parentheses | |
generator-star-spacing | š | enforce consistent spacing around * operators in generator functions | |
implicit-arrow-linebreak | š | enforce the location of arrow function bodies | |
indent | š | enforce consistent indentation | |
indent-legacy | š | enforce consistent indentation | |
jsx-quotes | š | enforce the consistent use of either double or single quotes in JSX attributes | |
key-spacing | š | enforce consistent spacing between keys and values in object literal properties | |
keyword-spacing | š | enforce consistent spacing before and after keywords | |
linebreak-style | š | enforce consistent linebreak style | |
lines-around-comment | š | require empty lines around comments | |
lines-around-directive | š | require or disallow newlines around directives | |
lines-between-class-members | š | require or disallow an empty line between class members | |
multiline-comment-style | š | enforce a particular style for multiline comments | |
new-parens | š | enforce or disallow parentheses when invoking a constructor with no arguments | |
newline-after-var | š | require or disallow an empty line after variable declarations | |
newline-before-return | š | require an empty line before return statements | |
newline-per-chained-call | š | require a newline after each call in a method chain | |
no-alert | š | disallow the use of alert , confirm , and prompt | |
no-caller | š | disallow the use of arguments.caller or arguments.callee | |
no-confusing-arrow | š | disallow arrow functions where they could be confused with comparisons | |
no-console | āļø | š | disallow the use of console |
no-debugger | āļø | š | disallow the use of debugger |
no-div-regex | š | disallow division operators explicitly at the beginning of regular expressions | |
no-else-return | š | disallow else blocks after return statements in if statements | |
no-eq-null | š | disallow null comparisons without type-checking operators | |
no-extra-bind | š | disallow unnecessary calls to .bind() | |
no-extra-boolean-cast | š | disallow unnecessary boolean casts | |
no-extra-label | š | disallow unnecessary labels | |
no-extra-parens | š | disallow unnecessary parentheses | |
no-extra-semi | š | disallow unnecessary semicolons | |
no-floating-decimal | š | disallow leading or trailing decimal points in numeric literals | |
no-implicit-coercion | š | disallow shorthand type conversions | |
no-lonely-if | š | disallow if statements as the only statement in else blocks | |
no-multi-spaces | š | disallow multiple spaces | |
no-multiple-empty-lines | š | disallow multiple empty lines | |
no-new-symbol | š | disallow new operators with the Symbol object | |
no-plusplus | āļø | š | disallow the unary operators ++ and -- |
no-proto | š | disallow the use of the __proto__ property | |
no-prototype-builtins | š | disallow calling some Object.prototype methods directly on objects | |
no-regex-spaces | š | disallow multiple spaces in regular expressions | |
no-spaced-func | š | disallow spacing between function identifiers and their applications (deprecated) | |
no-throw-literal | š | disallow throwing literals as exceptions | |
no-trailing-spaces | š | disallow trailing whitespace at the end of lines | |
no-undef-init | š | disallow initializing variables to undefined | |
no-unneeded-ternary | š | disallow ternary operators when simpler alternatives exist | |
no-unused-labels | š | disallow unused labels | |
no-unused-vars | š | disallow unused variables | |
no-useless-catch | š | disallow unnecessary catch clauses | |
no-useless-computed-key | š | disallow unnecessary computed property keys in objects and classes | |
no-useless-concat | š | disallow unnecessary concatenation of literals or template literals | |
no-useless-rename | š | disallow renaming import, export, and destructured assignments to the same name | |
no-useless-return | š | disallow redundant return statements | |
no-var | š | require let or const instead of var | |
no-whitespace-before-property | š | disallow whitespace before properties | |
nonblock-statement-body-position | š | enforce the location of single-line statements | |
object-curly-newline | š | enforce consistent line breaks inside braces | |
object-curly-spacing | š | enforce consistent spacing inside braces | |
object-property-newline | š | enforce placing object properties on separate lines | |
object-shorthand | š | require or disallow method and property shorthand syntax for object literals | |
one-var | š | enforce variables to be declared either together or separately in functions | |
one-var-declaration-per-line | š | require or disallow newlines around variable declarations | |
operator-assignment | š | require or disallow assignment operator shorthand where possible | |
operator-linebreak | š | enforce consistent linebreak style for operators | |
padded-blocks | š | require or disallow padding within blocks | |
padding-line-between-statements | š | require or disallow padding lines between statements | |
prefer-arrow-callback | š | require using arrow functions for callbacks | |
prefer-const | š | require const declarations for variables that are never reassigned after declared | |
prefer-destructuring | š | require destructuring from arrays and/or objects | |
prefer-exponentiation-operator | š | disallow the use of Math.pow in favor of the ** operator | |
prefer-numeric-literals | š | disallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals | |
prefer-object-spread | š | disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead. | |
prefer-spread | š | require spread operators instead of .apply() | |
prefer-template | š | require template literals instead of string concatenation | |
quote-props | š | require quotes around object literal property names | |
quotes | š | enforce the consistent use of either backticks, double, or single quotes | |
radix | š | enforce the consistent use of the radix argument when using parseInt() | |
rest-spread-spacing | š | enforce spacing between rest and spread operators and their expressions | |
semi | š | require or disallow semicolons instead of ASI | |
semi-spacing | š | enforce consistent spacing before and after semicolons | |
semi-style | š | enforce location of semicolons | |
sort-imports | š | enforce sorted import declarations within modules | |
sort-vars | š | require variables within the same declaration block to be sorted | |
space-before-blocks | š | enforce consistent spacing before blocks | |
space-before-function-paren | š | enforce consistent spacing before function definition opening parenthesis | |
space-in-parens | š | enforce consistent spacing inside parentheses | |
space-infix-ops | š | require spacing around infix operators | |
space-unary-ops | š | enforce consistent spacing before or after unary operators | |
spaced-comment | š | enforce consistent spacing after the // or /* in a comment | |
strict | š | require or disallow strict mode directives | |
switch-colon-spacing | š | enforce spacing around colons of switch statements | |
template-curly-spacing | š | require or disallow spacing around embedded expressions of template strings | |
template-tag-spacing | š | require or disallow spacing between template tags and their literals | |
unicode-bom | š | require or disallow Unicode byte order mark (BOM) | |
valid-jsdoc | š | enforce valid JSDoc comments | |
valid-typeof | š | enforce comparing typeof expressions against valid strings | |
wrap-iife | š | require parentheses around immediate function invocations | |
wrap-regex | š | require parenthesis around regex literals | |
yield-star-spacing | š | require or disallow spacing around the * in yield* expressions | |
yoda | š | require or disallow "Yoda" conditions |
Contributing
- to add a new rule:
npm run new ${ruleName}