Skip to content

aladdin-add/eslint-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build status dependency status

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-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 πŸ›  require 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-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-unsafe-negation πŸ›  disallow negating the left operand of relational operators
no-unused-labels πŸ›  disallow unused labels
no-unused-vars πŸ›  disallow unused variables
no-useless-computed-key πŸ›  disallow unnecessary computed property keys in object literals
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-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