Logo
  • DB
  • About
  • Updates
@typescript-eslint/eslint-plugin

TypeScript plugin for ESLint

❯ npm i --save-dev @typescript-eslint/eslint-plugin
📖 README🐛 BugsGitHub LogoGitHubnpm Logonpmtypescript
🕵️‍♂️ Linter
  • 11 Configs
  • 133 Rules
GitHub LogoGitHub
  • TypeScript
  • 14.2K Stars
  • 92 Watchers
npm Logonpm
  • 14.7M Wkly Downloads
  • +41% WoW
  • 6.17.0 2.55 MB
📋 Requirements
  • Node: ^16 || >=18
  • @typescript-eslint...: ^6 || ^6-alpha
  • ESLint: ^7 || ^8
🗂️ Keywords
  • tslint
ConfigurationRules
🌐 all132
🔴 base
🟠 disable-type-checked45 off
🟡 eslint-recommended
recommended17
🟢 recommended-requiring-type-checking36
🔵 recommended-type-checked36
🔒 strict26
🟣 strict-type-checked55
🎨 stylistic15
🟤 stylistic-type-checked20
RuleDescription🔧💡💭🗂️⚙️🌐🔴🟠🟡🟢🔵🔒🟣🎨🟤
adjacent-overload-signatures

Require that function overload signatures be consecutive

📖🌐🎨🟤
array-type

Require consistently using either T[] or Array<T> for arrays

🔧📖⚙️🌐🎨🟤
await-thenable

Disallow awaiting a value that is not a Thenable

🌐🚫🟢🔵🟣
ban-ts-comment

Disallow @ts-<directive> comments or require descriptions after directives

⚙️🌐🟢🔵🔒🟣
ban-tslint-comment

Disallow // tslint:<rule-flag> comments

🔧📖🌐🎨🟤
ban-types

Disallow certain types

🔧💡📖⚙️🌐🟢🔵🔒🟣
block-spacing

Disallow or enforce spaces inside of blocks after opening block and before closing block

🔧📏🌐
brace-style

Enforce consistent brace style for blocks

🔧📏⚙️🌐
class-literal-property-style

Enforce that literals on classes are exposed in a consistent style

💡🌐🎨🟤
class-methods-use-this

Enforce that class methods utilize this

🔧📖⚙️🌐
comma-dangle

Require or disallow trailing commas

🔧📏⚙️🌐
comma-spacing

Enforce consistent spacing before and after commas

🔧📏⚙️🌐
consistent-generic-constructors

Enforce specifying generic type arguments on type annotation or constructor name of a constructor call

🔧📖🌐🎨🟤
consistent-indexed-object-style

Require or disallow the Record type

🔧📖🌐🎨🟤
consistent-type-assertions

Enforce consistent usage of type assertions

🔧💡📖⚙️🌐🎨🟤
consistent-type-definitions

Enforce type definitions to consistently use either interface or type

🔧📖🌐🎨🟤
consistent-type-exports

Enforce consistent usage of type exports

🔧📖⚙️🌐🚫
consistent-type-imports

Enforce consistent usage of type imports

🔧📖⚙️🌐
default-param-last

Enforce default parameters to be last

📖🌐
dot-notation

Enforce dot notation whenever possible

🔧📖⚙️🌐🚫🟤
explicit-function-return-type

Require explicit return types on functions and class methods

⚙️🌐
explicit-member-accessibility

Require explicit accessibility modifiers on class properties and methods

🔧💡⚙️🌐
explicit-module-boundary-types

Require explicit return and argument types on exported functions' and classes' public class methods

⚙️🌐
func-call-spacing

Require or disallow spacing between function identifiers and their invocations

🔧📏⚙️🌐
indent

Enforce consistent indentation

🔧📏⚙️🌐
init-declarations

Require or disallow initialization in variable declarations

📖⚙️🌐
key-spacing

Enforce consistent spacing between property names and type annotations in types and interfaces

🔧📏⚙️🌐
keyword-spacing

Enforce consistent spacing before and after keywords

🔧📏⚙️🌐
lines-around-comment

Require empty lines around comments

🔧📏⚙️🌐
lines-between-class-members

Require or disallow an empty line between class members

🔧📏⚙️🌐
member-delimiter-style

Require a specific member delimiter style for interfaces and type literals

🔧📏⚙️🌐
member-ordering

Require a consistent member declaration order

📖⚙️🌐
method-signature-style

Enforce using a particular method signature syntax

🔧📖🌐
naming-convention

Enforce naming conventions for everything across a codebase

📖⚙️🌐🚫
no-array-constructor

Disallow generic Array constructors

🔧📖🌐🟢🔵🔒🟣
no-base-to-string

Require .toString() to only be called on objects which provide useful information when stringified

📖⚙️🌐🚫🟢🔵🟣
no-confusing-non-null-assertion

Disallow non-null assertion in locations that may be confusing

🔧💡🌐🎨🟤
no-confusing-void-expression

Require expressions of type void to appear in statement position

