TypeScript checker reference

Checker name Category Description Default severity Enabled by default?
JS.TS.ADJACENT.OVERLOAD.SIGNATURES Stylistic Issue Require that member overloads be consecutive 3 True
JS.TS.ARRAY.TYPE Stylistic Issue Requires using either 'T[]' or 'Array<T>' for arrays 3 False
JS.TS.AWAIT.THENABLE Concurrency Disallows awaiting a value that is not a Thenable 3 True
JS.TS.BAN.TS.COMMENT Analysis Modifiers Bans '@ts-<directive>' comments from being used or requires descriptions after directive 3 True
JS.TS.BAN.TSLINT.COMMENT Maintainability Issues Bans '// tslint:<rule-flag>' comments from being used 3 False
JS.TS.BAN.TYPES Banned Code Bans specific types from being used 3 True
JS.TS.BRACE.STYLE Stylistic Issue Enforce consistent brace style for blocks 3 False
JS.TS.CLASS.LITERAL.PROPERTY.STYLE Stylistic Issue Ensures that literals on classes are exposed in a consistent style 3 False
JS.TS.COMMA.DANGLE Stylistic Issue Require or disallow trailing comma 3 False
JS.TS.COMMA.SPACING Stylistic Issue Enforces consistent spacing before and after commas 3 False
JS.TS.CONSISTENT.GENERIC.CONSTRUCTORS Stylistic Issue Enforce specifying generic type arguments on type annotation or constructor name of a constructor call 3 False
JS.TS.CONSISTENT.INDEXED.OBJECT.STYLE Stylistic Issue Enforce or disallow the use of the record type 3 False
JS.TS.CONSISTENT.TYPE.ASSERTIONS Stylistic Issue Enforces consistent usage of type assertions 3 False
JS.TS.CONSISTENT.TYPE.DEFINITIONS Stylistic Issue Consistent with type definition either 'interface' or 'type' 3 False
JS.TS.CONSISTENT.TYPE.EXPORTS Stylistic Issue Enforce consistent usage of type exports 3 False
JS.TS.CONSISTENT.TYPE.IMPORTS Stylistic Issue Enforces consistent usage of type imports 3 False
JS.TS.DEFAULT.PARAM.LAST Suspicious Code Practices Enforce default parameters to be last 3 False
JS.TS.DOT.NOTATION Stylistic Issue Enforce dot notation whenever possible 3 False
JS.TS.EXPLICIT.FUNCTION.RETURN.TYPE Improper Encapsulation Require explicit return types on functions and class methods 3 False
JS.TS.EXPLICIT.MEMBER.ACCESSIBILITY Improper Encapsulation Require explicit accessibility modifiers on class properties and methods 3 False
JS.TS.EXPLICIT.MODULE.BOUNDARY.TYPES Improper Encapsulation Require explicit return and argument types on exported functions' and classes' public class methods 3 False
JS.TS.FUNC.CALL.SPACING Stylistic Issue Require or disallow spacing between function identifiers and their invocations 3 False
JS.TS.INDENT Stylistic Issue Enforce consistent indentation 3 False
JS.TS.INIT.DECLARATIONS Stylistic Issue Require or disallow initialization in variable declarations 3 False
JS.TS.KEYWORD.SPACING Stylistic Issue Enforce consistent spacing before and after keywords 3 False
JS.TS.LINES.BETWEEN.CLASS.MEMBERS Stylistic Issue Require or disallow an empty line between class members 3 False
JS.TS.MEMBER.DELIMITER.STYLE Stylistic Issue Require a specific member delimiter style for interfaces and type literals 3 False
JS.TS.MEMBER.ORDERING Stylistic Issue Require a consistent member declaration order 3 False
JS.TS.METHOD.SIGNATURE.STYLE Stylistic Issue Enforces using a particular method signature syntax. 3 False
JS.TS.NAMING.CONVENTION Stylistic Issue Enforces naming conventions for everything across a codebase 3 False
JS.TS.NO.ARRAY.CONSTRUCTOR Suspicious Code Practices Disallow generic 'Array' constructors 3 True
JS.TS.NO.BASE.TO.STRING Suspicious Code Practices Requires that '.toString()' is only called on objects which provide useful information when stringified 3 False
JS.TS.NO.CONFUSING.NON.NULL.ASSERTION Suspicious Code Practices Disallow non-null assertion in locations that may be confusing 3 False
JS.TS.NO.CONFUSING.VOID.EXPRESSION Suspicious Code Practices Requires expressions of type void to appear in statement position 3 False
JS.TS.NO.DUPE.CLASS.MEMBERS Improper Encapsulation Disallow duplicate class members 3 False
JS.TS.NO.DUPLICATE.ENUM.VALUES Maintainability Issues Disallow duplicate enum member values 3 False
JS.TS.NO.DYNAMIC.DELETE Suspicious Code Practices Disallow the delete operator with computed key expressions 3 False
JS.TS.NO.EMPTY.FUNCTION Stylistic Issue Disallow empty functions 3 True
JS.TS.NO.EMPTY.INTERFACE Stylistic Issue Disallow the declaration of empty interfaces 3 True
JS.TS.NO.EXPLICIT.ANY Stylistic Issue Disallow usage of the 'any' type 3 False
JS.TS.NO.EXTRANEOUS.CLASS Suspicious Code Practices Forbids the use of classes as namespaces 3 False
JS.TS.NO.EXTRA.NON.NULL.ASSERTION Suspicious Code Practices Disallow extra non-null assertion 3 True
JS.TS.NO.EXTRA.PARENS Stylistic Issue Disallow unnecessary parentheses 3 False
JS.TS.NO.EXTRA.SEMI Stylistic Issue Disallow unnecessary semicolons 3 True
JS.TS.NO.FLOATING.PROMISES Concurrency Requires Promise-like values to be handled appropriately 3 True
JS.TS.NO.FOR.IN.ARRAY Stylistic Issue Disallow iterating over an array with a for-in loop 3 True
JS.TS.NO.IMPLICIT.ANY.CATCH Stylistic Issue Disallow usage of the implicit 'any' type in catch clauses 3 False
JS.TS.NO.IMPLIED.EVAL Process and Path Injection Disallow the use of 'eval()'-like methods 2 True
JS.TS.NO.INFERRABLE.TYPES Stylistic Issue Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean 3 True
JS.TS.NO.INVALID.THIS Possible Runtime Failures Disallow 'this' keywords outside of classes or class-like objects 2 False
JS.TS.NO.INVALID.VOID.TYPE Suspicious Code Practices Disallows usage of 'void' type outside of generic or return types 3 False
JS.TS.NO.LOOP.FUNC Possible Runtime Failures Disallow function declarations that contain unsafe references inside loop statements 3 False
JS.TS.NO.LOSS.OF.PRECISION Suspicious Code Practices Disallow literal numbers that lose precision 3 False
JS.TS.NO.MAGIC.NUMBERS Stylistic Issue Disallow magic numbers 3 False
JS.TS.NO.MEANINGLESS.VOID.OPERATOR Banned Code Disallow the `void` operator except when used to discard a value 3 False
JS.TS.NO.MISUSED.NEW Suspicious Code Practices Enforce valid definition of 'new' and 'constructor' 3 True
JS.TS.NO.MISUSED.PROMISES Concurrency Avoid using promises in places not designed to handle them 2 True
JS.TS.NO.NAMESPACE Stylistic Issue Disallow the use of custom TypeScript modules and namespaces 3 True
JS.TS.NON.NULLABLE.TYPE.ASSERTION.STYLE Stylistic Issue Prefers a non-null assertion over explicit type cast when possible 3 False
JS.TS.NO.NON.NULL.ASSERTED.NULLISH.COALESCING Stylistic Issue Disallow non-null assertions in the left operand of a nullish coalescing operator 3 False
JS.TS.NO.NON.NULL.ASSERTED.OPTIONAL.CHAIN Unsafe Code Practices Disallows using a non-null assertion after an optional chain expression 2 True
JS.TS.NO.NON.NULL.ASSERTION Suspicious Code Practices Disallows non-null assertions using the '!' postfix operator 3 False
JS.TS.NO.PARAMETER.PROPERTIES Improper Encapsulation Disallow the use of parameter properties in class constructors 3 False
JS.TS.NO.REDECLARE Suspicious Code Practices Disallow variable redeclaration 3 False
JS.TS.NO.REDUNDANT.TYPE.CONSTITUENTS Banned Code Disallow members of unions and intersections that do nothing or override type information 3 False
JS.TS.NO.REQUIRE.IMPORTS Stylistic Issue Disallows invocation of 'require()' 3 False
JS.TS.NO.RESTRICTED.IMPORTS Banned Code Disallow specified modules when loaded by `import` 3 False
JS.TS.NO.SHADOW Possible Runtime Failures Disallow variable declarations from shadowing variables declared in the outer scope 3 False
JS.TS.NO.THIS.ALIAS Suspicious Code Practices Disallow aliasing 'this' 3 True
JS.TS.NO.THROW.LITERAL Suspicious Code Practices Disallow throwing literals as exceptions 3 False
JS.TS.NO.TYPE.ALIAS Suspicious Encapsulation Disallow the use of type aliases 3 False
JS.TS.NO.UNNECESSARY.BOOLEAN.LITERAL.COMPARE Suspicious Code Practices Flags unnecessary equality comparisons against boolean literals 3 False
JS.TS.NO.UNNECESSARY.CONDITION Suspicious Code Practices Prevents conditionals where the type is always truthy or always falsy 3 False
JS.TS.NO.UNNECESSARY.QUALIFIER Stylistic Issue Warns when a namespace qualifier is unnecessary 3 False
JS.TS.NO.UNNECESSARY.TYPE.ARGUMENTS Unused Local Variables Enforces that type arguments will not be used if not required 3 False
JS.TS.NO.UNNECESSARY.TYPE.ASSERTION Suspicious Encapsulation Warns if a type assertion does not change the type of an expression 3 True
JS.TS.NO.UNNECESSARY.TYPE.CONSTRAINT Improper Encapsulation Disallows unnecessary constraints on generic types 3 False
JS.TS.NO.UNSAFE.ARGUMENT Suspicious Encapsulation Disallows calling an function with an any type value 3 False
JS.TS.NO.UNSAFE.ASSIGNMENT Suspicious Encapsulation Disallows assigning any to variables and properties 3 True
JS.TS.NO.UNSAFE.CALL Suspicious Encapsulation Disallows calling an any type value 3 True
JS.TS.NO.UNSAFE.MEMBER.ACCESS Suspicious Encapsulation Disallows member access on any typed variables 3 True
JS.TS.NO.UNSAFE.RETURN Suspicious Encapsulation Disallows returning any from a function 3 True
JS.TS.NO.UNUSED.EXPRESSIONS Unused Local Variables Disallow unused expressions 3 False
JS.TS.NO.UNUSED.VARS Unused Local Variables Disallow unused variables 3 False
JS.TS.NO.USE.BEFORE.DEFINE Unsafe Code Practices Disallow the use of variables before they are defined 2 False
JS.TS.NO.USELESS.CONSTRUCTOR Improper Encapsulation Disallow unnecessary constructors 3 False
JS.TS.NO.USELESS.EMPTY.EXPORT Unused Local Variables Disallow empty exports that don't change anything in a module file 3 False
JS.TS.NO.VAR.REQUIRES Stylistic Issue Disallows the use of require statements except in import statements 3 True
JS.TS.OBJECT.CURLY.SPACING Stylistic Issue Enforce consistent spacing inside braces 3 False
JS.TS.PADDING.LINE.BETWEEN.STATEMENTS Stylistic Issue Require or disallow padding lines between statements 3 False
JS.TS.PARAMETER.PROPERTIES Stylistic Issue Require or disallow parameter properties in class constructors 3 False
JS.TS.PREFER.AS.CONST Stylistic Issue Prefer usage of 'as const' over literal type 3 True
JS.TS.PREFER.ENUM.INITIALIZERS Stylistic Issue Prefer initializing each enums member value 3 False
JS.TS.PREFER.FOR.OF Stylistic Issue Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated 3 False
JS.TS.PREFER.FUNCTION.TYPE Stylistic Issue Use function types instead of interfaces with call signatures 3 False
JS.TS.PREFER.INCLUDES Stylistic Issue Enforce 'includes' method over 'indexOf' method 3 False
JS.TS.PREFER.LITERAL.ENUM.MEMBER Stylistic Issue Require that all enum members be literal values to prevent unintended enum member name shadow issues 3 False
JS.TS.PREFER.NAMESPACE.KEYWORD Stylistic Issue Require the use of the 'namespace' keyword instead of the 'module' keyword to declare custom TypeScript modules 3 True
JS.TS.PREFER.NULLISH.COALESCING Stylistic Issue Enforce the usage of the nullish coalescing operator instead of logical chaining 3 False
JS.TS.PREFER.OPTIONAL.CHAIN Stylistic Issue Prefer using concise optional chain expressions instead of chained logical ands 3 False
JS.TS.PREFER.READONLY Stylistic Issue Requires that private members are marked as 'readonly' if they're never modified outside of the constructor 3 False
JS.TS.PREFER.READONLY.PARAMETER.TYPES Stylistic Issue Requires that function parameters are typed as readonly to prevent accidental mutation of inputs 3 False
JS.TS.PREFER.REDUCE.TYPE.PARAMETER Stylistic Issue Prefer using type parameter when calling 'Array#reduce' instead of casting 3 False
JS.TS.PREFER.REGEXP.EXEC Stylistic Issue Enforce that 'RegExp#exec' is used instead of 'String#match' if no global flag is provided 3 True
JS.TS.PREFER.RETURN.THIS.TYPE Banned Code Enforce that `this` is used when only `this` type is returned 3 False
JS.TS.PREFER.STRING.STARTS.ENDS.WITH Stylistic Issue Enforce the use of 'String#startsWith' and 'String#endsWith' instead of other equivalent methods of checking substrings 3 False
JS.TS.PREFER.TS.EXPECT.ERROR Stylistic Issue Recommends using '@ts-expect-error' over '@ts-ignore' 3 False
JS.TS.PROMISE.FUNCTION.ASYNC Concurrency Requires any function or method that returns a Promise to be marked async 3 False
JS.TS.QUOTES Stylistic Issue Enforce the consistent use of either backticks, double, or single quotes 3 False
JS.TS.REQUIRE.ARRAY.SORT.COMPARE Suspicious Encapsulation Requires 'Array#sort' calls to always provide a 'compareFunction' 3 False
JS.TS.REQUIRE.AWAIT Concurrency Disallow async functions which have no 'await' expression 3 True
JS.TS.RESTRICT.PLUS.OPERANDS Suspicious Encapsulation When adding two variables, operands must both be of type number or of type string 3 True
JS.TS.RESTRICT.TEMPLATE.EXPRESSIONS Suspicious Encapsulation Enforce template literal expressions to be of string type 3 True
JS.TS.RETURN.AWAIT Concurrency Enforces consistent returning of awaited values 3 False
JS.TS.SEMI Stylistic Issue Require or disallow semicolons instead of ASI 3 False
JS.TS.SORT.TYPE.UNION.INTERSECTION.MEMBERS Stylistic Issue Enforces that members of a type union/intersection are sorted alphabetically 3 False
JS.TS.SPACE.BEFORE.BLOCKS Stylistic Issue Enforce consistent spacing before blocks 3 False
JS.TS.SPACE.BEFORE.FUNCTION.PAREN Stylistic Issue Enforces consistent spacing before function parenthesis 3 False
JS.TS.SPACE.INFIX.OPS Stylistic Issue This rule is aimed at ensuring there are spaces around infix operators. 3 False
JS.TS.STRICT.BOOLEAN.EXPRESSIONS Suspicious Encapsulation Restricts the types allowed in boolean expressions 3 False
JS.TS.SWITCH.EXHAUSTIVENESS.CHECK Suspicious Encapsulation Exhaustiveness checking in switch with union type 3 False
JS.TS.TRIPLE.SLASH.REFERENCE Stylistic Issue Sets preference level for triple slash directives versus ES6-style import declarations 3 True
JS.TS.TYPE.ANNOTATION.SPACING Stylistic Issue Require consistent spacing around type annotations 3 False
JS.TS.TYPEDEF Suspicious Encapsulation Requires type annotations to exist 3 False
JS.TS.UNBOUND.METHOD Suspicious Encapsulation Enforces unbound methods are called with their expected scope 2 True
JS.TS.UNIFIED.SIGNATURES Maintainability Issues Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter 3 False