Skip to main content

Rules

JavaScript

noArguments (since v0.7.0) recommended

Disallow the use of arguments

noAsyncPromiseExecutor (since v0.7.0) recommended

Disallows using an async function as a Promise executor.

noCatchAssign (since v0.7.0) recommended

Disallow reassigning exceptions in catch clauses

noCompareNegZero (since v0.7.0) recommended

Disallow comparing against -0

noDeadCode (since v0.7.0)

Disallow unreachable code

noDebugger (since v0.7.0) recommended

Disallow the use of debugger

noDelete (since v0.7.0) recommended

Disallow the use of the delete operator

noDoubleEquals (since v0.7.0) recommended

Require the use of === and !==

noDupeArgs (since v0.9.0) recommended

Disallow duplicate function arguments name.

noEmptyPattern (since v0.7.0) recommended

Disallows empty destructuring patterns.

noExtraBooleanCast (since v0.9.0) recommended

Disallow unnecessary boolean casts

noFunctionAssign (since v0.7.0) recommended

Disallow reassigning function declarations.

noImportAssign (since v0.9.0) recommended

Disallow assigning to imported bindings

noLabelVar (since v0.7.0) recommended

Disallow labels that share a name with a variable

noNegationElse (since v0.7.0) recommended

Disallow negation in the condition of an if statement if it has an else clause

noShadowRestrictedNames (since v0.9.0) recommended

Disallow identifiers from shadowing restricted names.

noShoutyConstants (since v0.7.0) recommended

Disallow the use of constants which its value is the upper-case version of its name.

noSparseArray (since v0.7.0) recommended

Disallow sparse arrays

noUnnecessaryContinue (since v0.7.0) recommended

Avoid using unnecessary ContinueStatement.

noUnsafeNegation (since v0.7.0) recommended

Disallow using unsafe negation.

noUnusedTemplateLiteral (since v0.7.0) recommended

Disallow template literals if interpolation and special-character handling are not needed

noUnusedVariables (since v0.9.0) recommended

Disallow unused variables.

useBlockStatements (since v0.7.0) recommended

Requires following curly brace conventions. JavaScript allows the omission of curly braces when a block contains only one statement. However, it is considered by many to be best practice to never omit curly braces around blocks, even when they are optional, because it can lead to bugs and reduces code clarity.

useCamelCase (since v0.8.0)

Enforce camel case naming convention.

useSimplifiedLogicExpression (since v0.7.0) recommended

Discard redundant terms from logical expressions.

useSingleCaseStatement (since v0.7.0) recommended

Enforces case clauses have a single statement, emits a quick fix wrapping the statements in a block

useSingleVarDeclarator (since v0.7.0) recommended

Disallow multiple variable declarations in the same variable statement

useTemplate (since v0.7.0) recommended

Template literals are preferred over string concatenation.

useValidTypeof (since v0.7.0) recommended

This rule verifies the result of typeof $expr unary expressions is being compared to valid values, either string literals containing valid type names or other typeof expressions

useWhile (since v0.7.0) recommended

Enforce the use of while loops instead of for loops when the initializer and update expressions are not needed

JSX

noCommentText (since v0.7.0) recommended

Prevent comments from being inserted as text nodes

noImplicitBoolean (since v0.7.0) recommended

Disallow implicit true values on JSX boolean attributes

useSelfClosingElements (since v0.7.0) recommended

Prevent extra closing tags for components without children

RegExp

noMultipleSpacesInRegularExpressionLiterals (since v0.7.0) recommended

Disallow unclear usage of multiple space characters in regular expression literals

TypeScript

useShorthandArrayType (since v0.7.0) recommended

When expressing array types, this rule promotes the usage of T[] shorthand instead of Array<T>.