🔧💡⚙️🌐🚫🟣
no-dupe-class-members

Disallow duplicate class members

🌐
no-duplicate-enum-values

Disallow duplicate enum member values

🌐🟢🔵🔒🟣
no-duplicate-type-constituents

Disallow duplicate constituents of union or intersection types

🔧📖⚙️🌐🚫🟢🔵🟣
no-dynamic-delete

Disallow using the delete operator on computed key expressions

🔧📖🌐🔒🟣
no-empty-function

Disallow empty functions

📖⚙️🌐🎨🟤
no-empty-interface

Disallow the declaration of empty interfaces

🔧💡📖⚙️🌐🎨🟤
no-explicit-any

Disallow the any type

🔧💡📖⚙️🌐🟢🔵🔒🟣
no-extra-non-null-assertion

Disallow extra non-null assertions

🔧🌐🟢🔵🔒🟣
no-extra-parens

Disallow unnecessary parentheses

🔧📏⚙️🌐
no-extra-semi

Disallow unnecessary semicolons

🔧📖🌐
no-extraneous-class

Disallow classes used as namespaces

📖⚙️🌐🔒🟣
no-floating-promises

Require Promise-like statements to be handled appropriately

💡⚙️🌐🚫🟢🔵🟣
no-for-in-array

Disallow iterating over an array with a for-in loop

🌐🚫🟢🔵🟣
no-implied-eval

Disallow the use of eval()-like methods

📖🌐🚫🟢🔵🟣
no-import-type-side-effects

Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers

🔧🌐
no-inferrable-types

Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean

🔧📖⚙️🌐🎨🟤
no-invalid-this

Disallow this keywords outside of classes or class-like objects

📖🌐
no-invalid-void-type

Disallow void type outside of generic or return types

⚙️🌐🔒🟣
no-loop-func

Disallow function declarations that contain unsafe references inside loop statements

📖🌐
no-loss-of-precision

Disallow literal numbers that lose precision

🌐🟢🔵🔒🟣
no-magic-numbers

Disallow magic numbers

📖⚙️🌐
no-meaningless-void-operator

Disallow the void operator except when used to discard a value

🔧💡📖⚙️🌐🚫🟣
no-misused-new

Enforce valid definition of new and constructor

🌐🟢🔵🔒🟣
no-misused-promises

Disallow Promises in places not designed to handle them

⚙️🌐🚫🟢🔵🟣
no-mixed-enums

Disallow enums from having both number and string members

🌐🚫🟣
no-namespace

Disallow TypeScript namespaces

📖⚙️🌐🟢🔵🔒🟣
no-non-null-asserted-nullish-coalescing

Disallow non-null assertions in the left operand of a nullish coalescing operator

💡🌐🔒🟣
no-non-null-asserted-optional-chain

Disallow non-null assertions after an optional chain expression

💡🌐🟢🔵🔒🟣
no-non-null-assertion

Disallow non-null assertions using the ! postfix operator

💡🌐🔒🟣
no-redeclare

Disallow variable redeclaration

📖⚙️🌐
no-redundant-type-constituents

Disallow members of unions and intersections that do nothing or override type information

📖🌐🚫🟢🔵🟣
no-require-imports

Disallow invocation of require()

🌐
no-restricted-imports

Disallow specified modules when loaded by import

📖⚙️🌐
no-shadow

Disallow variable declarations from shadowing variables declared in the outer scope

📖⚙️🌐
no-this-alias

Disallow aliasing this

📖⚙️🌐🟢🔵🔒🟣
no-throw-literal

Disallow throwing literals as exceptions

⚙️🌐🚫🟣
no-type-alias

Disallow type aliases

📖⚙️
no-unnecessary-boolean-literal-compare

Disallow unnecessary equality comparisons against boolean literals

🔧📖⚙️🌐🚫🟣
no-unnecessary-condition

Disallow conditionals where the type is always truthy or always falsy

🔧📖⚙️🌐🚫🟣
no-unnecessary-qualifier

Disallow unnecessary namespace qualifiers

🔧📖🌐🚫
no-unnecessary-type-arguments

Disallow type arguments that are equal to the default

🔧📖🌐🚫🟣
no-unnecessary-type-assertion

Disallow type assertions that do not change the type of an expression

🔧📖⚙️🌐🚫🟢🔵🟣
no-unnecessary-type-constraint

Disallow unnecessary constraints on generic types

💡📖🌐🟢🔵🔒🟣
no-unsafe-argument

Disallow calling a function with a value with type any

🌐🚫🟢🔵🟣
no-unsafe-assignment

Disallow assigning a value with type any to variables and properties

🌐🚫🟢🔵🟣
no-unsafe-call

Disallow calling a value with type any

🌐🚫🟢🔵🟣
no-unsafe-declaration-merging

Disallow unsafe declaration merging

🌐🟢🔵🔒🟣
no-unsafe-enum-comparison

Disallow comparing an enum value with a non-enum value

