It is in the stylistic configuration. Its rule type is suggestion.
- Code
@typescript-eslint/adjacent-overload-signatures- Message
All {} signatures should be adjacent.
It is in the stylistic configuration. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/array-type- Message
Array type using '{}<{}>' is forbidden. Use '{}{}[]' instead.- Message
Array type using '{}<{}>' is forbidden. Use '{}{}' instead.- Message
Array type using '{}<{}>' is forbidden for simple types. Use '{}{}[]' instead.- Message
Array type using '{}<{}>' is forbidden for simple types. Use '{}{}' instead.- Message
Array type using '{}{}[]' is forbidden. Use '{}<{}>' instead.- Message
Array type using '{}{}[]' is forbidden for non-simple types. Use '{}<{}>' instead.
It is in the recommended configuration. It needs type information. It gives suggestions that an editor can apply. Its rule type is problem.
- Code
@typescript-eslint/await-thenable- Message
Unexpected `await` of a non-Promise (non-"Thenable") value.- Message
Unexpected `await using` of a value that is not async disposable.- Message
Convert to an ordinary `for...of` loop.- Message
Unexpected `for await...of` of a value that is not async iterable.- Message
Unexpected iterable of non-Promise (non-"Thenable") values passed to promise aggregator.- Message
Remove unnecessary `await`.
It is in the stylistic configuration. It gives suggestions that an editor can apply. Its rule type is problem.
- Code
@typescript-eslint/class-literal-property-style- Message
Literals should be exposed using readonly fields.- Message
Replace the literals with readonly fields.- Message
Literals should be exposed using getters.- Message
Replace the literals with getters.
Its rule type is suggestion.
- Code
@typescript-eslint/class-methods-use-this- Message
Expected 'this' to be used by class {}.
It is in the stylistic configuration. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/consistent-generic-constructors- Message
The generic type arguments should be specified as part of the constructor type arguments.- Message
The generic type arguments should be specified as part of the type annotation.
It is in the stylistic configuration. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/consistent-indexed-object-style- Message
An index signature is preferred over a record.- Message
Change into an index signature instead of a record.- Message
A record is preferred over an index signature.- Message
Change into a record instead of an index signature.
It needs type information. Its rule type is suggestion.
- Code
@typescript-eslint/consistent-return
It is in the stylistic configuration. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/consistent-type-assertions- Message
Use 'as {}' instead of '<{}>'.- Message
Do not use any type assertions.- Message
Use const x: {} = [ ... ] instead.- Message
Use const x = [ ... ] satisfies {} instead.- Message
Use const x: {} = { ... } instead.- Message
Use const x = { ... } satisfies {} instead.
It is in the stylistic configuration. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/consistent-type-definitions- Message
Use an `interface` instead of a `type`.- Message
Use a `type` instead of an `interface`.
It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/consistent-type-exports- Message
Type exports {} are not values and should be exported using `export type`.- Message
Type export {} is not a value and should be exported using `export type`.- Message
All exports in the declaration are only used as types. Use `export type`.
ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/consistent-type-imports- Message
Use an `import` instead of an `import type`.- Message
`import()` type annotations are forbidden.- Message
Imports {} are only used as type.- Message
All imports in the declaration are only used as types. Use `import type`.
Its rule type is suggestion.
- Code
@typescript-eslint/default-param-last- Message
Default parameters should be last.
It is in the stylistic configuration. It needs type information. Its rule type is suggestion.
- Code
@typescript-eslint/dot-notation
Its rule type is problem.
- Code
@typescript-eslint/explicit-function-return-type- Message
Missing return type on function.
ESLint can fix the code that it reports. Its rule type is problem.
- Code
@typescript-eslint/explicit-member-accessibility- Message
Add '{}' accessibility modifier- Message
Missing accessibility modifier on {} {}.- Message
Public accessibility modifier on {} {}.
Its rule type is problem.
- Code
@typescript-eslint/explicit-module-boundary-types- Message
Argument '{}' should be typed with a non-any type.- Message
{} argument should be typed with a non-any type.- Message
Argument '{}' should be typed.- Message
{} argument should be typed.- Message
Missing return type on function.
Its rule type is suggestion.
- Code
@typescript-eslint/init-declarations
Its rule type is suggestion.
- Code
@typescript-eslint/max-params
Its rule type is suggestion.
- Code
@typescript-eslint/member-ordering- Message
Member {} should be declared before all {} definitions.- Message
Member {} should be declared before member {}.
ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/method-signature-style- Message
Convert to a method signature. This removes the `readonly` modifier, allowing the member to be reassigned.- Message
Shorthand method signature is forbidden. Use a function property instead.- Message
Function property signature is forbidden. Use a method shorthand instead.
It needs type information. Its rule type is suggestion.
- Code
@typescript-eslint/naming-convention- Message
{} name `{}` must match one of the following formats: {}- Message
{} name `{}` trimmed as `{}` must match one of the following formats: {}- Message
{} name `{}` must have one of the following {}es: {}- Message
{} name `{}` must have {} {} underscore(s).- Message
{} name `{}` must {} the RegExp: {}- Message
{} name `{}` must not have a {} underscore.
It is in the recommended configuration. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/no-array-constructor- Message
The array literal notation [] is preferable.
It is in the recommended configuration. It needs type information. It gives suggestions that an editor can apply. Its rule type is problem.
- Code
@typescript-eslint/no-array-delete- Message
Using the `delete` operator with an array expression is unsafe.- Message
Use `array.splice()` instead.
It is in the recommended configuration. It needs type information. Its rule type is suggestion.
- Code
@typescript-eslint/no-base-to-string- Message
Using `join()` for {} {} use Object's default stringification format ('[object Object]') when stringified.- Message
'{}' {} use Object's default stringification format ('[object Object]') when stringified.
It is in the stylistic configuration. It gives suggestions that an editor can apply. Its rule type is problem.
- Code
@typescript-eslint/no-confusing-non-null-assertion- Message
Confusing combination of non-null assertion and assignment like `a! = b`, which looks very similar to `a != b`.- Message
Confusing combination of non-null assertion and equality test like `a! == b`, which looks very similar to `a !== b`.- Message
Confusing combination of non-null assertion and `{}` operator like `a! {} b`, which might be misinterpreted as `!(a {} b)`.- Message
Remove unnecessary non-null assertion (!) in assignment left-hand side.- Message
Remove unnecessary non-null assertion (!) in equality test.- Message
Remove possibly unnecessary non-null assertion (!) in the left operand of the `{}` operator.
It is in the strict configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is problem.
- Code
@typescript-eslint/no-confusing-void-expression- Message
Mark with an explicit `void` operator.
It is in the strict configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-deprecated
Its rule type is problem.
- Code
@typescript-eslint/no-dupe-class-members
It is in the recommended configuration. Its rule type is problem.
- Code
@typescript-eslint/no-duplicate-enum-values- Message
Duplicate enum member value {}.
It is in the recommended configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/no-duplicate-type-constituents- Message
{} type constituent is duplicated with {}.- Message
Explicit undefined is unnecessary on an optional parameter.
It is in the strict configuration. Its rule type is suggestion.
- Code
@typescript-eslint/no-dynamic-delete- Message
Do not delete dynamically computed property keys.
It is in the stylistic configuration. Its rule type is suggestion.
- Code
@typescript-eslint/no-empty-function
It is in the recommended configuration. It gives suggestions that an editor can apply. Its rule type is suggestion.
- Code
@typescript-eslint/no-empty-object-type- Message
An interface declaring no members is equivalent to its supertype.- Message
Replace empty interface with `{}`.- Message
Replace empty interface with a type alias.- Message
Replace `{}` with `{}`.
It is in the recommended configuration. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/no-explicit-any- Message
Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.- Message
Use `PropertyKey` instead, this is more explicit than `keyof any`.- Message
Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.- Message
Unexpected any. Specify a different type.
It is in the recommended configuration. It needs type information. It gives suggestions that an editor can apply. Its rule type is problem.
- Code
@typescript-eslint/no-floating-promises- Message
Add await operator.- Message
Add void operator to ignore.
It is in the recommended configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-for-in-array- Message
For-in loops over arrays skips holes, returns indices as strings, and may visit the prototype chain or other enumerable properties. Use a more robust iteration method such as for-of or array.forEach instead.
It is in the strict configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-generated-empty-object-type- Message
This type resolves to `{}`, the empty object type. This was likely not intentional.
It is in the recommended configuration. It needs type information. Its rule type is suggestion.
- Code
@typescript-eslint/no-implied-eval- Message
Implied eval. Do not use the Function constructor to create functions.- Message
Implied eval. Consider passing a function.
ESLint can fix the code that it reports. Its rule type is problem.
- Code
@typescript-eslint/no-import-type-side-effects- Message
TypeScript will only remove the inline type specifiers which will leave behind a side effect import at runtime. Convert this to a top-level type qualifier to properly remove the entire import.
It is in the stylistic configuration. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/no-inferrable-types- Message
Type {} trivially inferred from a {} literal, remove type annotation.
Its rule type is suggestion.
- Code
@typescript-eslint/no-invalid-this
It is in the strict configuration. Its rule type is problem.
- Code
@typescript-eslint/no-invalid-void-type- Message
{} may not have void as a type argument.- Message
void is only valid as a return type.- Message
void is only valid as a return type or generic type argument.- Message
void is only valid as return type or type of `this` parameter.- Message
void is only valid as a return type or generic type argument or the type of a `this` parameter.- Message
void is not valid as a constituent in a union type
Its rule type is suggestion.
- Code
@typescript-eslint/no-magic-numbers
It is in the strict configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/no-meaningless-void-operator- Message
void operator is useless here; it should only discard a call's return value- Message
void operator shouldn't be used on {}; it should convey that a return value is being ignored- Message
Remove 'void'
It is in the recommended configuration. Its rule type is problem.
- Code
@typescript-eslint/no-misused-new- Message
Class cannot have method named `new`.- Message
Interfaces cannot be constructed, only classes.
It is in the recommended configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-misused-promises- Message
Expected non-Promise value in a boolean conditional.- Message
Expected a non-Promise value to be returned.- Message
Expected a non-Promise value to be spread in an object.- Message
Promise returned in function argument where a void return was expected.- Message
Promise-returning function provided to attribute where a void return was expected.- Message
Promise-returning method provided where a void return was expected by extended/implemented type '{}'.
It is in the strict configuration. It needs type information. It gives suggestions that an editor can apply. Its rule type is problem.
- Code
@typescript-eslint/no-misused-spread- Message
Add await operator.- Message
Using the spread operator on an array in an object will result in a list of indices.- Message
Using the spread operator on class declarations will spread only their static properties, and will lose their class prototype.- Message
Using the spread operator on class instances will lose their class prototype.- Message
Using the spread operator on a function without additional properties can cause unexpected behavior. Did you forget to call the function?- Message
Using the spread operator on an Iterable in an object can cause unexpected behavior.
It is in the strict configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-mixed-enums
It is in the recommended configuration. Its rule type is suggestion.
- Code
@typescript-eslint/no-namespace- Message
ES2015 module syntax is preferred over namespaces.
It is in the strict configuration. It gives suggestions that an editor can apply. Its rule type is problem.
- Code
@typescript-eslint/no-non-null-asserted-nullish-coalescing- Message
The nullish coalescing operator is designed to handle undefined and null - using a non-null assertion is not needed.- Message
Remove the non-null assertion.
It is in the recommended configuration. It gives suggestions that an editor can apply. Its rule type is problem.
- Code
@typescript-eslint/no-non-null-asserted-optional-chain- Message
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong.- Message
You should remove the non-null assertion.
It is in the strict configuration. It gives suggestions that an editor can apply. Its rule type is problem.
- Code
@typescript-eslint/no-non-null-assertion- Message
Forbidden non-null assertion.- Message
Consider using the optional chain operator `?.` instead. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator.
Its rule type is suggestion.
- Code
@typescript-eslint/no-redeclare- Message
'{}' is already defined.- Message
'{}' is already defined as a built-in global variable.- Message
'{}' is already defined by a variable declaration.
It is in the recommended configuration. It needs type information. Its rule type is suggestion.
- Code
@typescript-eslint/no-redundant-type-constituents
It is in the recommended configuration. Its rule type is problem.
- Code
@typescript-eslint/no-require-imports- Message
A `require()` style import is forbidden.
ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/no-restricted-types- Message
Don't use `{}` as a type.{}- Message
Replace `{}` with `{}`.
Its rule type is suggestion.
- Code
@typescript-eslint/no-shadow- Message
Enum members are added to the enum scope, so references to '{}' in enum member initializers resolve to this member instead of the declaration in the upper scope on line {} column {}.- Message
'{}' is already declared in the upper scope on line {} column {}.- Message
'{}' is already a global variable.
It is in the recommended configuration. Its rule type is suggestion.
- Code
@typescript-eslint/no-this-alias- Message
Unexpected aliasing of 'this' to local variable.- Message
Unexpected aliasing of members of 'this' to local variables.
It is in the strict configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/no-unnecessary-boolean-literal-compare- Message
This expression unnecessarily compares a nullable boolean value to false instead of using the ?? operator to provide a default.- Message
This expression unnecessarily compares a nullable boolean value to true instead of using it directly.- Message
This expression unnecessarily compares a nullable boolean value to true instead of negating it.- Message
This expression unnecessarily compares a boolean value to a boolean instead of using it directly.- Message
This expression unnecessarily compares a boolean value to a boolean instead of negating it.- Message
This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.
It is in the strict configuration. It needs type information. It gives suggestions that an editor can apply. Its rule type is suggestion.
- Code
@typescript-eslint/no-unnecessary-condition- Message
Unnecessary conditional, value is always falsy.- Message
This callback should return a conditional, but return is always falsy.- Message
Unnecessary conditional, left-hand side of `??` operator is always `null` or `undefined`.- Message
Unnecessary conditional, value is always truthy.- Message
This callback should return a conditional, but return is always truthy.- Message
Unnecessary conditional, comparison is always {}, since `{} {} {}` is {}.
Its rule type is suggestion.
- Code
@typescript-eslint/no-unnecessary-parameter-property-assignment- Message
This assignment is unnecessary since it is already assigned by a parameter property.
It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/no-unnecessary-qualifier- Message
Qualifier is unnecessary since '{}' is in scope.
It is in the strict configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/no-unnecessary-template-expression- Message
Template literal expression is unnecessary and can be simplified.
It is in the strict configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/no-unnecessary-type-arguments- Message
This is the default value for this type parameter, so it can be omitted.
It is in the recommended configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/no-unnecessary-type-assertion- Message
The type arguments for this generic call may be inferred from the assertion. Specify them explicitly instead.- Message
This assertion is unnecessary since the receiver accepts the original type of the expression.- Message
This assertion is unnecessary since it does not change the type of the expression.
It is in the recommended configuration. It gives suggestions that an editor can apply. Its rule type is suggestion.
- Code
@typescript-eslint/no-unnecessary-type-constraint- Message
Remove the unnecessary `{}` constraint.- Message
Constraining the generic type `{}` to `{}` does nothing and is unnecessary.
It is in the strict configuration. It needs type information. It gives suggestions that an editor can apply. Its rule type is suggestion.
- Code
@typescript-eslint/no-unnecessary-type-conversion- Message
Remove the type conversion.- Message
Instead, assert that the value satisfies the {} type.- Message
{} does not change the type or value of the {}.
It is in the strict configuration. It needs type information. It gives suggestions that an editor can apply. Its rule type is problem.
- Code
@typescript-eslint/no-unnecessary-type-parameters- Message
Replace all usages of type parameter with its constraint.- Message
Type parameter {} is {} in the {} signature.
It is in the recommended configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-unsafe-argument- Message
Unsafe argument of type {} assigned to a parameter of type {}.- Message
Unsafe spread of an {} array type.- Message
Unsafe spread of an {} type.- Message
Unsafe spread of a tuple type. The argument is {} and is assigned to a parameter of type {}.
It is in the recommended configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-unsafe-assignment- Message
Unsafe assignment of an {} value.- Message
Unsafe array destructuring of an {} array value.- Message
Unsafe array destructuring of a tuple element with an {} value.- Message
Unsafe spread of an {} value in an array.- Message
Unsafe assignment of type {} to a variable of type {}.- Message
Unsafe object destructuring of a property with an {} value.
It is in the recommended configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-unsafe-call- Message
Unsafe call of a type that could not be resolved.- Message
Unsafe call of a `this` type that could not be resolved.- Message
Unsafe construction of a type that could not be resolved.- Message
Unsafe use of a template tag whose type could not be resolved.- Message
Unsafe call of {} typed value.- Message
Unsafe construction of {} typed value.
It is in the strict configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-unsafe-class-instance-assignment- Message
This value is used where an instance of class `{}` is expected, but was not created by its constructor.- Message
This object literal is used where an instance of class `{}` is expected.
It is in the recommended configuration. Its rule type is problem.
- Code
@typescript-eslint/no-unsafe-declaration-merging- Message
Unsafe declaration merging between classes and interfaces.
It is in the strict configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-unsafe-enum-assignment- Message
The computed key used here does not have a shared enum type with the expected enum {}.- Message
The argument passed here does not have a shared enum type with the expected enum {}.- Message
The value asserted here does not have a shared enum type with the expected enum {}.- Message
The value assigned here does not have a shared enum type with the expected enum {}.- Message
This mutation can produce a value outside of the expected enum {}.- Message
The value returned here does not have a shared enum type with the expected enum {}.
It is in the recommended configuration. It needs type information. It gives suggestions that an editor can apply. Its rule type is suggestion.
- Code
@typescript-eslint/no-unsafe-enum-comparison- Message
The case statement does not have a shared enum type with the switch predicate.- Message
The two values in this comparison do not have a shared enum type.- Message
Replace with an enum value comparison.
It is in the recommended configuration. Its rule type is problem.
- Code
@typescript-eslint/no-unsafe-function-type
It is in the recommended configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-unsafe-member-access- Message
The type of computed name {} cannot be resolved.- Message
Unsafe member access {} on a type that cannot be resolved.- Message
Computed name {} resolves to an `any` value.- Message
Unsafe member access {} on an `any` value.
It is in the recommended configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-unsafe-return- Message
Unsafe return of a value of type {}.- Message
Unsafe return of type `{}` from function with return type `{}`.
It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-unsafe-type-assertion- Message
Unsafe assertion from {} detected: consider using type guards or a safer assertion.- Message
Unsafe assertion to {} detected: consider using a more specific type to ensure safety.- Message
Unsafe type assertion: '{}' could be instantiated with an arbitrary type which could be unrelated to the original type.- Message
Unsafe type assertion: type '{}' is more narrow than the original type.- Message
Unsafe type assertion: the original type is assignable to the constraint of type '{}', but '{}' could be instantiated with a different subtype of its constraint.
It is in the recommended configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/no-unsafe-unary-minus- Message
Argument of unary negation should be assignable to number | bigint but is {} instead.
It is in the recommended configuration. Its rule type is suggestion.
- Code
@typescript-eslint/no-unused-expressions
Its rule type is problem.
- Code
@typescript-eslint/no-unused-private-class-members- Message
Private class member '{}' is defined but never used.
It is in the recommended configuration. ESLint can fix the code that it reports. Its rule type is problem.
- Code
@typescript-eslint/no-unused-vars- Message
Remove unused import declaration.- Message
Remove unused variable "{}".- Message
'{}' is {} but never used{}.- Message
'{}' is marked as ignored but is used{}.- Message
'{}' is {} but only used as a type{}.
Its rule type is problem.
- Code
@typescript-eslint/no-use-before-define- Message
'{}' was used before it was defined.
It is in the strict configuration. Its rule type is problem.
- Code
@typescript-eslint/no-useless-constructor
It is in the strict configuration. It needs type information. It gives suggestions that an editor can apply. Its rule type is suggestion.
- Code
@typescript-eslint/no-useless-default-assignment- Message
This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.- Message
Using `= undefined` to make a parameter optional adds unnecessary runtime logic.- Message
Remove the default value.- Message
Default value is useless because the {} is not optional.- Message
Default value is useless because it is undefined. Optional {}s are already undefined by default.- Message
Use the `?` optional syntax instead.
ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/no-useless-empty-export- Message
Empty export does nothing and can be removed.
It is in the recommended configuration. ESLint can fix the code that it reports. Its rule type is problem.
- Code
@typescript-eslint/no-wrapper-object-types- Message
Prefer using the primitive `{}` as a type name, rather than the upper-cased `{}`.
It is in the stylistic configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/non-nullable-type-assertion-style- Message
Use a ! assertion to more succinctly remove null and undefined from the type.
It is in the recommended configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/only-throw-error- Message
Expected an error object to be thrown.- Message
Do not throw undefined.
Its rule type is problem.
- Code
@typescript-eslint/parameter-properties- Message
Property {} should be declared as a class property.- Message
Property {} should be declared as a parameter property.
It is in the recommended configuration. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-as-const- Message
Expected a `const` instead of a literal type assertion.- Message
Expected a `const` assertion instead of a literal type annotation.- Message
You should use `as const` instead of type annotation.
It needs type information. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-destructuring
It gives suggestions that an editor can apply. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-enum-initializers- Message
The value of the member '{}' should be explicitly defined.- Message
Can be fixed to {} = {}
It is in the stylistic configuration. It needs type information. It gives suggestions that an editor can apply. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-find- Message
Prefer .find(...) instead of .filter(...)[0].- Message
Use .find(...) instead of .filter(...)[0].
It is in the stylistic configuration. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-for-of- Message
Expected a `for-of` loop instead of a `for` loop with this simple iteration.
It is in the stylistic configuration. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-function-type- Message
{} only has a call signature, you should use a function type instead.- Message
`this` refers to the function type '{}', did you intend to use a generic `this` parameter like `<Self>(this: Self, ...) => Self` instead?
It is in the stylistic configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-includes- Message
Use 'includes()' method instead.- Message
Use `String#includes()` method with a string instead.
It is in the strict configuration. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-literal-enum-member
It is in the recommended configuration. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-namespace-keyword- Message
Use 'namespace' instead of 'module' to declare custom TypeScript modules.
It is in the stylistic configuration. It needs type information. It gives suggestions that an editor can apply. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-nullish-coalescing- Message
This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.- Message
Prefer using nullish coalescing operator (`??{}`) instead of an assignment expression, as it is simpler to read.- Message
Prefer using nullish coalescing operator (`??{}`) instead of a logical {} (`||{}`), as it is a safer operator.- Message
Prefer using nullish coalescing operator (`??{}`) instead of a ternary expression, as it is simpler to read.- Message
Fix to nullish coalescing operator (`??{}`).
It is in the stylistic configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-optional-chain- Message
Change to an optional chain.- Message
Prefer using an optional chain expression instead, as it's more concise and easier to read.
It is in the recommended configuration. It needs type information. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-promise-reject-errors- Message
Expected the Promise rejection reason to be an Error.
It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-readonly- Message
Member '{}' is never reassigned; mark it as `readonly`.
It needs type information. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-readonly-parameter-types- Message
Parameter should be a read only type.
It is in the strict configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is problem.
- Code
@typescript-eslint/prefer-reduce-type-parameter- Message
Unnecessary assertion: Array#reduce accepts a type parameter for the default value.
It is in the stylistic configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-regexp-exec- Message
Use the `RegExp#exec()` method instead.
It is in the strict configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-return-this-type- Message
Use `this` type instead.
It is in the stylistic configuration. It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/prefer-string-starts-ends-with- Message
Use the 'String#endsWith' method instead.- Message
Use 'String#startsWith' method instead.
It needs type information. ESLint can fix the code that it reports. Its rule type is suggestion.
- Code
@typescript-eslint/promise-function-async- Message
Functions that return promises must be async.- Message
Functions that return promises must be async. Consider adding an explicit return type annotation if the function is intended to return a union of promise and non-promise types.
It is in the strict configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/related-getter-setter-pairs- Message
`get()` type should be assignable to its equivalent `set()` type.
It needs type information. Its rule type is problem.
- Code
@typescript-eslint/require-array-sort-compare- Message
Require 'compare' argument.
It is in the recommended configuration. It needs type information. It gives suggestions that an editor can apply. Its rule type is suggestion.
- Code
@typescript-eslint/require-await- Message
{} has no 'await' expression.- Message
Remove 'async'.
It needs type information. Its rule type is problem.
- Code
@typescript-eslint/restrict-plus-operands- Message
Numeric '+' operations must either be both bigints or both numbers. Got `{}` + `{}`.- Message
Invalid operand for a '+' operation. Operands must each be a number or {}. Got `{}`.- Message
Operands of '+' operations must be a number or {}. Got `{}` + `{}`.
It needs type information. Its rule type is problem.
- Code
@typescript-eslint/restrict-template-expressions- Message
Invalid type "{}" of template literal expression.
It needs type information. ESLint can fix the code that it reports. Its rule type is problem.
- Code
@typescript-eslint/return-await- Message
Returning an awaited promise is not allowed in this context.- Message
Remove `await` before the expression. Use caution as this may impact control flow.- Message
Returning an awaited value that is not a promise is not allowed.- Message
Returning an awaited promise is required in this context.- Message
Add `await` before the expression. Use caution as this may impact control flow.
It needs type information. It gives suggestions that an editor can apply. Its rule type is suggestion.
- Code
@typescript-eslint/strict-boolean-expressions- Message
Explicitly convert value to a boolean (`Boolean(value)`)- Message
Change condition to check array's length (`value.length > 0`)- Message
Change condition to check array's length (`value.length === 0`)- Message
Change condition to check for empty string (`value !== ""`)- Message
Change condition to check if false (`value === false`)- Message
Change condition to check for NaN (`!Number.isNaN(value)`)
It needs type information. It gives suggestions that an editor can apply. Its rule type is problem.
- Code
@typescript-eslint/strict-void-return- Message
Async function used in a context where a void function is expected.- Message
Value-returning function used in a context where a void function is expected.- Message
Value returned in a context where a void return is expected.- Message
Add a void operator to discard the return value.- Message
Wrap the function body in an async IIFE.
It needs type information. It gives suggestions that an editor can apply. Its rule type is suggestion.
- Code
@typescript-eslint/switch-exhaustiveness-check- Message
Add branches for missing cases.- Message
The switch statement is exhaustive, so the default case is unnecessary.- Message
Switch is not exhaustive. Cases not matched: {}
It is in the recommended configuration. Its rule type is suggestion.
- Code
@typescript-eslint/triple-slash-reference- Message
Do not use a triple slash reference for {}, use `import` style instead.
It is in the recommended configuration. It needs type information. Its rule type is problem.
- Code
@typescript-eslint/unbound-method
It is in the strict configuration. Its rule type is suggestion.
- Code
@typescript-eslint/unified-signatures- Message
{} with identical parameters.- Message
{} with a rest parameter.- Message
{} with an optional parameter.- Message
{} taking `{}`.
It is in the strict configuration. It needs type information. It gives suggestions that an editor can apply. Its rule type is suggestion.
- Code
@typescript-eslint/use-unknown-in-catch-callback-variable- Message
Add an explicit `: [unknown]` type annotation to the rejection callback rest variable.- Message
Add an explicit `: unknown` type annotation to the rejection callback variable.- Message
Change existing type annotation to `: [unknown]`.- Message
Change existing type annotation to `: unknown`.