1.1.0 ā€¢ Published 2 years ago

eslint-plugin-autofix v1.1.0

Weekly downloads
11,095
License
MIT
Repository
github
Last release
2 years ago

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}

Acknowledgement