📖🌐🚫🟢🔵🟣
no-unsafe-member-access

Disallow member access on a value with type any

🌐🚫🟢🔵🟣
no-unsafe-return

Disallow returning a value with type any from a function

🌐🚫🟢🔵🟣
no-unused-expressions

Disallow unused expressions

📖⚙️🌐
no-unused-vars

Disallow unused variables

🔧⚙️🌐🟢🔵🔒🟣
no-use-before-define

Disallow the use of variables before they are defined

⚙️🌐
no-useless-constructor

Disallow unnecessary constructors

🌐🔒🟣
no-useless-empty-export

Disallow empty exports that don't change anything in a module file

🔧📖🌐
no-var-requires

Disallow require statements except in import statements

🌐🟢🔵🔒🟣
non-nullable-type-assertion-style

Enforce non-null assertions over explicit type casts

🔧📖🌐🚫🟤
object-curly-spacing

Enforce consistent spacing inside braces

🔧⚙️🌐
padding-line-between-statements

Require or disallow padding lines between statements

🔧📏⚙️🌐
parameter-properties

Require or disallow parameter properties in class constructors

⚙️🌐
prefer-as-const

Enforce the use of as const over literal type

🔧💡📖🌐🟢🔵🔒🟣
prefer-enum-initializers

Require each enum member value to be explicitly initialized

💡📖🌐
prefer-for-of

Enforce the use of for-of loop over the standard for loop where possible

📖🌐🎨🟤
prefer-function-type

Enforce using function types instead of interfaces with call signatures

🔧📖🌐🎨🟤
prefer-includes

Enforce includes method over indexOf method

🔧📖🌐🚫🟣
prefer-literal-enum-member

Require all enum members to be literal values

📖⚙️🌐🔒🟣
prefer-namespace-keyword

Require using namespace keyword over module keyword to declare custom TypeScript modules

🔧📖🌐🎨🟤
prefer-nullish-coalescing

Enforce using the nullish coalescing operator instead of logical assignments or chaining

💡📖⚙️🌐🚫🟤
prefer-optional-chain

Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects

🔧💡📖⚙️🌐🚫🟤
prefer-readonly

Require private members to be marked as readonly if they're never modified outside of the constructor

🔧📖⚙️🌐🚫
prefer-readonly-parameter-types

Require function parameters to be typed as readonly to prevent accidental mutation of inputs

📖⚙️🌐🚫
prefer-reduce-type-parameter

Enforce using type parameter when calling Array#reduce instead of casting

🔧🌐🚫🟣
prefer-regexp-exec

Enforce RegExp#exec over String#match if no global flag is provided

🔧📖🌐🚫
prefer-return-this-type

Enforce that this is used when only this type is returned

🔧📖🌐🚫🟣
prefer-string-starts-ends-with

Enforce using String#startsWith and String#endsWith over other equivalent methods of checking substrings

🔧📖🌐🚫🟤
prefer-ts-expect-error

Enforce using @ts-expect-error over @ts-ignore

🔧🌐🔒🟣
promise-function-async

Require any function or method that returns a Promise to be marked async

🔧📖⚙️🌐🚫
quotes

Enforce the consistent use of either backticks, double, or single quotes

🔧📏⚙️🌐
require-array-sort-compare

Require Array#sort calls to always provide a compareFunction

⚙️🌐🚫
require-await

Disallow async functions which have no await expression

📖🌐🚫🟢🔵🟣
restrict-plus-operands

Require both operands of addition to be the same type and be bigint, number, or string

⚙️🌐🚫🟢🔵🟣
restrict-template-expressions

Enforce template literal expressions to be of string type

⚙️🌐🚫🟢🔵🟣
return-await

Enforce consistent returning of awaited values

🔧💡🌐🚫
semi

Require or disallow semicolons instead of ASI

🔧📏⚙️🌐
sort-type-constituents

Enforce constituents of a type union/intersection to be sorted alphabetically

🔧💡📖⚙️🌐
space-before-blocks

Enforce consistent spacing before blocks

🔧📏⚙️🌐
space-before-function-paren

Enforce consistent spacing before function parenthesis

🔧📏⚙️🌐
space-infix-ops

Require spacing around infix operators

🔧📏⚙️🌐
strict-boolean-expressions

Disallow certain types in boolean expressions

🔧💡📖⚙️🌐🚫
switch-exhaustiveness-check

Require switch-case statements to be exhaustive with union type

💡📖🌐🚫
triple-slash-reference

Disallow certain triple slash directives in favor of ES6-style import declarations

📖⚙️🌐🟢🔵🔒🟣
type-annotation-spacing

Require consistent spacing around type annotations

🔧📏⚙️🌐
typedef

Require type annotations in certain places

📖⚙️🌐
unbound-method

Enforce unbound methods are called with their expected scope

⚙️🌐🚫🟢🔵🟣
unified-signatures

Disallow two overloads that could be unified into one with a union or an optional/rest parameter

📖⚙️🌐🔒🟣
© 2024 Lintbase