From 7b05b842a684929637e12ac5a61b420d04e96759 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 20 Mar 2022 12:58:36 -0400 Subject: [PATCH 01/20] feat: add new 'strict' config --- packages/eslint-plugin/src/configs/all.ts | 8 +-- packages/eslint-plugin/src/configs/strict.ts | 48 +++++++++++++++++ packages/eslint-plugin/src/index.ts | 4 +- .../eslint-plugin/src/rules/array-type.ts | 6 ++- .../src/rules/ban-tslint-comment.ts | 5 +- .../src/rules/class-literal-property-style.ts | 5 +- .../rules/consistent-indexed-object-style.ts | 6 ++- .../src/rules/consistent-type-assertions.ts | 5 +- .../src/rules/consistent-type-definitions.ts | 6 ++- .../eslint-plugin/src/rules/dot-notation.ts | 5 +- .../src/rules/no-base-to-string.ts | 5 +- .../rules/no-confusing-non-null-assertion.ts | 5 +- .../src/rules/no-dynamic-delete.ts | 5 +- .../src/rules/no-extraneous-class.ts | 5 +- .../src/rules/no-invalid-void-type.ts | 5 +- .../src/rules/no-meaningless-void-operator.ts | 5 +- ...no-non-null-asserted-nullish-coalescing.ts | 5 +- .../src/rules/no-throw-literal.ts | 5 +- .../no-unnecessary-boolean-literal-compare.ts | 5 +- .../src/rules/no-unnecessary-condition.ts | 5 +- .../rules/no-unnecessary-type-arguments.ts | 5 +- .../src/rules/no-useless-constructor.ts | 5 +- .../non-nullable-type-assertion-style.ts | 5 +- .../eslint-plugin/src/rules/prefer-for-of.ts | 5 +- .../src/rules/prefer-function-type.ts | 5 +- .../src/rules/prefer-includes.ts | 5 +- .../src/rules/prefer-literal-enum-member.ts | 5 +- .../src/rules/prefer-nullish-coalescing.ts | 5 +- .../src/rules/prefer-optional-chain.ts | 5 +- .../src/rules/prefer-reduce-type-parameter.ts | 5 +- .../src/rules/prefer-return-this-type.ts | 5 +- .../rules/prefer-string-starts-ends-with.ts | 5 +- .../src/rules/prefer-ts-expect-error.ts | 5 +- .../src/rules/unified-signatures.ts | 5 +- .../eslint-plugin/tools/generate-configs.ts | 51 +++++++++++++++++-- packages/utils/src/ts-eslint/Rule.ts | 13 ++++- 36 files changed, 236 insertions(+), 46 deletions(-) create mode 100644 packages/eslint-plugin/src/configs/strict.ts diff --git a/packages/eslint-plugin/src/configs/all.ts b/packages/eslint-plugin/src/configs/all.ts index 03188b72464..32697a80a51 100644 --- a/packages/eslint-plugin/src/configs/all.ts +++ b/packages/eslint-plugin/src/configs/all.ts @@ -21,8 +21,8 @@ export = { '@typescript-eslint/consistent-indexed-object-style': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', - '@typescript-eslint/consistent-type-imports': 'error', '@typescript-eslint/consistent-type-exports': 'error', + '@typescript-eslint/consistent-type-imports': 'error', 'default-param-last': 'off', '@typescript-eslint/default-param-last': 'error', 'dot-notation': 'off', @@ -115,9 +115,9 @@ export = { '@typescript-eslint/no-unused-vars': 'error', 'no-use-before-define': 'off', '@typescript-eslint/no-use-before-define': 'error', - '@typescript-eslint/no-useless-empty-export': 'error', 'no-useless-constructor': 'off', '@typescript-eslint/no-useless-constructor': 'error', + '@typescript-eslint/no-useless-empty-export': 'error', '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/non-nullable-type-assertion-style': 'error', 'object-curly-spacing': 'off', @@ -153,12 +153,12 @@ export = { semi: 'off', '@typescript-eslint/semi': 'error', '@typescript-eslint/sort-type-union-intersection-members': 'error', + 'space-before-blocks': 'off', + '@typescript-eslint/space-before-blocks': 'error', 'space-before-function-paren': 'off', '@typescript-eslint/space-before-function-paren': 'error', 'space-infix-ops': 'off', '@typescript-eslint/space-infix-ops': 'error', - 'space-before-blocks': 'off', - '@typescript-eslint/space-before-blocks': 'error', '@typescript-eslint/strict-boolean-expressions': 'error', '@typescript-eslint/switch-exhaustiveness-check': 'error', '@typescript-eslint/triple-slash-reference': 'error', diff --git a/packages/eslint-plugin/src/configs/strict.ts b/packages/eslint-plugin/src/configs/strict.ts new file mode 100644 index 00000000000..b6c7169287d --- /dev/null +++ b/packages/eslint-plugin/src/configs/strict.ts @@ -0,0 +1,48 @@ +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:configs + +export = { + extends: [ + './configs/base', + './configs/eslint-recommended', + './configs/recommended', + './configs/recommended-requiring-type-checking', + ], + rules: { + '@typescript-eslint/array-type': 'warn', + '@typescript-eslint/ban-tslint-comment': 'warn', + '@typescript-eslint/class-literal-property-style': 'warn', + '@typescript-eslint/consistent-indexed-object-style': 'warn', + '@typescript-eslint/consistent-type-assertions': 'warn', + '@typescript-eslint/consistent-type-definitions': 'warn', + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', + '@typescript-eslint/no-base-to-string': 'error', + '@typescript-eslint/no-confusing-non-null-assertion': 'error', + '@typescript-eslint/no-dynamic-delete': 'warn', + '@typescript-eslint/no-extraneous-class': 'warn', + '@typescript-eslint/no-invalid-void-type': 'warn', + '@typescript-eslint/no-meaningless-void-operator': 'warn', + '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'warn', + 'no-throw-literal': 'off', + '@typescript-eslint/no-throw-literal': 'error', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn', + '@typescript-eslint/no-unnecessary-condition': 'error', + '@typescript-eslint/no-unnecessary-type-arguments': 'error', + 'no-useless-constructor': 'off', + '@typescript-eslint/no-useless-constructor': 'warn', + '@typescript-eslint/non-nullable-type-assertion-style': 'error', + '@typescript-eslint/prefer-for-of': 'warn', + '@typescript-eslint/prefer-function-type': 'warn', + '@typescript-eslint/prefer-includes': 'error', + '@typescript-eslint/prefer-literal-enum-member': 'warn', + '@typescript-eslint/prefer-nullish-coalescing': 'warn', + '@typescript-eslint/prefer-optional-chain': 'warn', + '@typescript-eslint/prefer-reduce-type-parameter': 'warn', + '@typescript-eslint/prefer-return-this-type': 'error', + '@typescript-eslint/prefer-string-starts-ends-with': 'warn', + '@typescript-eslint/prefer-ts-expect-error': 'warn', + '@typescript-eslint/unified-signatures': 'warn', + }, +}; diff --git a/packages/eslint-plugin/src/index.ts b/packages/eslint-plugin/src/index.ts index a812b44eb7a..a0d8a6d9663 100644 --- a/packages/eslint-plugin/src/index.ts +++ b/packages/eslint-plugin/src/index.ts @@ -2,9 +2,10 @@ import rules from './rules'; import all from './configs/all'; import base from './configs/base'; +import eslintRecommended from './configs/eslint-recommended'; import recommended from './configs/recommended'; import recommendedRequiringTypeChecking from './configs/recommended-requiring-type-checking'; -import eslintRecommended from './configs/eslint-recommended'; +import strict from './configs/strict'; export = { rules, @@ -14,5 +15,6 @@ export = { recommended, 'eslint-recommended': eslintRecommended, 'recommended-requiring-type-checking': recommendedRequiringTypeChecking, + strict, }, }; diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts index 3c0cad93ed1..6b6909710ff 100644 --- a/packages/eslint-plugin/src/rules/array-type.ts +++ b/packages/eslint-plugin/src/rules/array-type.ts @@ -90,8 +90,10 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Requires using either `T[]` or `Array` for arrays', - // too opinionated to be recommended - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/ban-tslint-comment.ts b/packages/eslint-plugin/src/rules/ban-tslint-comment.ts index 99a427eead0..2343902c166 100644 --- a/packages/eslint-plugin/src/rules/ban-tslint-comment.ts +++ b/packages/eslint-plugin/src/rules/ban-tslint-comment.ts @@ -20,7 +20,10 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Bans `// tslint:` comments from being used', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, messages: { commentDetected: 'tslint comment detected: "{{ text }}"', diff --git a/packages/eslint-plugin/src/rules/class-literal-property-style.ts b/packages/eslint-plugin/src/rules/class-literal-property-style.ts index 705485e0050..3d087c3b680 100644 --- a/packages/eslint-plugin/src/rules/class-literal-property-style.ts +++ b/packages/eslint-plugin/src/rules/class-literal-property-style.ts @@ -41,7 +41,10 @@ export default util.createRule({ docs: { description: 'Ensures that literals on classes are exposed in a consistent style', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts b/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts index bd511d0cd0e..61a13c1bfdb 100644 --- a/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts +++ b/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts @@ -10,8 +10,10 @@ export default createRule({ type: 'suggestion', docs: { description: 'Enforce or disallow the use of the record type', - // too opinionated to be recommended - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, messages: { preferRecord: 'A record is preferred over an index signature.', diff --git a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts index 4a75edd7bda..47f64290edd 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts @@ -23,7 +23,10 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Enforces consistent usage of type assertions', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, messages: { as: "Use 'as {{cast}}' instead of '<{{cast}}>'.", diff --git a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts index d87383bdc42..f63ac835d89 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts @@ -13,8 +13,10 @@ export default util.createRule({ docs: { description: 'Consistent with type definition either `interface` or `type`', - // too opinionated to be recommended - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, messages: { interfaceOverType: 'Use an `interface` instead of a `type`.', diff --git a/packages/eslint-plugin/src/rules/dot-notation.ts b/packages/eslint-plugin/src/rules/dot-notation.ts index 29db2f3fe1e..23aeac0f643 100644 --- a/packages/eslint-plugin/src/rules/dot-notation.ts +++ b/packages/eslint-plugin/src/rules/dot-notation.ts @@ -20,7 +20,10 @@ export default createRule({ type: 'suggestion', docs: { description: 'enforce dot notation whenever possible', - recommended: false, + recommended: { + level: 'error', + strict: true, + }, extendsBaseRule: true, requiresTypeChecking: true, }, diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts index 09c4d8376f1..283dca92573 100644 --- a/packages/eslint-plugin/src/rules/no-base-to-string.ts +++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts @@ -22,7 +22,10 @@ export default util.createRule({ docs: { description: 'Requires that `.toString()` is only called on objects which provide useful information when stringified', - recommended: false, + recommended: { + level: 'error', + strict: true, + }, requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts index 5538781598a..66bcdbcd78c 100644 --- a/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts @@ -13,7 +13,10 @@ export default util.createRule({ docs: { description: 'Disallow non-null assertion in locations that may be confusing', - recommended: false, + recommended: { + level: 'error', + strict: true, + }, }, fixable: 'code', hasSuggestions: true, diff --git a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts index 8824095ab74..1774948e654 100644 --- a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts +++ b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts @@ -7,7 +7,10 @@ export default util.createRule({ meta: { docs: { description: 'Disallow the delete operator with computed key expressions', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/no-extraneous-class.ts b/packages/eslint-plugin/src/rules/no-extraneous-class.ts index aa2184c9b16..e4bacdc3398 100644 --- a/packages/eslint-plugin/src/rules/no-extraneous-class.ts +++ b/packages/eslint-plugin/src/rules/no-extraneous-class.ts @@ -17,7 +17,10 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Forbids the use of classes as namespaces', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, schema: [ { diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index cd28cfa16da..235e871832e 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -20,7 +20,10 @@ export default util.createRule<[Options], MessageIds>({ docs: { description: 'Disallows usage of `void` type outside of generic or return types', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, messages: { invalidVoidForGeneric: diff --git a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts index a1dd8768130..d024515bcc7 100644 --- a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts +++ b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts @@ -19,7 +19,10 @@ export default util.createRule< docs: { description: 'Disallow the `void` operator except when used to discard a value', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, suggestion: true, requiresTypeChecking: true, }, diff --git a/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts index db8b1cf860c..012722ca12c 100644 --- a/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts +++ b/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts @@ -35,7 +35,10 @@ export default util.createRule({ docs: { description: 'Disallows using a non-null assertion in the left operand of the nullish coalescing operator', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, messages: { noNonNullAssertedNullishCoalescing: diff --git a/packages/eslint-plugin/src/rules/no-throw-literal.ts b/packages/eslint-plugin/src/rules/no-throw-literal.ts index f248ef9cb8d..fc81c660173 100644 --- a/packages/eslint-plugin/src/rules/no-throw-literal.ts +++ b/packages/eslint-plugin/src/rules/no-throw-literal.ts @@ -17,7 +17,10 @@ export default util.createRule({ type: 'problem', docs: { description: 'Disallow throwing literals as exceptions', - recommended: false, + recommended: { + level: 'error', + strict: true, + }, extendsBaseRule: true, requiresTypeChecking: true, }, diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts index e3768b28aa0..4f20ee6b607 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts @@ -35,7 +35,10 @@ export default util.createRule({ docs: { description: 'Flags unnecessary equality comparisons against boolean literals', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, requiresTypeChecking: true, }, fixable: 'code', diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts index 4e18a9f631e..18ee62459dd 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts @@ -90,7 +90,10 @@ export default createRule({ docs: { description: 'Prevents conditionals where the type is always truthy or always falsy', - recommended: false, + recommended: { + level: 'error', + strict: true, + }, requiresTypeChecking: true, }, schema: [ diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts index 294adf554ad..93fb6412cb3 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts @@ -22,7 +22,10 @@ export default util.createRule<[], MessageIds>({ docs: { description: 'Enforces that type arguments will not be used if not required', - recommended: false, + recommended: { + level: 'error', + strict: true, + }, requiresTypeChecking: true, }, fixable: 'code', diff --git a/packages/eslint-plugin/src/rules/no-useless-constructor.ts b/packages/eslint-plugin/src/rules/no-useless-constructor.ts index 0bbe2f6f64c..5b7ead653ea 100644 --- a/packages/eslint-plugin/src/rules/no-useless-constructor.ts +++ b/packages/eslint-plugin/src/rules/no-useless-constructor.ts @@ -48,7 +48,10 @@ export default util.createRule({ type: 'problem', docs: { description: 'Disallow unnecessary constructors', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, extendsBaseRule: true, }, hasSuggestions: baseRule.meta.hasSuggestions, diff --git a/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts b/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts index b0649d05745..ba2bfd6bfad 100644 --- a/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts +++ b/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts @@ -10,7 +10,10 @@ export default util.createRule({ docs: { description: 'Prefers a non-null assertion over explicit type cast when possible', - recommended: false, + recommended: { + level: 'error', + strict: true, + }, requiresTypeChecking: true, suggestion: true, }, diff --git a/packages/eslint-plugin/src/rules/prefer-for-of.ts b/packages/eslint-plugin/src/rules/prefer-for-of.ts index 3355fda2ec6..d881df4a27e 100644 --- a/packages/eslint-plugin/src/rules/prefer-for-of.ts +++ b/packages/eslint-plugin/src/rules/prefer-for-of.ts @@ -8,7 +8,10 @@ export default util.createRule({ docs: { description: 'Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, messages: { preferForOf: diff --git a/packages/eslint-plugin/src/rules/prefer-function-type.ts b/packages/eslint-plugin/src/rules/prefer-function-type.ts index ba5865abfd7..efd4568ce44 100644 --- a/packages/eslint-plugin/src/rules/prefer-function-type.ts +++ b/packages/eslint-plugin/src/rules/prefer-function-type.ts @@ -17,7 +17,10 @@ export default util.createRule({ docs: { description: 'Use function types instead of interfaces with call signatures', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-includes.ts b/packages/eslint-plugin/src/rules/prefer-includes.ts index 0e12b4ca259..157fe5050d6 100644 --- a/packages/eslint-plugin/src/rules/prefer-includes.ts +++ b/packages/eslint-plugin/src/rules/prefer-includes.ts @@ -16,7 +16,10 @@ export default createRule({ type: 'suggestion', docs: { description: 'Enforce `includes` method over `indexOf` method', - recommended: false, + recommended: { + level: 'error', + strict: true, + }, requiresTypeChecking: true, }, fixable: 'code', diff --git a/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts b/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts index f64482a06f5..bcd38024853 100644 --- a/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts +++ b/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts @@ -8,7 +8,10 @@ export default createRule({ docs: { description: 'Require that all enum members be literal values to prevent unintended enum member name shadow issues', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, requiresTypeChecking: false, }, messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts index b492287d4bb..759f6a36344 100644 --- a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts +++ b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts @@ -21,7 +21,10 @@ export default util.createRule({ docs: { description: 'Enforce the usage of the nullish coalescing operator instead of logical chaining', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, suggestion: true, requiresTypeChecking: true, }, diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts index 109deaa6d60..071470a50b2 100644 --- a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts +++ b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts @@ -33,7 +33,10 @@ export default util.createRule({ docs: { description: 'Prefer using concise optional chain expressions instead of chained logical ands', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, suggestion: true, }, hasSuggestions: true, diff --git a/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts b/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts index d9fe3a3071a..62d63fb154a 100644 --- a/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts +++ b/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts @@ -27,9 +27,12 @@ export default util.createRule({ meta: { type: 'problem', docs: { - recommended: false, description: 'Prefer using type parameter when calling `Array#reduce` instead of casting', + recommended: { + level: 'warn', + strict: true, + }, requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts index 0368300bbd6..39ef135943b 100644 --- a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts +++ b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts @@ -19,7 +19,10 @@ export default createRule({ docs: { description: 'Enforce that `this` is used when only `this` type is returned', - recommended: false, + recommended: { + level: 'error', + strict: true, + }, requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts index 501693efc50..4c4988ee286 100644 --- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts +++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts @@ -23,7 +23,10 @@ export default createRule({ docs: { description: 'Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts b/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts index 17f1c465f1a..deb8521cd86 100644 --- a/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts +++ b/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts @@ -10,7 +10,10 @@ export default util.createRule<[], MessageIds>({ type: 'problem', docs: { description: 'Recommends using `@ts-expect-error` over `@ts-ignore`', - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/unified-signatures.ts b/packages/eslint-plugin/src/rules/unified-signatures.ts index b5a1d8a97ba..a43f147da4d 100644 --- a/packages/eslint-plugin/src/rules/unified-signatures.ts +++ b/packages/eslint-plugin/src/rules/unified-signatures.ts @@ -55,7 +55,10 @@ export default util.createRule({ description: 'Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter', // too opinionated to be recommended - recommended: false, + recommended: { + level: 'warn', + strict: true, + }, }, type: 'suggestion', messages: { diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts index f1da74b67c7..aa1c2a21665 100644 --- a/packages/eslint-plugin/tools/generate-configs.ts +++ b/packages/eslint-plugin/tools/generate-configs.ts @@ -49,8 +49,14 @@ const BASE_RULES_TO_BE_OVERRIDDEN = new Map( ); const EXTENDS = ['./configs/base', './configs/eslint-recommended']; -const ruleEntries: [string, TSESLint.RuleModule][] = - Object.entries(rules).sort((a, b) => a[0].localeCompare(b[0])); +type RuleEntry = [ + string, + TSESLint.RuleModule, +]; + +const ruleEntries: RuleEntry[] = Object.entries(rules).sort((a, b) => + a[0].localeCompare(b[0]), +); /** * Helper function reduces records to key - value pairs. @@ -65,6 +71,7 @@ function reducer( errorLevel?: 'error' | 'warn'; filterDeprecated: boolean; filterRequiresTypeChecking?: 'include' | 'exclude'; + filterStrict?: boolean; }, ): LinterConfigRules { const key = entry[0]; @@ -91,7 +98,11 @@ function reducer( } const ruleName = `${RULE_NAME_PREFIX}${key}`; - const recommendation = value.meta.docs?.recommended; + const recommendation = + typeof value.meta.docs?.recommended === 'object' + ? value.meta.docs.recommended.level + : value.meta.docs?.recommended; + const usedSetting = settings.errorLevel ? settings.errorLevel : !recommendation @@ -134,6 +145,14 @@ function writeConfig(config: LinterConfig, filePath: string): void { fs.writeFileSync(filePath, configStr); } +function entryIsRecommended(entry: RuleEntry): boolean { + return typeof entry[1].meta.docs?.recommended === 'string'; +} + +function entryIsStrict(entry: RuleEntry): boolean { + return typeof entry[1].meta.docs?.recommended === 'object'; +} + const baseConfig: LinterConfig = { parser: '@typescript-eslint/parser', parserOptions: { @@ -162,7 +181,7 @@ console.log( '------------------------------ recommended.ts (should not require program) ------------------------------', ); const recommendedRules = ruleEntries - .filter(entry => !!entry[1].meta.docs?.recommended) + .filter(entryIsRecommended) .reduce( (config, entry) => reducer(config, entry, { @@ -185,7 +204,7 @@ console.log( '--------------------------------- recommended-requiring-type-checking.ts ---------------------------------', ); const recommendedRulesRequiringProgram = ruleEntries - .filter(entry => !!entry[1].meta.docs?.recommended) + .filter(entryIsRecommended) .reduce( (config, entry) => reducer(config, entry, { @@ -205,3 +224,25 @@ writeConfig( '../src/configs/recommended-requiring-type-checking.ts', ), ); + +console.log(); +console.log( + '--------------------------------- strict.ts ---------------------------------', +); +const strictRules = ruleEntries.filter(entryIsStrict).reduce( + (config, entry) => + reducer(config, entry, { + filterDeprecated: false, + filterStrict: true, + }), + {}, +); +const strictConfig: LinterConfig = { + extends: [ + ...EXTENDS, + './configs/recommended', + './configs/recommended-requiring-type-checking', + ], + rules: strictRules, +}; +writeConfig(strictConfig, path.resolve(__dirname, '../src/configs/strict.ts')); diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index bac1ef4e353..77e48171be5 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -5,6 +5,15 @@ import type { Linter } from './Linter'; import type { Scope } from './Scope'; import type { SourceCode } from './SourceCode'; +type RecommendedLevel = 'error' | 'warn' | false; + +type Recommended = RecommendedLevel | StrictRecommended; + +interface StrictRecommended { + level: RecommendedLevel; + strict: true; +} + interface RuleMetaDataDocs { /** * Concise description of the rule @@ -12,10 +21,10 @@ interface RuleMetaDataDocs { description: string; /** * The recommendation level for the rule. - * Used by the build tools to generate the recommended config. + * Used by the build tools to generate the recommended and strict configs. * Set to false to not include it as a recommendation */ - recommended: 'error' | 'warn' | false; + recommended: Recommended; /** * The URL of the rule's docs */ From 418577c1a9aae79da8794b04128962591ffc8e2f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 21 Mar 2022 10:42:14 -0400 Subject: [PATCH 02/20] chore: simplified strict to always be 'warn' --- packages/eslint-plugin/src/configs/strict.ts | 18 +++++++++--------- packages/eslint-plugin/src/rules/array-type.ts | 5 +---- .../src/rules/ban-tslint-comment.ts | 5 +---- .../src/rules/class-literal-property-style.ts | 5 +---- .../rules/consistent-indexed-object-style.ts | 5 +---- .../src/rules/consistent-type-assertions.ts | 5 +---- .../src/rules/consistent-type-definitions.ts | 5 +---- .../eslint-plugin/src/rules/dot-notation.ts | 5 +---- .../src/rules/no-base-to-string.ts | 5 +---- .../rules/no-confusing-non-null-assertion.ts | 5 +---- .../src/rules/no-dynamic-delete.ts | 5 +---- .../src/rules/no-extraneous-class.ts | 5 +---- .../src/rules/no-invalid-void-type.ts | 5 +---- .../src/rules/no-meaningless-void-operator.ts | 5 +---- .../no-non-null-asserted-nullish-coalescing.ts | 5 +---- .../src/rules/no-throw-literal.ts | 5 +---- .../no-unnecessary-boolean-literal-compare.ts | 5 +---- .../src/rules/no-unnecessary-condition.ts | 5 +---- .../src/rules/no-unnecessary-type-arguments.ts | 5 +---- .../src/rules/no-useless-constructor.ts | 5 +---- .../rules/non-nullable-type-assertion-style.ts | 5 +---- .../eslint-plugin/src/rules/prefer-for-of.ts | 5 +---- .../src/rules/prefer-function-type.ts | 5 +---- .../eslint-plugin/src/rules/prefer-includes.ts | 5 +---- .../src/rules/prefer-literal-enum-member.ts | 5 +---- .../src/rules/prefer-nullish-coalescing.ts | 5 +---- .../src/rules/prefer-optional-chain.ts | 5 +---- .../src/rules/prefer-reduce-type-parameter.ts | 5 +---- .../src/rules/prefer-return-this-type.ts | 5 +---- .../rules/prefer-string-starts-ends-with.ts | 5 +---- .../src/rules/prefer-ts-expect-error.ts | 5 +---- .../src/rules/unified-signatures.ts | 5 +---- .../eslint-plugin/tools/generate-configs.ts | 15 +++++++-------- packages/utils/src/ts-eslint/Rule.ts | 11 +---------- 34 files changed, 48 insertions(+), 151 deletions(-) diff --git a/packages/eslint-plugin/src/configs/strict.ts b/packages/eslint-plugin/src/configs/strict.ts index b6c7169287d..edd544b5656 100644 --- a/packages/eslint-plugin/src/configs/strict.ts +++ b/packages/eslint-plugin/src/configs/strict.ts @@ -17,30 +17,30 @@ export = { '@typescript-eslint/consistent-type-assertions': 'warn', '@typescript-eslint/consistent-type-definitions': 'warn', 'dot-notation': 'off', - '@typescript-eslint/dot-notation': 'error', - '@typescript-eslint/no-base-to-string': 'error', - '@typescript-eslint/no-confusing-non-null-assertion': 'error', + '@typescript-eslint/dot-notation': 'warn', + '@typescript-eslint/no-base-to-string': 'warn', + '@typescript-eslint/no-confusing-non-null-assertion': 'warn', '@typescript-eslint/no-dynamic-delete': 'warn', '@typescript-eslint/no-extraneous-class': 'warn', '@typescript-eslint/no-invalid-void-type': 'warn', '@typescript-eslint/no-meaningless-void-operator': 'warn', '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'warn', 'no-throw-literal': 'off', - '@typescript-eslint/no-throw-literal': 'error', + '@typescript-eslint/no-throw-literal': 'warn', '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn', - '@typescript-eslint/no-unnecessary-condition': 'error', - '@typescript-eslint/no-unnecessary-type-arguments': 'error', + '@typescript-eslint/no-unnecessary-condition': 'warn', + '@typescript-eslint/no-unnecessary-type-arguments': 'warn', 'no-useless-constructor': 'off', '@typescript-eslint/no-useless-constructor': 'warn', - '@typescript-eslint/non-nullable-type-assertion-style': 'error', + '@typescript-eslint/non-nullable-type-assertion-style': 'warn', '@typescript-eslint/prefer-for-of': 'warn', '@typescript-eslint/prefer-function-type': 'warn', - '@typescript-eslint/prefer-includes': 'error', + '@typescript-eslint/prefer-includes': 'warn', '@typescript-eslint/prefer-literal-enum-member': 'warn', '@typescript-eslint/prefer-nullish-coalescing': 'warn', '@typescript-eslint/prefer-optional-chain': 'warn', '@typescript-eslint/prefer-reduce-type-parameter': 'warn', - '@typescript-eslint/prefer-return-this-type': 'error', + '@typescript-eslint/prefer-return-this-type': 'warn', '@typescript-eslint/prefer-string-starts-ends-with': 'warn', '@typescript-eslint/prefer-ts-expect-error': 'warn', '@typescript-eslint/unified-signatures': 'warn', diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts index 6b6909710ff..fd0f5aec3a0 100644 --- a/packages/eslint-plugin/src/rules/array-type.ts +++ b/packages/eslint-plugin/src/rules/array-type.ts @@ -90,10 +90,7 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Requires using either `T[]` or `Array` for arrays', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/ban-tslint-comment.ts b/packages/eslint-plugin/src/rules/ban-tslint-comment.ts index 2343902c166..87e500d3c23 100644 --- a/packages/eslint-plugin/src/rules/ban-tslint-comment.ts +++ b/packages/eslint-plugin/src/rules/ban-tslint-comment.ts @@ -20,10 +20,7 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Bans `// tslint:` comments from being used', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, messages: { commentDetected: 'tslint comment detected: "{{ text }}"', diff --git a/packages/eslint-plugin/src/rules/class-literal-property-style.ts b/packages/eslint-plugin/src/rules/class-literal-property-style.ts index 3d087c3b680..49c28fbd3a9 100644 --- a/packages/eslint-plugin/src/rules/class-literal-property-style.ts +++ b/packages/eslint-plugin/src/rules/class-literal-property-style.ts @@ -41,10 +41,7 @@ export default util.createRule({ docs: { description: 'Ensures that literals on classes are exposed in a consistent style', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts b/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts index 61a13c1bfdb..b68b2eae4b0 100644 --- a/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts +++ b/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts @@ -10,10 +10,7 @@ export default createRule({ type: 'suggestion', docs: { description: 'Enforce or disallow the use of the record type', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, messages: { preferRecord: 'A record is preferred over an index signature.', diff --git a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts index 47f64290edd..5ee9eae618e 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts @@ -23,10 +23,7 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Enforces consistent usage of type assertions', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, messages: { as: "Use 'as {{cast}}' instead of '<{{cast}}>'.", diff --git a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts index f63ac835d89..e0690e650d4 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts @@ -13,10 +13,7 @@ export default util.createRule({ docs: { description: 'Consistent with type definition either `interface` or `type`', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, messages: { interfaceOverType: 'Use an `interface` instead of a `type`.', diff --git a/packages/eslint-plugin/src/rules/dot-notation.ts b/packages/eslint-plugin/src/rules/dot-notation.ts index 23aeac0f643..cfa8ae55a44 100644 --- a/packages/eslint-plugin/src/rules/dot-notation.ts +++ b/packages/eslint-plugin/src/rules/dot-notation.ts @@ -20,10 +20,7 @@ export default createRule({ type: 'suggestion', docs: { description: 'enforce dot notation whenever possible', - recommended: { - level: 'error', - strict: true, - }, + recommended: 'strict', extendsBaseRule: true, requiresTypeChecking: true, }, diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts index 283dca92573..c728f0f726b 100644 --- a/packages/eslint-plugin/src/rules/no-base-to-string.ts +++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts @@ -22,10 +22,7 @@ export default util.createRule({ docs: { description: 'Requires that `.toString()` is only called on objects which provide useful information when stringified', - recommended: { - level: 'error', - strict: true, - }, + recommended: 'strict', requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts index 66bcdbcd78c..c6a3234e999 100644 --- a/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts @@ -13,10 +13,7 @@ export default util.createRule({ docs: { description: 'Disallow non-null assertion in locations that may be confusing', - recommended: { - level: 'error', - strict: true, - }, + recommended: 'strict', }, fixable: 'code', hasSuggestions: true, diff --git a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts index 1774948e654..01ed32d7461 100644 --- a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts +++ b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts @@ -7,10 +7,7 @@ export default util.createRule({ meta: { docs: { description: 'Disallow the delete operator with computed key expressions', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/no-extraneous-class.ts b/packages/eslint-plugin/src/rules/no-extraneous-class.ts index e4bacdc3398..b695301af32 100644 --- a/packages/eslint-plugin/src/rules/no-extraneous-class.ts +++ b/packages/eslint-plugin/src/rules/no-extraneous-class.ts @@ -17,10 +17,7 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Forbids the use of classes as namespaces', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, schema: [ { diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index 235e871832e..cefea8cf0c3 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -20,10 +20,7 @@ export default util.createRule<[Options], MessageIds>({ docs: { description: 'Disallows usage of `void` type outside of generic or return types', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, messages: { invalidVoidForGeneric: diff --git a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts index d024515bcc7..e509b186dc8 100644 --- a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts +++ b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts @@ -19,10 +19,7 @@ export default util.createRule< docs: { description: 'Disallow the `void` operator except when used to discard a value', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', suggestion: true, requiresTypeChecking: true, }, diff --git a/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts index 012722ca12c..fada84c9a83 100644 --- a/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts +++ b/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts @@ -35,10 +35,7 @@ export default util.createRule({ docs: { description: 'Disallows using a non-null assertion in the left operand of the nullish coalescing operator', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, messages: { noNonNullAssertedNullishCoalescing: diff --git a/packages/eslint-plugin/src/rules/no-throw-literal.ts b/packages/eslint-plugin/src/rules/no-throw-literal.ts index fc81c660173..36522c15398 100644 --- a/packages/eslint-plugin/src/rules/no-throw-literal.ts +++ b/packages/eslint-plugin/src/rules/no-throw-literal.ts @@ -17,10 +17,7 @@ export default util.createRule({ type: 'problem', docs: { description: 'Disallow throwing literals as exceptions', - recommended: { - level: 'error', - strict: true, - }, + recommended: 'strict', extendsBaseRule: true, requiresTypeChecking: true, }, diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts index 4f20ee6b607..1bd58206285 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts @@ -35,10 +35,7 @@ export default util.createRule({ docs: { description: 'Flags unnecessary equality comparisons against boolean literals', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', requiresTypeChecking: true, }, fixable: 'code', diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts index 18ee62459dd..53c440442f5 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts @@ -90,10 +90,7 @@ export default createRule({ docs: { description: 'Prevents conditionals where the type is always truthy or always falsy', - recommended: { - level: 'error', - strict: true, - }, + recommended: 'strict', requiresTypeChecking: true, }, schema: [ diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts index 93fb6412cb3..892305d3191 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts @@ -22,10 +22,7 @@ export default util.createRule<[], MessageIds>({ docs: { description: 'Enforces that type arguments will not be used if not required', - recommended: { - level: 'error', - strict: true, - }, + recommended: 'strict', requiresTypeChecking: true, }, fixable: 'code', diff --git a/packages/eslint-plugin/src/rules/no-useless-constructor.ts b/packages/eslint-plugin/src/rules/no-useless-constructor.ts index 5b7ead653ea..10e55cfbe0e 100644 --- a/packages/eslint-plugin/src/rules/no-useless-constructor.ts +++ b/packages/eslint-plugin/src/rules/no-useless-constructor.ts @@ -48,10 +48,7 @@ export default util.createRule({ type: 'problem', docs: { description: 'Disallow unnecessary constructors', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', extendsBaseRule: true, }, hasSuggestions: baseRule.meta.hasSuggestions, diff --git a/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts b/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts index ba2bfd6bfad..d2973e75808 100644 --- a/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts +++ b/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts @@ -10,10 +10,7 @@ export default util.createRule({ docs: { description: 'Prefers a non-null assertion over explicit type cast when possible', - recommended: { - level: 'error', - strict: true, - }, + recommended: 'strict', requiresTypeChecking: true, suggestion: true, }, diff --git a/packages/eslint-plugin/src/rules/prefer-for-of.ts b/packages/eslint-plugin/src/rules/prefer-for-of.ts index d881df4a27e..97c33878acc 100644 --- a/packages/eslint-plugin/src/rules/prefer-for-of.ts +++ b/packages/eslint-plugin/src/rules/prefer-for-of.ts @@ -8,10 +8,7 @@ export default util.createRule({ docs: { description: 'Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, messages: { preferForOf: diff --git a/packages/eslint-plugin/src/rules/prefer-function-type.ts b/packages/eslint-plugin/src/rules/prefer-function-type.ts index efd4568ce44..4c4a4812069 100644 --- a/packages/eslint-plugin/src/rules/prefer-function-type.ts +++ b/packages/eslint-plugin/src/rules/prefer-function-type.ts @@ -17,10 +17,7 @@ export default util.createRule({ docs: { description: 'Use function types instead of interfaces with call signatures', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-includes.ts b/packages/eslint-plugin/src/rules/prefer-includes.ts index 157fe5050d6..0c07617b9dd 100644 --- a/packages/eslint-plugin/src/rules/prefer-includes.ts +++ b/packages/eslint-plugin/src/rules/prefer-includes.ts @@ -16,10 +16,7 @@ export default createRule({ type: 'suggestion', docs: { description: 'Enforce `includes` method over `indexOf` method', - recommended: { - level: 'error', - strict: true, - }, + recommended: 'strict', requiresTypeChecking: true, }, fixable: 'code', diff --git a/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts b/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts index bcd38024853..17a657d7b25 100644 --- a/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts +++ b/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts @@ -8,10 +8,7 @@ export default createRule({ docs: { description: 'Require that all enum members be literal values to prevent unintended enum member name shadow issues', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', requiresTypeChecking: false, }, messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts index 759f6a36344..ddb68d90c47 100644 --- a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts +++ b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts @@ -21,10 +21,7 @@ export default util.createRule({ docs: { description: 'Enforce the usage of the nullish coalescing operator instead of logical chaining', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', suggestion: true, requiresTypeChecking: true, }, diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts index 071470a50b2..0bcf58befdc 100644 --- a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts +++ b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts @@ -33,10 +33,7 @@ export default util.createRule({ docs: { description: 'Prefer using concise optional chain expressions instead of chained logical ands', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', suggestion: true, }, hasSuggestions: true, diff --git a/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts b/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts index 62d63fb154a..d034095a6f8 100644 --- a/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts +++ b/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts @@ -29,10 +29,7 @@ export default util.createRule({ docs: { description: 'Prefer using type parameter when calling `Array#reduce` instead of casting', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts index 39ef135943b..0766d98efbd 100644 --- a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts +++ b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts @@ -19,10 +19,7 @@ export default createRule({ docs: { description: 'Enforce that `this` is used when only `this` type is returned', - recommended: { - level: 'error', - strict: true, - }, + recommended: 'strict', requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts index 4c4988ee286..8d95b9a5f2e 100644 --- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts +++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts @@ -23,10 +23,7 @@ export default createRule({ docs: { description: 'Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts b/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts index deb8521cd86..371b063d1d6 100644 --- a/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts +++ b/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts @@ -10,10 +10,7 @@ export default util.createRule<[], MessageIds>({ type: 'problem', docs: { description: 'Recommends using `@ts-expect-error` over `@ts-ignore`', - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/unified-signatures.ts b/packages/eslint-plugin/src/rules/unified-signatures.ts index a43f147da4d..8be8d8d4f6c 100644 --- a/packages/eslint-plugin/src/rules/unified-signatures.ts +++ b/packages/eslint-plugin/src/rules/unified-signatures.ts @@ -55,10 +55,7 @@ export default util.createRule({ description: 'Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter', // too opinionated to be recommended - recommended: { - level: 'warn', - strict: true, - }, + recommended: 'strict', }, type: 'suggestion', messages: { diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts index aa1c2a21665..5e111cc51fa 100644 --- a/packages/eslint-plugin/tools/generate-configs.ts +++ b/packages/eslint-plugin/tools/generate-configs.ts @@ -71,7 +71,6 @@ function reducer( errorLevel?: 'error' | 'warn'; filterDeprecated: boolean; filterRequiresTypeChecking?: 'include' | 'exclude'; - filterStrict?: boolean; }, ): LinterConfigRules { const key = entry[0]; @@ -98,15 +97,14 @@ function reducer( } const ruleName = `${RULE_NAME_PREFIX}${key}`; - const recommendation = - typeof value.meta.docs?.recommended === 'object' - ? value.meta.docs.recommended.level - : value.meta.docs?.recommended; + const recommendation = value.meta.docs?.recommended; const usedSetting = settings.errorLevel ? settings.errorLevel : !recommendation ? DEFAULT_RULE_SETTING + : recommendation === 'strict' + ? 'warn' : recommendation; if (BASE_RULES_TO_BE_OVERRIDDEN.has(key)) { @@ -145,12 +143,14 @@ function writeConfig(config: LinterConfig, filePath: string): void { fs.writeFileSync(filePath, configStr); } +const recommendedValues = new Set(['error', 'warn']); + function entryIsRecommended(entry: RuleEntry): boolean { - return typeof entry[1].meta.docs?.recommended === 'string'; + return recommendedValues.has(entry[1].meta.docs?.recommended); } function entryIsStrict(entry: RuleEntry): boolean { - return typeof entry[1].meta.docs?.recommended === 'object'; + return entry[1].meta.docs?.recommended === 'strict'; } const baseConfig: LinterConfig = { @@ -233,7 +233,6 @@ const strictRules = ruleEntries.filter(entryIsStrict).reduce( (config, entry) => reducer(config, entry, { filterDeprecated: false, - filterStrict: true, }), {}, ); diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 77e48171be5..00342435728 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -5,15 +5,6 @@ import type { Linter } from './Linter'; import type { Scope } from './Scope'; import type { SourceCode } from './SourceCode'; -type RecommendedLevel = 'error' | 'warn' | false; - -type Recommended = RecommendedLevel | StrictRecommended; - -interface StrictRecommended { - level: RecommendedLevel; - strict: true; -} - interface RuleMetaDataDocs { /** * Concise description of the rule @@ -24,7 +15,7 @@ interface RuleMetaDataDocs { * Used by the build tools to generate the recommended and strict configs. * Set to false to not include it as a recommendation */ - recommended: Recommended; + recommended: 'error' | 'strict' | 'warn'; /** * The URL of the rule's docs */ From c17ad3e54c2a16dca73b0b0eaf3623680ad133cb Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 21 Mar 2022 10:52:22 -0400 Subject: [PATCH 03/20] chore: missing | false --- packages/utils/src/ts-eslint/Rule.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 00342435728..644dfa03722 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -15,7 +15,7 @@ interface RuleMetaDataDocs { * Used by the build tools to generate the recommended and strict configs. * Set to false to not include it as a recommendation */ - recommended: 'error' | 'strict' | 'warn'; + recommended: 'error' | 'strict' | 'warn' | false; /** * The URL of the rule's docs */ From 1707478916851fcd1be37f62f95f1d7b6def48b0 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 3 Apr 2022 19:06:45 -0500 Subject: [PATCH 04/20] test: update tests for new strictness --- packages/eslint-plugin/tests/docs.test.ts | 13 ++++++++++--- packages/eslint-plugin/tools/generate-configs.ts | 5 ++++- packages/utils/src/ts-eslint/Rule.ts | 2 ++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/eslint-plugin/tests/docs.test.ts b/packages/eslint-plugin/tests/docs.test.ts index 149c065bc23..d5d048d28ed 100644 --- a/packages/eslint-plugin/tests/docs.test.ts +++ b/packages/eslint-plugin/tests/docs.test.ts @@ -1,3 +1,4 @@ +import { TSESLint } from '@typescript-eslint/utils'; import fs from 'fs'; import { JSONSchema4 } from 'json-schema'; import path from 'path'; @@ -131,7 +132,7 @@ describe('Validating rule docs', () => { if ( !isEmptySchema(rule.meta.schema) || rule.meta.docs?.extendsBaseRule || - !rule.meta.docs?.recommended + !shouldBeRecommended(rule.meta.docs) ) { return; } @@ -176,7 +177,7 @@ describe('Validating rule docs', () => { // Verify attributes content const attributesList = tokenAs(tokens[attributesHeaderIndex + 1], 'list'); const recommended = attributesList.items[0]; - expect(rule.meta.docs?.recommended !== false).toBe(recommended.checked); + expect(shouldBeRecommended(rule.meta.docs)).toBe(recommended.checked); const fixable = attributesList.items[1]; expect(rule.meta.fixable !== undefined).toBe(fixable.checked); const requiresTypeChecking = attributesList.items[2]; @@ -274,7 +275,7 @@ describe('Validating README.md', () => { it('Recommended column should be correct', () => { expect(ruleRow[2]).toBe( - rule.meta.docs?.recommended ? ':white_check_mark:' : '', + shouldBeRecommended(rule.meta.docs) ? ':white_check_mark:' : '', ); }); @@ -294,3 +295,9 @@ describe('Validating README.md', () => { }); } }); + +function shouldBeRecommended( + docs: TSESLint.RuleMetaDataDocs | undefined, +): boolean { + return docs?.recommended !== false && docs?.recommended !== 'strict'; +} diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts index 5e111cc51fa..cd7a8f9b33f 100644 --- a/packages/eslint-plugin/tools/generate-configs.ts +++ b/packages/eslint-plugin/tools/generate-configs.ts @@ -143,7 +143,10 @@ function writeConfig(config: LinterConfig, filePath: string): void { fs.writeFileSync(filePath, configStr); } -const recommendedValues = new Set(['error', 'warn']); +const recommendedValues = new Set([ + 'error', + 'warn', +]); function entryIsRecommended(entry: RuleEntry): boolean { return recommendedValues.has(entry[1].meta.docs?.recommended); diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 644dfa03722..699deff005a 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -5,6 +5,8 @@ import type { Linter } from './Linter'; import type { Scope } from './Scope'; import type { SourceCode } from './SourceCode'; +export type RuleRecommendation = 'error' | 'strict' | 'warn' | false; + interface RuleMetaDataDocs { /** * Concise description of the rule From 9c0dbd6d8a8ecdd9a8e5d418f25f87ff7b880ae5 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 3 Apr 2022 19:42:18 -0500 Subject: [PATCH 05/20] test: update .md file templates and docs.test.ts --- packages/eslint-plugin/README.md | 262 +++++++++--------- packages/eslint-plugin/docs/rules/README.md | 255 ++++++++--------- packages/eslint-plugin/docs/rules/TEMPLATE.md | 3 + .../rules/adjacent-overload-signatures.md | 1 + .../eslint-plugin/docs/rules/array-type.md | 1 + .../docs/rules/await-thenable.md | 1 + .../docs/rules/ban-ts-comment.md | 1 + .../docs/rules/ban-tslint-comment.md | 14 + .../eslint-plugin/docs/rules/ban-types.md | 1 + .../eslint-plugin/docs/rules/brace-style.md | 1 + .../rules/class-literal-property-style.md | 1 + .../eslint-plugin/docs/rules/comma-dangle.md | 1 + .../eslint-plugin/docs/rules/comma-spacing.md | 1 + .../rules/consistent-indexed-object-style.md | 1 + .../docs/rules/consistent-type-assertions.md | 1 + .../docs/rules/consistent-type-definitions.md | 1 + .../docs/rules/consistent-type-exports.md | 1 + .../docs/rules/consistent-type-imports.md | 1 + .../docs/rules/default-param-last.md | 1 + .../eslint-plugin/docs/rules/dot-notation.md | 1 + .../rules/explicit-function-return-type.md | 1 + .../rules/explicit-member-accessibility.md | 1 + .../rules/explicit-module-boundary-types.md | 1 + .../docs/rules/func-call-spacing.md | 1 + packages/eslint-plugin/docs/rules/indent.md | 1 + .../docs/rules/init-declarations.md | 1 + .../docs/rules/keyword-spacing.md | 1 + .../docs/rules/lines-between-class-members.md | 1 + .../docs/rules/member-delimiter-style.md | 1 + .../docs/rules/member-ordering.md | 1 + .../docs/rules/method-signature-style.md | 1 + .../docs/rules/naming-convention.md | 1 + .../docs/rules/no-array-constructor.md | 1 + .../docs/rules/no-base-to-string.md | 1 + .../rules/no-confusing-non-null-assertion.md | 14 + .../rules/no-confusing-void-expression.md | 1 + .../docs/rules/no-dupe-class-members.md | 1 + .../docs/rules/no-duplicate-imports.md | 1 + .../docs/rules/no-dynamic-delete.md | 14 + .../docs/rules/no-empty-function.md | 1 + .../docs/rules/no-empty-interface.md | 1 + .../docs/rules/no-explicit-any.md | 1 + .../docs/rules/no-extra-non-null-assertion.md | 1 + .../docs/rules/no-extra-parens.md | 1 + .../eslint-plugin/docs/rules/no-extra-semi.md | 1 + .../docs/rules/no-extraneous-class.md | 1 + .../docs/rules/no-floating-promises.md | 1 + .../docs/rules/no-for-in-array.md | 1 + .../docs/rules/no-implicit-any-catch.md | 1 + .../docs/rules/no-implied-eval.md | 1 + .../docs/rules/no-inferrable-types.md | 1 + .../docs/rules/no-invalid-this.md | 1 + .../docs/rules/no-invalid-void-type.md | 1 + .../eslint-plugin/docs/rules/no-loop-func.md | 1 + .../docs/rules/no-loss-of-precision.md | 1 + .../docs/rules/no-magic-numbers.md | 1 + .../rules/no-meaningless-void-operator.md | 1 + .../docs/rules/no-misused-new.md | 1 + .../docs/rules/no-misused-promises.md | 1 + .../eslint-plugin/docs/rules/no-namespace.md | 1 + ...no-non-null-asserted-nullish-coalescing.md | 14 + .../no-non-null-asserted-optional-chain.md | 1 + .../docs/rules/no-non-null-assertion.md | 1 + .../docs/rules/no-parameter-properties.md | 1 + .../eslint-plugin/docs/rules/no-redeclare.md | 1 + .../rules/no-redundant-type-constituents.md | 14 + .../docs/rules/no-require-imports.md | 14 + .../docs/rules/no-restricted-imports.md | 1 + .../eslint-plugin/docs/rules/no-shadow.md | 1 + .../eslint-plugin/docs/rules/no-this-alias.md | 1 + .../docs/rules/no-throw-literal.md | 1 + .../eslint-plugin/docs/rules/no-type-alias.md | 1 + .../no-unnecessary-boolean-literal-compare.md | 1 + .../docs/rules/no-unnecessary-condition.md | 1 + .../docs/rules/no-unnecessary-qualifier.md | 14 + .../rules/no-unnecessary-type-arguments.md | 14 + .../rules/no-unnecessary-type-assertion.md | 1 + .../rules/no-unnecessary-type-constraint.md | 1 + .../docs/rules/no-unsafe-argument.md | 1 + .../docs/rules/no-unsafe-assignment.md | 1 + .../docs/rules/no-unsafe-call.md | 1 + .../docs/rules/no-unsafe-member-access.md | 1 + .../docs/rules/no-unsafe-return.md | 1 + .../docs/rules/no-unused-expressions.md | 1 + .../docs/rules/no-unused-vars.md | 1 + .../docs/rules/no-use-before-define.md | 1 + .../docs/rules/no-useless-constructor.md | 1 + .../docs/rules/no-useless-empty-export.md | 14 + .../docs/rules/no-var-requires.md | 1 + .../non-nullable-type-assertion-style.md | 14 + .../docs/rules/object-curly-spacing.md | 1 + .../rules/padding-line-between-statements.md | 1 + .../docs/rules/prefer-as-const.md | 1 + .../docs/rules/prefer-enum-initializers.md | 14 + .../eslint-plugin/docs/rules/prefer-for-of.md | 14 + .../docs/rules/prefer-function-type.md | 14 + .../docs/rules/prefer-includes.md | 12 +- .../docs/rules/prefer-literal-enum-member.md | 1 + .../docs/rules/prefer-namespace-keyword.md | 1 + .../docs/rules/prefer-nullish-coalescing.md | 1 + .../docs/rules/prefer-optional-chain.md | 14 + .../rules/prefer-readonly-parameter-types.md | 1 + .../docs/rules/prefer-readonly.md | 1 + .../rules/prefer-reduce-type-parameter.md | 12 +- .../docs/rules/prefer-regexp-exec.md | 12 +- .../docs/rules/prefer-return-this-type.md | 14 + .../rules/prefer-string-starts-ends-with.md | 12 +- .../docs/rules/prefer-ts-expect-error.md | 14 + .../docs/rules/promise-function-async.md | 1 + packages/eslint-plugin/docs/rules/quotes.md | 1 + .../docs/rules/require-array-sort-compare.md | 1 + .../eslint-plugin/docs/rules/require-await.md | 1 + .../docs/rules/restrict-plus-operands.md | 1 + .../rules/restrict-template-expressions.md | 1 + .../eslint-plugin/docs/rules/return-await.md | 1 + packages/eslint-plugin/docs/rules/semi.md | 1 + .../sort-type-union-intersection-members.md | 1 + .../docs/rules/space-before-blocks.md | 1 + .../docs/rules/space-before-function-paren.md | 1 + .../docs/rules/space-infix-ops.md | 1 + .../docs/rules/strict-boolean-expressions.md | 1 + .../docs/rules/switch-exhaustiveness-check.md | 14 + .../docs/rules/triple-slash-reference.md | 1 + .../docs/rules/type-annotation-spacing.md | 1 + packages/eslint-plugin/docs/rules/typedef.md | 1 + .../docs/rules/unbound-method.md | 1 + .../docs/rules/unified-signatures.md | 14 + packages/eslint-plugin/tests/docs.test.ts | 157 ++++++----- .../tools/generate-rules-lists.ts | 15 +- packages/utils/src/ts-eslint/Rule.ts | 2 +- 130 files changed, 754 insertions(+), 342 deletions(-) diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 1cecb6d4019..c090a94c60c 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -93,95 +93,95 @@ Pro Tip: For larger codebases you may want to consider splitting our linting int -**Key**: :white_check_mark: = recommended, :wrench: = fixable, :thought_balloon: = requires type information - -| Name | Description | :white_check_mark: | :wrench: | :thought_balloon: | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------ | -------- | ----------------- | -| [`@typescript-eslint/adjacent-overload-signatures`](./docs/rules/adjacent-overload-signatures.md) | Require that member overloads be consecutive | :white_check_mark: | | | -| [`@typescript-eslint/array-type`](./docs/rules/array-type.md) | Requires using either `T[]` or `Array` for arrays | | :wrench: | | -| [`@typescript-eslint/await-thenable`](./docs/rules/await-thenable.md) | Disallows awaiting a value that is not a Thenable | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/ban-ts-comment`](./docs/rules/ban-ts-comment.md) | Bans `@ts-` comments from being used or requires descriptions after directive | :white_check_mark: | | | -| [`@typescript-eslint/ban-tslint-comment`](./docs/rules/ban-tslint-comment.md) | Bans `// tslint:` comments from being used | | :wrench: | | -| [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Bans specific types from being used | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/class-literal-property-style`](./docs/rules/class-literal-property-style.md) | Ensures that literals on classes are exposed in a consistent style | | :wrench: | | -| [`@typescript-eslint/consistent-indexed-object-style`](./docs/rules/consistent-indexed-object-style.md) | Enforce or disallow the use of the record type | | :wrench: | | -| [`@typescript-eslint/consistent-type-assertions`](./docs/rules/consistent-type-assertions.md) | Enforces consistent usage of type assertions | | | | -| [`@typescript-eslint/consistent-type-definitions`](./docs/rules/consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | | :wrench: | | -| [`@typescript-eslint/consistent-type-exports`](./docs/rules/consistent-type-exports.md) | Enforces consistent usage of type exports | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/consistent-type-imports`](./docs/rules/consistent-type-imports.md) | Enforces consistent usage of type imports | | :wrench: | | -| [`@typescript-eslint/explicit-function-return-type`](./docs/rules/explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | -| [`@typescript-eslint/explicit-member-accessibility`](./docs/rules/explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | -| [`@typescript-eslint/explicit-module-boundary-types`](./docs/rules/explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | -| [`@typescript-eslint/member-delimiter-style`](./docs/rules/member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | -| [`@typescript-eslint/member-ordering`](./docs/rules/member-ordering.md) | Require a consistent member declaration order | | | | -| [`@typescript-eslint/method-signature-style`](./docs/rules/method-signature-style.md) | Enforces using a particular method signature syntax. | | :wrench: | | -| [`@typescript-eslint/naming-convention`](./docs/rules/naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | -| [`@typescript-eslint/no-base-to-string`](./docs/rules/no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | | | :thought_balloon: | -| [`@typescript-eslint/no-confusing-non-null-assertion`](./docs/rules/no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | | :wrench: | | -| [`@typescript-eslint/no-confusing-void-expression`](./docs/rules/no-confusing-void-expression.md) | Requires expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-dynamic-delete`](./docs/rules/no-dynamic-delete.md) | Disallow the delete operator with computed key expressions | | :wrench: | | -| [`@typescript-eslint/no-empty-interface`](./docs/rules/no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-explicit-any`](./docs/rules/no-explicit-any.md) | Disallow usage of the `any` type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extra-non-null-assertion`](./docs/rules/no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extraneous-class`](./docs/rules/no-extraneous-class.md) | Forbids the use of classes as namespaces | | | | -| [`@typescript-eslint/no-floating-promises`](./docs/rules/no-floating-promises.md) | Requires Promise-like statements to be handled appropriately | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-for-in-array`](./docs/rules/no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-inferrable-types`](./docs/rules/no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-invalid-void-type`](./docs/rules/no-invalid-void-type.md) | Disallows usage of `void` type outside of generic or return types | | | | -| [`@typescript-eslint/no-meaningless-void-operator`](./docs/rules/no-meaningless-void-operator.md) | Disallow the `void` operator except when used to discard a value | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-misused-new`](./docs/rules/no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :white_check_mark: | | | -| [`@typescript-eslint/no-misused-promises`](./docs/rules/no-misused-promises.md) | Avoid using Promises in places not designed to handle them | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-namespace`](./docs/rules/no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./docs/rules/no-non-null-asserted-nullish-coalescing.md) | Disallows using a non-null assertion in the left operand of the nullish coalescing operator | | | | -| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./docs/rules/no-non-null-asserted-optional-chain.md) | Disallows using a non-null assertion after an optional chain expression | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-assertion`](./docs/rules/no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :white_check_mark: | | | -| [`@typescript-eslint/no-parameter-properties`](./docs/rules/no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | | -| [`@typescript-eslint/no-redundant-type-constituents`](./docs/rules/no-redundant-type-constituents.md) | Disallow members of unions and intersections that do nothing or override type information | | | :thought_balloon: | -| [`@typescript-eslint/no-require-imports`](./docs/rules/no-require-imports.md) | Disallows invocation of `require()` | | | | -| [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | -| [`@typescript-eslint/no-type-alias`](./docs/rules/no-type-alias.md) | Disallow the use of type aliases | | | | -| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./docs/rules/no-unnecessary-boolean-literal-compare.md) | Flags unnecessary equality comparisons against boolean literals | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-condition`](./docs/rules/no-unnecessary-condition.md) | Prevents conditionals where the type is always truthy or always falsy | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-qualifier`](./docs/rules/no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-arguments`](./docs/rules/no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-assertion`](./docs/rules/no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-constraint`](./docs/rules/no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-unsafe-argument`](./docs/rules/no-unsafe-argument.md) | Disallows calling a function with an any type value | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-assignment`](./docs/rules/no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-call`](./docs/rules/no-unsafe-call.md) | Disallows calling an any type value | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-member-access`](./docs/rules/no-unsafe-member-access.md) | Disallows member access on any typed variables | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-return`](./docs/rules/no-unsafe-return.md) | Disallows returning any from a function | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-useless-empty-export`](./docs/rules/no-useless-empty-export.md) | Disallow empty exports that don't change anything in a module file | | :wrench: | | -| [`@typescript-eslint/no-var-requires`](./docs/rules/no-var-requires.md) | Disallows the use of require statements except in import statements | :white_check_mark: | | | -| [`@typescript-eslint/non-nullable-type-assertion-style`](./docs/rules/non-nullable-type-assertion-style.md) | Prefers a non-null assertion over explicit type cast when possible | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-as-const`](./docs/rules/prefer-as-const.md) | Prefer usage of `as const` over literal type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-enum-initializers`](./docs/rules/prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | -| [`@typescript-eslint/prefer-for-of`](./docs/rules/prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | | | | -| [`@typescript-eslint/prefer-function-type`](./docs/rules/prefer-function-type.md) | Use function types instead of interfaces with call signatures | | :wrench: | | -| [`@typescript-eslint/prefer-includes`](./docs/rules/prefer-includes.md) | Enforce `includes` method over `indexOf` method | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-literal-enum-member`](./docs/rules/prefer-literal-enum-member.md) | Require that all enum members be literal values to prevent unintended enum member name shadow issues | | | | -| [`@typescript-eslint/prefer-namespace-keyword`](./docs/rules/prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-nullish-coalescing`](./docs/rules/prefer-nullish-coalescing.md) | Enforce the usage of the nullish coalescing operator instead of logical chaining | | | :thought_balloon: | -| [`@typescript-eslint/prefer-optional-chain`](./docs/rules/prefer-optional-chain.md) | Prefer using concise optional chain expressions instead of chained logical ands | | | | -| [`@typescript-eslint/prefer-readonly`](./docs/rules/prefer-readonly.md) | Requires that private members are marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-readonly-parameter-types`](./docs/rules/prefer-readonly-parameter-types.md) | Requires that function parameters are typed as readonly to prevent accidental mutation of inputs | | | :thought_balloon: | -| [`@typescript-eslint/prefer-reduce-type-parameter`](./docs/rules/prefer-reduce-type-parameter.md) | Prefer using type parameter when calling `Array#reduce` instead of casting | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-regexp-exec`](./docs/rules/prefer-regexp-exec.md) | Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-return-this-type`](./docs/rules/prefer-return-this-type.md) | Enforce that `this` is used when only `this` type is returned | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-string-starts-ends-with`](./docs/rules/prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-ts-expect-error`](./docs/rules/prefer-ts-expect-error.md) | Recommends using `@ts-expect-error` over `@ts-ignore` | | :wrench: | | -| [`@typescript-eslint/promise-function-async`](./docs/rules/promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/require-array-sort-compare`](./docs/rules/require-array-sort-compare.md) | Requires `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | -| [`@typescript-eslint/restrict-plus-operands`](./docs/rules/restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/restrict-template-expressions`](./docs/rules/restrict-template-expressions.md) | Enforce template literal expressions to be of string type | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/sort-type-union-intersection-members`](./docs/rules/sort-type-union-intersection-members.md) | Enforces that members of a type union/intersection are sorted alphabetically | | :wrench: | | -| [`@typescript-eslint/strict-boolean-expressions`](./docs/rules/strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/switch-exhaustiveness-check`](./docs/rules/switch-exhaustiveness-check.md) | Exhaustiveness checking in switch with union type | | | :thought_balloon: | -| [`@typescript-eslint/triple-slash-reference`](./docs/rules/triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :white_check_mark: | | | -| [`@typescript-eslint/type-annotation-spacing`](./docs/rules/type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | -| [`@typescript-eslint/typedef`](./docs/rules/typedef.md) | Requires type annotations to exist | | | | -| [`@typescript-eslint/unbound-method`](./docs/rules/unbound-method.md) | Enforces unbound methods are called with their expected scope | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/unified-signatures`](./docs/rules/unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | | | | +**Key**: :white_check_mark: = recommended, :heavy_check_mark: = strict, :wrench: = fixable, :thought_balloon: = requires type information + +| Name | Description | :white_check_mark::heavy_check_mark: | :wrench: | :thought_balloon: | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | -------- | ----------------- | +| [`@typescript-eslint/adjacent-overload-signatures`](./docs/rules/adjacent-overload-signatures.md) | Require that member overloads be consecutive | :white_check_mark: | | | +| [`@typescript-eslint/array-type`](./docs/rules/array-type.md) | Requires using either `T[]` or `Array` for arrays | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/await-thenable`](./docs/rules/await-thenable.md) | Disallows awaiting a value that is not a Thenable | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/ban-ts-comment`](./docs/rules/ban-ts-comment.md) | Bans `@ts-` comments from being used or requires descriptions after directive | :white_check_mark: | | | +| [`@typescript-eslint/ban-tslint-comment`](./docs/rules/ban-tslint-comment.md) | Bans `// tslint:` comments from being used | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Bans specific types from being used | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/class-literal-property-style`](./docs/rules/class-literal-property-style.md) | Ensures that literals on classes are exposed in a consistent style | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/consistent-indexed-object-style`](./docs/rules/consistent-indexed-object-style.md) | Enforce or disallow the use of the record type | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/consistent-type-assertions`](./docs/rules/consistent-type-assertions.md) | Enforces consistent usage of type assertions | :heavy_check_mark: | | | +| [`@typescript-eslint/consistent-type-definitions`](./docs/rules/consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/consistent-type-exports`](./docs/rules/consistent-type-exports.md) | Enforces consistent usage of type exports | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/consistent-type-imports`](./docs/rules/consistent-type-imports.md) | Enforces consistent usage of type imports | | :wrench: | | +| [`@typescript-eslint/explicit-function-return-type`](./docs/rules/explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | +| [`@typescript-eslint/explicit-member-accessibility`](./docs/rules/explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | +| [`@typescript-eslint/explicit-module-boundary-types`](./docs/rules/explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | +| [`@typescript-eslint/member-delimiter-style`](./docs/rules/member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | +| [`@typescript-eslint/member-ordering`](./docs/rules/member-ordering.md) | Require a consistent member declaration order | | | | +| [`@typescript-eslint/method-signature-style`](./docs/rules/method-signature-style.md) | Enforces using a particular method signature syntax. | | :wrench: | | +| [`@typescript-eslint/naming-convention`](./docs/rules/naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | +| [`@typescript-eslint/no-base-to-string`](./docs/rules/no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-confusing-non-null-assertion`](./docs/rules/no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-confusing-void-expression`](./docs/rules/no-confusing-void-expression.md) | Requires expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-dynamic-delete`](./docs/rules/no-dynamic-delete.md) | Disallow the delete operator with computed key expressions | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-empty-interface`](./docs/rules/no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-explicit-any`](./docs/rules/no-explicit-any.md) | Disallow usage of the `any` type | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-extra-non-null-assertion`](./docs/rules/no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-extraneous-class`](./docs/rules/no-extraneous-class.md) | Forbids the use of classes as namespaces | :heavy_check_mark: | | | +| [`@typescript-eslint/no-floating-promises`](./docs/rules/no-floating-promises.md) | Requires Promise-like statements to be handled appropriately | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-for-in-array`](./docs/rules/no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-inferrable-types`](./docs/rules/no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-invalid-void-type`](./docs/rules/no-invalid-void-type.md) | Disallows usage of `void` type outside of generic or return types | :heavy_check_mark: | | | +| [`@typescript-eslint/no-meaningless-void-operator`](./docs/rules/no-meaningless-void-operator.md) | Disallow the `void` operator except when used to discard a value | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-misused-new`](./docs/rules/no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :white_check_mark: | | | +| [`@typescript-eslint/no-misused-promises`](./docs/rules/no-misused-promises.md) | Avoid using Promises in places not designed to handle them | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-namespace`](./docs/rules/no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :white_check_mark: | | | +| [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./docs/rules/no-non-null-asserted-nullish-coalescing.md) | Disallows using a non-null assertion in the left operand of the nullish coalescing operator | :heavy_check_mark: | | | +| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./docs/rules/no-non-null-asserted-optional-chain.md) | Disallows using a non-null assertion after an optional chain expression | :white_check_mark: | | | +| [`@typescript-eslint/no-non-null-assertion`](./docs/rules/no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :white_check_mark: | | | +| [`@typescript-eslint/no-parameter-properties`](./docs/rules/no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | | +| [`@typescript-eslint/no-redundant-type-constituents`](./docs/rules/no-redundant-type-constituents.md) | Disallow members of unions and intersections that do nothing or override type information | | | :thought_balloon: | +| [`@typescript-eslint/no-require-imports`](./docs/rules/no-require-imports.md) | Disallows invocation of `require()` | | | | +| [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | +| [`@typescript-eslint/no-type-alias`](./docs/rules/no-type-alias.md) | Disallow the use of type aliases | | | | +| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./docs/rules/no-unnecessary-boolean-literal-compare.md) | Flags unnecessary equality comparisons against boolean literals | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-condition`](./docs/rules/no-unnecessary-condition.md) | Prevents conditionals where the type is always truthy or always falsy | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-qualifier`](./docs/rules/no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-arguments`](./docs/rules/no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-assertion`](./docs/rules/no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-constraint`](./docs/rules/no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-unsafe-argument`](./docs/rules/no-unsafe-argument.md) | Disallows calling a function with an any type value | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-assignment`](./docs/rules/no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-call`](./docs/rules/no-unsafe-call.md) | Disallows calling an any type value | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-member-access`](./docs/rules/no-unsafe-member-access.md) | Disallows member access on any typed variables | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-return`](./docs/rules/no-unsafe-return.md) | Disallows returning any from a function | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-useless-empty-export`](./docs/rules/no-useless-empty-export.md) | Disallow empty exports that don't change anything in a module file | | :wrench: | | +| [`@typescript-eslint/no-var-requires`](./docs/rules/no-var-requires.md) | Disallows the use of require statements except in import statements | :white_check_mark: | | | +| [`@typescript-eslint/non-nullable-type-assertion-style`](./docs/rules/non-nullable-type-assertion-style.md) | Prefers a non-null assertion over explicit type cast when possible | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-as-const`](./docs/rules/prefer-as-const.md) | Prefer usage of `as const` over literal type | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-enum-initializers`](./docs/rules/prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | +| [`@typescript-eslint/prefer-for-of`](./docs/rules/prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | :heavy_check_mark: | | | +| [`@typescript-eslint/prefer-function-type`](./docs/rules/prefer-function-type.md) | Use function types instead of interfaces with call signatures | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-includes`](./docs/rules/prefer-includes.md) | Enforce `includes` method over `indexOf` method | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-literal-enum-member`](./docs/rules/prefer-literal-enum-member.md) | Require that all enum members be literal values to prevent unintended enum member name shadow issues | :heavy_check_mark: | | | +| [`@typescript-eslint/prefer-namespace-keyword`](./docs/rules/prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-nullish-coalescing`](./docs/rules/prefer-nullish-coalescing.md) | Enforce the usage of the nullish coalescing operator instead of logical chaining | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/prefer-optional-chain`](./docs/rules/prefer-optional-chain.md) | Prefer using concise optional chain expressions instead of chained logical ands | :heavy_check_mark: | | | +| [`@typescript-eslint/prefer-readonly`](./docs/rules/prefer-readonly.md) | Requires that private members are marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-readonly-parameter-types`](./docs/rules/prefer-readonly-parameter-types.md) | Requires that function parameters are typed as readonly to prevent accidental mutation of inputs | | | :thought_balloon: | +| [`@typescript-eslint/prefer-reduce-type-parameter`](./docs/rules/prefer-reduce-type-parameter.md) | Prefer using type parameter when calling `Array#reduce` instead of casting | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-regexp-exec`](./docs/rules/prefer-regexp-exec.md) | Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-return-this-type`](./docs/rules/prefer-return-this-type.md) | Enforce that `this` is used when only `this` type is returned | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-string-starts-ends-with`](./docs/rules/prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-ts-expect-error`](./docs/rules/prefer-ts-expect-error.md) | Recommends using `@ts-expect-error` over `@ts-ignore` | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/promise-function-async`](./docs/rules/promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/require-array-sort-compare`](./docs/rules/require-array-sort-compare.md) | Requires `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | +| [`@typescript-eslint/restrict-plus-operands`](./docs/rules/restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/restrict-template-expressions`](./docs/rules/restrict-template-expressions.md) | Enforce template literal expressions to be of string type | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/sort-type-union-intersection-members`](./docs/rules/sort-type-union-intersection-members.md) | Enforces that members of a type union/intersection are sorted alphabetically | | :wrench: | | +| [`@typescript-eslint/strict-boolean-expressions`](./docs/rules/strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/switch-exhaustiveness-check`](./docs/rules/switch-exhaustiveness-check.md) | Exhaustiveness checking in switch with union type | | | :thought_balloon: | +| [`@typescript-eslint/triple-slash-reference`](./docs/rules/triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :white_check_mark: | | | +| [`@typescript-eslint/type-annotation-spacing`](./docs/rules/type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | +| [`@typescript-eslint/typedef`](./docs/rules/typedef.md) | Requires type annotations to exist | | | | +| [`@typescript-eslint/unbound-method`](./docs/rules/unbound-method.md) | Enforces unbound methods are called with their expected scope | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/unified-signatures`](./docs/rules/unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | :heavy_check_mark: | | | @@ -192,48 +192,48 @@ In these cases, we create what we call an extension rule; a rule within our plug -**Key**: :white_check_mark: = recommended, :wrench: = fixable, :thought_balloon: = requires type information - -| Name | Description | :white_check_mark: | :wrench: | :thought_balloon: | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------ | -------- | ----------------- | -| [`@typescript-eslint/brace-style`](./docs/rules/brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | -| [`@typescript-eslint/comma-dangle`](./docs/rules/comma-dangle.md) | Require or disallow trailing comma | | :wrench: | | -| [`@typescript-eslint/comma-spacing`](./docs/rules/comma-spacing.md) | Enforces consistent spacing before and after commas | | :wrench: | | -| [`@typescript-eslint/default-param-last`](./docs/rules/default-param-last.md) | Enforce default parameters to be last | | | | -| [`@typescript-eslint/dot-notation`](./docs/rules/dot-notation.md) | enforce dot notation whenever possible | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/func-call-spacing`](./docs/rules/func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | -| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | | :wrench: | | -| [`@typescript-eslint/init-declarations`](./docs/rules/init-declarations.md) | require or disallow initialization in variable declarations | | | | -| [`@typescript-eslint/keyword-spacing`](./docs/rules/keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | -| [`@typescript-eslint/lines-between-class-members`](./docs/rules/lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | -| [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-dupe-class-members`](./docs/rules/no-dupe-class-members.md) | Disallow duplicate class members | | | | -| [`@typescript-eslint/no-duplicate-imports`](./docs/rules/no-duplicate-imports.md) | Disallow duplicate imports | | | | -| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :white_check_mark: | | | -| [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | -| [`@typescript-eslint/no-extra-semi`](./docs/rules/no-extra-semi.md) | Disallow unnecessary semicolons | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-implied-eval`](./docs/rules/no-implied-eval.md) | Disallow the use of `eval()`-like methods | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-invalid-this`](./docs/rules/no-invalid-this.md) | Disallow `this` keywords outside of classes or class-like objects | | | | -| [`@typescript-eslint/no-loop-func`](./docs/rules/no-loop-func.md) | Disallow function declarations that contain unsafe references inside loop statements | | | | -| [`@typescript-eslint/no-loss-of-precision`](./docs/rules/no-loss-of-precision.md) | Disallow literal numbers that lose precision | :white_check_mark: | | | -| [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallow magic numbers | | | | -| [`@typescript-eslint/no-redeclare`](./docs/rules/no-redeclare.md) | Disallow variable redeclaration | | | | -| [`@typescript-eslint/no-restricted-imports`](./docs/rules/no-restricted-imports.md) | Disallow specified modules when loaded by `import` | | | | -| [`@typescript-eslint/no-shadow`](./docs/rules/no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | -| [`@typescript-eslint/no-throw-literal`](./docs/rules/no-throw-literal.md) | Disallow throwing literals as exceptions | | | :thought_balloon: | -| [`@typescript-eslint/no-unused-expressions`](./docs/rules/no-unused-expressions.md) | Disallow unused expressions | | | | -| [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables | :white_check_mark: | | | -| [`@typescript-eslint/no-use-before-define`](./docs/rules/no-use-before-define.md) | Disallow the use of variables before they are defined | | | | -| [`@typescript-eslint/no-useless-constructor`](./docs/rules/no-useless-constructor.md) | Disallow unnecessary constructors | | | | -| [`@typescript-eslint/object-curly-spacing`](./docs/rules/object-curly-spacing.md) | Enforce consistent spacing inside braces | | :wrench: | | -| [`@typescript-eslint/padding-line-between-statements`](./docs/rules/padding-line-between-statements.md) | require or disallow padding lines between statements | | :wrench: | | -| [`@typescript-eslint/quotes`](./docs/rules/quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | -| [`@typescript-eslint/require-await`](./docs/rules/require-await.md) | Disallow async functions which have no `await` expression | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/return-await`](./docs/rules/return-await.md) | Enforces consistent returning of awaited values | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/semi`](./docs/rules/semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | -| [`@typescript-eslint/space-before-blocks`](./docs/rules/space-before-blocks.md) | Enforces consistent spacing before blocks | | :wrench: | | -| [`@typescript-eslint/space-before-function-paren`](./docs/rules/space-before-function-paren.md) | Enforces consistent spacing before function parenthesis | | :wrench: | | -| [`@typescript-eslint/space-infix-ops`](./docs/rules/space-infix-ops.md) | This rule is aimed at ensuring there are spaces around infix operators. | | :wrench: | | +**Key**: :white_check_mark: = recommended, :heavy_check_mark: = strict, :wrench: = fixable, :thought_balloon: = requires type information + +| Name | Description | :white_check_mark::heavy_check_mark: | :wrench: | :thought_balloon: | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------ | -------- | ----------------- | +| [`@typescript-eslint/brace-style`](./docs/rules/brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | +| [`@typescript-eslint/comma-dangle`](./docs/rules/comma-dangle.md) | Require or disallow trailing comma | | :wrench: | | +| [`@typescript-eslint/comma-spacing`](./docs/rules/comma-spacing.md) | Enforces consistent spacing before and after commas | | :wrench: | | +| [`@typescript-eslint/default-param-last`](./docs/rules/default-param-last.md) | Enforce default parameters to be last | | | | +| [`@typescript-eslint/dot-notation`](./docs/rules/dot-notation.md) | enforce dot notation whenever possible | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/func-call-spacing`](./docs/rules/func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | +| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | | :wrench: | | +| [`@typescript-eslint/init-declarations`](./docs/rules/init-declarations.md) | require or disallow initialization in variable declarations | | | | +| [`@typescript-eslint/keyword-spacing`](./docs/rules/keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | +| [`@typescript-eslint/lines-between-class-members`](./docs/rules/lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | +| [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-dupe-class-members`](./docs/rules/no-dupe-class-members.md) | Disallow duplicate class members | | | | +| [`@typescript-eslint/no-duplicate-imports`](./docs/rules/no-duplicate-imports.md) | Disallow duplicate imports | | | | +| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :white_check_mark: | | | +| [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | +| [`@typescript-eslint/no-extra-semi`](./docs/rules/no-extra-semi.md) | Disallow unnecessary semicolons | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-implied-eval`](./docs/rules/no-implied-eval.md) | Disallow the use of `eval()`-like methods | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-invalid-this`](./docs/rules/no-invalid-this.md) | Disallow `this` keywords outside of classes or class-like objects | | | | +| [`@typescript-eslint/no-loop-func`](./docs/rules/no-loop-func.md) | Disallow function declarations that contain unsafe references inside loop statements | | | | +| [`@typescript-eslint/no-loss-of-precision`](./docs/rules/no-loss-of-precision.md) | Disallow literal numbers that lose precision | :white_check_mark: | | | +| [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallow magic numbers | | | | +| [`@typescript-eslint/no-redeclare`](./docs/rules/no-redeclare.md) | Disallow variable redeclaration | | | | +| [`@typescript-eslint/no-restricted-imports`](./docs/rules/no-restricted-imports.md) | Disallow specified modules when loaded by `import` | | | | +| [`@typescript-eslint/no-shadow`](./docs/rules/no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | +| [`@typescript-eslint/no-throw-literal`](./docs/rules/no-throw-literal.md) | Disallow throwing literals as exceptions | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unused-expressions`](./docs/rules/no-unused-expressions.md) | Disallow unused expressions | | | | +| [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables | :white_check_mark: | | | +| [`@typescript-eslint/no-use-before-define`](./docs/rules/no-use-before-define.md) | Disallow the use of variables before they are defined | | | | +| [`@typescript-eslint/no-useless-constructor`](./docs/rules/no-useless-constructor.md) | Disallow unnecessary constructors | :heavy_check_mark: | | | +| [`@typescript-eslint/object-curly-spacing`](./docs/rules/object-curly-spacing.md) | Enforce consistent spacing inside braces | | :wrench: | | +| [`@typescript-eslint/padding-line-between-statements`](./docs/rules/padding-line-between-statements.md) | require or disallow padding lines between statements | | :wrench: | | +| [`@typescript-eslint/quotes`](./docs/rules/quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | +| [`@typescript-eslint/require-await`](./docs/rules/require-await.md) | Disallow async functions which have no `await` expression | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/return-await`](./docs/rules/return-await.md) | Enforces consistent returning of awaited values | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/semi`](./docs/rules/semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | +| [`@typescript-eslint/space-before-blocks`](./docs/rules/space-before-blocks.md) | Enforces consistent spacing before blocks | | :wrench: | | +| [`@typescript-eslint/space-before-function-paren`](./docs/rules/space-before-function-paren.md) | Enforces consistent spacing before function parenthesis | | :wrench: | | +| [`@typescript-eslint/space-infix-ops`](./docs/rules/space-infix-ops.md) | This rule is aimed at ensuring there are spaces around infix operators. | | :wrench: | | diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md index 3f54ec04637..890eaa4ac43 100644 --- a/packages/eslint-plugin/docs/rules/README.md +++ b/packages/eslint-plugin/docs/rules/README.md @@ -17,93 +17,95 @@ slug: / -**Key**: :white_check_mark: = recommended, :wrench: = fixable, :thought_balloon: = requires type information +**Key**: :white_check_mark: = recommended, :heavy_check_mark: = strict, :wrench: = fixable, :thought_balloon: = requires type information -| Name | Description | :white_check_mark: | :wrench: | :thought_balloon: | -| ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- | ------------------ | -------- | ----------------- | -| [`@typescript-eslint/adjacent-overload-signatures`](./adjacent-overload-signatures.md) | Require that member overloads be consecutive | :white_check_mark: | | | -| [`@typescript-eslint/array-type`](./array-type.md) | Requires using either `T[]` or `Array` for arrays | | :wrench: | | -| [`@typescript-eslint/await-thenable`](./await-thenable.md) | Disallows awaiting a value that is not a Thenable | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/ban-ts-comment`](./ban-ts-comment.md) | Bans `@ts-` comments from being used or requires descriptions after directive | :white_check_mark: | | | -| [`@typescript-eslint/ban-tslint-comment`](./ban-tslint-comment.md) | Bans `// tslint:` comments from being used | | :wrench: | | -| [`@typescript-eslint/ban-types`](./ban-types.md) | Bans specific types from being used | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/class-literal-property-style`](./class-literal-property-style.md) | Ensures that literals on classes are exposed in a consistent style | | :wrench: | | -| [`@typescript-eslint/consistent-indexed-object-style`](./consistent-indexed-object-style.md) | Enforce or disallow the use of the record type | | :wrench: | | -| [`@typescript-eslint/consistent-type-assertions`](./consistent-type-assertions.md) | Enforces consistent usage of type assertions | | | | -| [`@typescript-eslint/consistent-type-definitions`](./consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | | :wrench: | | -| [`@typescript-eslint/consistent-type-exports`](./consistent-type-exports.md) | Enforces consistent usage of type exports | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/consistent-type-imports`](./consistent-type-imports.md) | Enforces consistent usage of type imports | | :wrench: | | -| [`@typescript-eslint/explicit-function-return-type`](./explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | -| [`@typescript-eslint/explicit-member-accessibility`](./explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | -| [`@typescript-eslint/explicit-module-boundary-types`](./explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | -| [`@typescript-eslint/member-delimiter-style`](./member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | -| [`@typescript-eslint/member-ordering`](./member-ordering.md) | Require a consistent member declaration order | | | | -| [`@typescript-eslint/method-signature-style`](./method-signature-style.md) | Enforces using a particular method signature syntax. | | :wrench: | | -| [`@typescript-eslint/naming-convention`](./naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | -| [`@typescript-eslint/no-base-to-string`](./no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | | | :thought_balloon: | -| [`@typescript-eslint/no-confusing-non-null-assertion`](./no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | | :wrench: | | -| [`@typescript-eslint/no-confusing-void-expression`](./no-confusing-void-expression.md) | Requires expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-dynamic-delete`](./no-dynamic-delete.md) | Disallow the delete operator with computed key expressions | | :wrench: | | -| [`@typescript-eslint/no-empty-interface`](./no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-explicit-any`](./no-explicit-any.md) | Disallow usage of the `any` type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extra-non-null-assertion`](./no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extraneous-class`](./no-extraneous-class.md) | Forbids the use of classes as namespaces | | | | -| [`@typescript-eslint/no-floating-promises`](./no-floating-promises.md) | Requires Promise-like statements to be handled appropriately | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-for-in-array`](./no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-inferrable-types`](./no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-invalid-void-type`](./no-invalid-void-type.md) | Disallows usage of `void` type outside of generic or return types | | | | -| [`@typescript-eslint/no-meaningless-void-operator`](./no-meaningless-void-operator.md) | Disallow the `void` operator except when used to discard a value | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-misused-new`](./no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :white_check_mark: | | | -| [`@typescript-eslint/no-misused-promises`](./no-misused-promises.md) | Avoid using Promises in places not designed to handle them | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-namespace`](./no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./no-non-null-asserted-nullish-coalescing.md) | Disallows using a non-null assertion in the left operand of the nullish coalescing operator | | | | -| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./no-non-null-asserted-optional-chain.md) | Disallows using a non-null assertion after an optional chain expression | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-assertion`](./no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :white_check_mark: | | | -| [`@typescript-eslint/no-parameter-properties`](./no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | | -| [`@typescript-eslint/no-require-imports`](./no-require-imports.md) | Disallows invocation of `require()` | | | | -| [`@typescript-eslint/no-this-alias`](./no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | -| [`@typescript-eslint/no-type-alias`](./no-type-alias.md) | Disallow the use of type aliases | | | | -| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./no-unnecessary-boolean-literal-compare.md) | Flags unnecessary equality comparisons against boolean literals | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-condition`](./no-unnecessary-condition.md) | Prevents conditionals where the type is always truthy or always falsy | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-qualifier`](./no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-arguments`](./no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-assertion`](./no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-constraint`](./no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-unsafe-argument`](./no-unsafe-argument.md) | Disallows calling a function with an any type value | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-assignment`](./no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-call`](./no-unsafe-call.md) | Disallows calling an any type value | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-member-access`](./no-unsafe-member-access.md) | Disallows member access on any typed variables | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-return`](./no-unsafe-return.md) | Disallows returning any from a function | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-var-requires`](./no-var-requires.md) | Disallows the use of require statements except in import statements | :white_check_mark: | | | -| [`@typescript-eslint/non-nullable-type-assertion-style`](./non-nullable-type-assertion-style.md) | Prefers a non-null assertion over explicit type cast when possible | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-as-const`](./prefer-as-const.md) | Prefer usage of `as const` over literal type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-enum-initializers`](./prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | -| [`@typescript-eslint/prefer-for-of`](./prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | | | | -| [`@typescript-eslint/prefer-function-type`](./prefer-function-type.md) | Use function types instead of interfaces with call signatures | | :wrench: | | -| [`@typescript-eslint/prefer-includes`](./prefer-includes.md) | Enforce `includes` method over `indexOf` method | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-literal-enum-member`](./prefer-literal-enum-member.md) | Require that all enum members be literal values to prevent unintended enum member name shadow issues | | | | -| [`@typescript-eslint/prefer-namespace-keyword`](./prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-nullish-coalescing`](./prefer-nullish-coalescing.md) | Enforce the usage of the nullish coalescing operator instead of logical chaining | | | :thought_balloon: | -| [`@typescript-eslint/prefer-optional-chain`](./prefer-optional-chain.md) | Prefer using concise optional chain expressions instead of chained logical ands | | | | -| [`@typescript-eslint/prefer-readonly`](./prefer-readonly.md) | Requires that private members are marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-readonly-parameter-types`](./prefer-readonly-parameter-types.md) | Requires that function parameters are typed as readonly to prevent accidental mutation of inputs | | | :thought_balloon: | -| [`@typescript-eslint/prefer-reduce-type-parameter`](./prefer-reduce-type-parameter.md) | Prefer using type parameter when calling `Array#reduce` instead of casting | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-regexp-exec`](./prefer-regexp-exec.md) | Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-return-this-type`](./prefer-return-this-type.md) | Enforce that `this` is used when only `this` type is returned | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-string-starts-ends-with`](./prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-ts-expect-error`](./prefer-ts-expect-error.md) | Recommends using `@ts-expect-error` over `@ts-ignore` | | :wrench: | | -| [`@typescript-eslint/promise-function-async`](./promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/require-array-sort-compare`](./require-array-sort-compare.md) | Requires `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | -| [`@typescript-eslint/restrict-plus-operands`](./restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/restrict-template-expressions`](./restrict-template-expressions.md) | Enforce template literal expressions to be of string type | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/sort-type-union-intersection-members`](./sort-type-union-intersection-members.md) | Enforces that members of a type union/intersection are sorted alphabetically | | :wrench: | | -| [`@typescript-eslint/strict-boolean-expressions`](./strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/switch-exhaustiveness-check`](./switch-exhaustiveness-check.md) | Exhaustiveness checking in switch with union type | | | :thought_balloon: | -| [`@typescript-eslint/triple-slash-reference`](./triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :white_check_mark: | | | -| [`@typescript-eslint/type-annotation-spacing`](./type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | -| [`@typescript-eslint/typedef`](./typedef.md) | Requires type annotations to exist | | | | -| [`@typescript-eslint/unbound-method`](./unbound-method.md) | Enforces unbound methods are called with their expected scope | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/unified-signatures`](./unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | | | | +| Name | Description | :white_check_mark::heavy_check_mark: | :wrench: | :thought_balloon: | +| ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | -------- | ----------------- | +| [`@typescript-eslint/adjacent-overload-signatures`](./adjacent-overload-signatures.md) | Require that member overloads be consecutive | :white_check_mark: | | | +| [`@typescript-eslint/array-type`](./array-type.md) | Requires using either `T[]` or `Array` for arrays | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/await-thenable`](./await-thenable.md) | Disallows awaiting a value that is not a Thenable | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/ban-ts-comment`](./ban-ts-comment.md) | Bans `@ts-` comments from being used or requires descriptions after directive | :white_check_mark: | | | +| [`@typescript-eslint/ban-tslint-comment`](./ban-tslint-comment.md) | Bans `// tslint:` comments from being used | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/ban-types`](./ban-types.md) | Bans specific types from being used | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/class-literal-property-style`](./class-literal-property-style.md) | Ensures that literals on classes are exposed in a consistent style | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/consistent-indexed-object-style`](./consistent-indexed-object-style.md) | Enforce or disallow the use of the record type | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/consistent-type-assertions`](./consistent-type-assertions.md) | Enforces consistent usage of type assertions | :heavy_check_mark: | | | +| [`@typescript-eslint/consistent-type-definitions`](./consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/consistent-type-exports`](./consistent-type-exports.md) | Enforces consistent usage of type exports | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/consistent-type-imports`](./consistent-type-imports.md) | Enforces consistent usage of type imports | | :wrench: | | +| [`@typescript-eslint/explicit-function-return-type`](./explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | +| [`@typescript-eslint/explicit-member-accessibility`](./explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | +| [`@typescript-eslint/explicit-module-boundary-types`](./explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | +| [`@typescript-eslint/member-delimiter-style`](./member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | +| [`@typescript-eslint/member-ordering`](./member-ordering.md) | Require a consistent member declaration order | | | | +| [`@typescript-eslint/method-signature-style`](./method-signature-style.md) | Enforces using a particular method signature syntax. | | :wrench: | | +| [`@typescript-eslint/naming-convention`](./naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | +| [`@typescript-eslint/no-base-to-string`](./no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-confusing-non-null-assertion`](./no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-confusing-void-expression`](./no-confusing-void-expression.md) | Requires expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-dynamic-delete`](./no-dynamic-delete.md) | Disallow the delete operator with computed key expressions | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-empty-interface`](./no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-explicit-any`](./no-explicit-any.md) | Disallow usage of the `any` type | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-extra-non-null-assertion`](./no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-extraneous-class`](./no-extraneous-class.md) | Forbids the use of classes as namespaces | :heavy_check_mark: | | | +| [`@typescript-eslint/no-floating-promises`](./no-floating-promises.md) | Requires Promise-like statements to be handled appropriately | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-for-in-array`](./no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-inferrable-types`](./no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-invalid-void-type`](./no-invalid-void-type.md) | Disallows usage of `void` type outside of generic or return types | :heavy_check_mark: | | | +| [`@typescript-eslint/no-meaningless-void-operator`](./no-meaningless-void-operator.md) | Disallow the `void` operator except when used to discard a value | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-misused-new`](./no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :white_check_mark: | | | +| [`@typescript-eslint/no-misused-promises`](./no-misused-promises.md) | Avoid using Promises in places not designed to handle them | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-namespace`](./no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :white_check_mark: | | | +| [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./no-non-null-asserted-nullish-coalescing.md) | Disallows using a non-null assertion in the left operand of the nullish coalescing operator | :heavy_check_mark: | | | +| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./no-non-null-asserted-optional-chain.md) | Disallows using a non-null assertion after an optional chain expression | :white_check_mark: | | | +| [`@typescript-eslint/no-non-null-assertion`](./no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :white_check_mark: | | | +| [`@typescript-eslint/no-parameter-properties`](./no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | | +| [`@typescript-eslint/no-redundant-type-constituents`](./no-redundant-type-constituents.md) | Disallow members of unions and intersections that do nothing or override type information | | | :thought_balloon: | +| [`@typescript-eslint/no-require-imports`](./no-require-imports.md) | Disallows invocation of `require()` | | | | +| [`@typescript-eslint/no-this-alias`](./no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | +| [`@typescript-eslint/no-type-alias`](./no-type-alias.md) | Disallow the use of type aliases | | | | +| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./no-unnecessary-boolean-literal-compare.md) | Flags unnecessary equality comparisons against boolean literals | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-condition`](./no-unnecessary-condition.md) | Prevents conditionals where the type is always truthy or always falsy | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-qualifier`](./no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-arguments`](./no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-assertion`](./no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-constraint`](./no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-unsafe-argument`](./no-unsafe-argument.md) | Disallows calling a function with an any type value | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-assignment`](./no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-call`](./no-unsafe-call.md) | Disallows calling an any type value | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-member-access`](./no-unsafe-member-access.md) | Disallows member access on any typed variables | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-return`](./no-unsafe-return.md) | Disallows returning any from a function | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-useless-empty-export`](./no-useless-empty-export.md) | Disallow empty exports that don't change anything in a module file | | :wrench: | | +| [`@typescript-eslint/no-var-requires`](./no-var-requires.md) | Disallows the use of require statements except in import statements | :white_check_mark: | | | +| [`@typescript-eslint/non-nullable-type-assertion-style`](./non-nullable-type-assertion-style.md) | Prefers a non-null assertion over explicit type cast when possible | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-as-const`](./prefer-as-const.md) | Prefer usage of `as const` over literal type | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-enum-initializers`](./prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | +| [`@typescript-eslint/prefer-for-of`](./prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | :heavy_check_mark: | | | +| [`@typescript-eslint/prefer-function-type`](./prefer-function-type.md) | Use function types instead of interfaces with call signatures | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-includes`](./prefer-includes.md) | Enforce `includes` method over `indexOf` method | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-literal-enum-member`](./prefer-literal-enum-member.md) | Require that all enum members be literal values to prevent unintended enum member name shadow issues | :heavy_check_mark: | | | +| [`@typescript-eslint/prefer-namespace-keyword`](./prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-nullish-coalescing`](./prefer-nullish-coalescing.md) | Enforce the usage of the nullish coalescing operator instead of logical chaining | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/prefer-optional-chain`](./prefer-optional-chain.md) | Prefer using concise optional chain expressions instead of chained logical ands | :heavy_check_mark: | | | +| [`@typescript-eslint/prefer-readonly`](./prefer-readonly.md) | Requires that private members are marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-readonly-parameter-types`](./prefer-readonly-parameter-types.md) | Requires that function parameters are typed as readonly to prevent accidental mutation of inputs | | | :thought_balloon: | +| [`@typescript-eslint/prefer-reduce-type-parameter`](./prefer-reduce-type-parameter.md) | Prefer using type parameter when calling `Array#reduce` instead of casting | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-regexp-exec`](./prefer-regexp-exec.md) | Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-return-this-type`](./prefer-return-this-type.md) | Enforce that `this` is used when only `this` type is returned | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-string-starts-ends-with`](./prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-ts-expect-error`](./prefer-ts-expect-error.md) | Recommends using `@ts-expect-error` over `@ts-ignore` | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/promise-function-async`](./promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/require-array-sort-compare`](./require-array-sort-compare.md) | Requires `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | +| [`@typescript-eslint/restrict-plus-operands`](./restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/restrict-template-expressions`](./restrict-template-expressions.md) | Enforce template literal expressions to be of string type | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/sort-type-union-intersection-members`](./sort-type-union-intersection-members.md) | Enforces that members of a type union/intersection are sorted alphabetically | | :wrench: | | +| [`@typescript-eslint/strict-boolean-expressions`](./strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/switch-exhaustiveness-check`](./switch-exhaustiveness-check.md) | Exhaustiveness checking in switch with union type | | | :thought_balloon: | +| [`@typescript-eslint/triple-slash-reference`](./triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :white_check_mark: | | | +| [`@typescript-eslint/type-annotation-spacing`](./type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | +| [`@typescript-eslint/typedef`](./typedef.md) | Requires type annotations to exist | | | | +| [`@typescript-eslint/unbound-method`](./unbound-method.md) | Enforces unbound methods are called with their expected scope | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/unified-signatures`](./unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | :heavy_check_mark: | | | @@ -114,46 +116,47 @@ In these cases, we create what we call an extension rule; a rule within our plug -**Key**: :white_check_mark: = recommended, :wrench: = fixable, :thought_balloon: = requires type information +**Key**: :white_check_mark: = recommended, :heavy_check_mark: = strict, :wrench: = fixable, :thought_balloon: = requires type information -| Name | Description | :white_check_mark: | :wrench: | :thought_balloon: | -| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------ | -------- | ----------------- | -| [`@typescript-eslint/brace-style`](./brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | -| [`@typescript-eslint/comma-dangle`](./comma-dangle.md) | Require or disallow trailing comma | | :wrench: | | -| [`@typescript-eslint/comma-spacing`](./comma-spacing.md) | Enforces consistent spacing before and after commas | | :wrench: | | -| [`@typescript-eslint/default-param-last`](./default-param-last.md) | Enforce default parameters to be last | | | | -| [`@typescript-eslint/dot-notation`](./dot-notation.md) | enforce dot notation whenever possible | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/func-call-spacing`](./func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | -| [`@typescript-eslint/indent`](./indent.md) | Enforce consistent indentation | | :wrench: | | -| [`@typescript-eslint/init-declarations`](./init-declarations.md) | require or disallow initialization in variable declarations | | | | -| [`@typescript-eslint/keyword-spacing`](./keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | -| [`@typescript-eslint/lines-between-class-members`](./lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | -| [`@typescript-eslint/no-array-constructor`](./no-array-constructor.md) | Disallow generic `Array` constructors | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-dupe-class-members`](./no-dupe-class-members.md) | Disallow duplicate class members | | | | -| [`@typescript-eslint/no-duplicate-imports`](./no-duplicate-imports.md) | Disallow duplicate imports | | | | -| [`@typescript-eslint/no-empty-function`](./no-empty-function.md) | Disallow empty functions | :white_check_mark: | | | -| [`@typescript-eslint/no-extra-parens`](./no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | -| [`@typescript-eslint/no-extra-semi`](./no-extra-semi.md) | Disallow unnecessary semicolons | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-implied-eval`](./no-implied-eval.md) | Disallow the use of `eval()`-like methods | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-invalid-this`](./no-invalid-this.md) | Disallow `this` keywords outside of classes or class-like objects | | | | -| [`@typescript-eslint/no-loop-func`](./no-loop-func.md) | Disallow function declarations that contain unsafe references inside loop statements | | | | -| [`@typescript-eslint/no-loss-of-precision`](./no-loss-of-precision.md) | Disallow literal numbers that lose precision | :white_check_mark: | | | -| [`@typescript-eslint/no-magic-numbers`](./no-magic-numbers.md) | Disallow magic numbers | | | | -| [`@typescript-eslint/no-redeclare`](./no-redeclare.md) | Disallow variable redeclaration | | | | -| [`@typescript-eslint/no-restricted-imports`](./no-restricted-imports.md) | Disallow specified modules when loaded by `import` | | | | -| [`@typescript-eslint/no-shadow`](./no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | -| [`@typescript-eslint/no-throw-literal`](./no-throw-literal.md) | Disallow throwing literals as exceptions | | | :thought_balloon: | -| [`@typescript-eslint/no-unused-expressions`](./no-unused-expressions.md) | Disallow unused expressions | | | | -| [`@typescript-eslint/no-unused-vars`](./no-unused-vars.md) | Disallow unused variables | :white_check_mark: | | | -| [`@typescript-eslint/no-use-before-define`](./no-use-before-define.md) | Disallow the use of variables before they are defined | | | | -| [`@typescript-eslint/no-useless-constructor`](./no-useless-constructor.md) | Disallow unnecessary constructors | | | | -| [`@typescript-eslint/object-curly-spacing`](./object-curly-spacing.md) | Enforce consistent spacing inside braces | | :wrench: | | -| [`@typescript-eslint/padding-line-between-statements`](./padding-line-between-statements.md) | require or disallow padding lines between statements | | :wrench: | | -| [`@typescript-eslint/quotes`](./quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | -| [`@typescript-eslint/require-await`](./require-await.md) | Disallow async functions which have no `await` expression | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/return-await`](./return-await.md) | Enforces consistent returning of awaited values | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/semi`](./semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | -| [`@typescript-eslint/space-before-function-paren`](./space-before-function-paren.md) | Enforces consistent spacing before function parenthesis | | :wrench: | | -| [`@typescript-eslint/space-infix-ops`](./space-infix-ops.md) | This rule is aimed at ensuring there are spaces around infix operators. | | :wrench: | | +| Name | Description | :white_check_mark::heavy_check_mark: | :wrench: | :thought_balloon: | +| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------ | -------- | ----------------- | +| [`@typescript-eslint/brace-style`](./brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | +| [`@typescript-eslint/comma-dangle`](./comma-dangle.md) | Require or disallow trailing comma | | :wrench: | | +| [`@typescript-eslint/comma-spacing`](./comma-spacing.md) | Enforces consistent spacing before and after commas | | :wrench: | | +| [`@typescript-eslint/default-param-last`](./default-param-last.md) | Enforce default parameters to be last | | | | +| [`@typescript-eslint/dot-notation`](./dot-notation.md) | enforce dot notation whenever possible | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/func-call-spacing`](./func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | +| [`@typescript-eslint/indent`](./indent.md) | Enforce consistent indentation | | :wrench: | | +| [`@typescript-eslint/init-declarations`](./init-declarations.md) | require or disallow initialization in variable declarations | | | | +| [`@typescript-eslint/keyword-spacing`](./keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | +| [`@typescript-eslint/lines-between-class-members`](./lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | +| [`@typescript-eslint/no-array-constructor`](./no-array-constructor.md) | Disallow generic `Array` constructors | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-dupe-class-members`](./no-dupe-class-members.md) | Disallow duplicate class members | | | | +| [`@typescript-eslint/no-duplicate-imports`](./no-duplicate-imports.md) | Disallow duplicate imports | | | | +| [`@typescript-eslint/no-empty-function`](./no-empty-function.md) | Disallow empty functions | :white_check_mark: | | | +| [`@typescript-eslint/no-extra-parens`](./no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | +| [`@typescript-eslint/no-extra-semi`](./no-extra-semi.md) | Disallow unnecessary semicolons | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-implied-eval`](./no-implied-eval.md) | Disallow the use of `eval()`-like methods | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-invalid-this`](./no-invalid-this.md) | Disallow `this` keywords outside of classes or class-like objects | | | | +| [`@typescript-eslint/no-loop-func`](./no-loop-func.md) | Disallow function declarations that contain unsafe references inside loop statements | | | | +| [`@typescript-eslint/no-loss-of-precision`](./no-loss-of-precision.md) | Disallow literal numbers that lose precision | :white_check_mark: | | | +| [`@typescript-eslint/no-magic-numbers`](./no-magic-numbers.md) | Disallow magic numbers | | | | +| [`@typescript-eslint/no-redeclare`](./no-redeclare.md) | Disallow variable redeclaration | | | | +| [`@typescript-eslint/no-restricted-imports`](./no-restricted-imports.md) | Disallow specified modules when loaded by `import` | | | | +| [`@typescript-eslint/no-shadow`](./no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | +| [`@typescript-eslint/no-throw-literal`](./no-throw-literal.md) | Disallow throwing literals as exceptions | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unused-expressions`](./no-unused-expressions.md) | Disallow unused expressions | | | | +| [`@typescript-eslint/no-unused-vars`](./no-unused-vars.md) | Disallow unused variables | :white_check_mark: | | | +| [`@typescript-eslint/no-use-before-define`](./no-use-before-define.md) | Disallow the use of variables before they are defined | | | | +| [`@typescript-eslint/no-useless-constructor`](./no-useless-constructor.md) | Disallow unnecessary constructors | :heavy_check_mark: | | | +| [`@typescript-eslint/object-curly-spacing`](./object-curly-spacing.md) | Enforce consistent spacing inside braces | | :wrench: | | +| [`@typescript-eslint/padding-line-between-statements`](./padding-line-between-statements.md) | require or disallow padding lines between statements | | :wrench: | | +| [`@typescript-eslint/quotes`](./quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | +| [`@typescript-eslint/require-await`](./require-await.md) | Disallow async functions which have no `await` expression | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/return-await`](./return-await.md) | Enforces consistent returning of awaited values | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/semi`](./semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | +| [`@typescript-eslint/space-before-blocks`](./space-before-blocks.md) | Enforces consistent spacing before blocks | | :wrench: | | +| [`@typescript-eslint/space-before-function-paren`](./space-before-function-paren.md) | Enforces consistent spacing before function parenthesis | | :wrench: | | +| [`@typescript-eslint/space-infix-ops`](./space-infix-ops.md) | This rule is aimed at ensuring there are spaces around infix operators. | | :wrench: | | diff --git a/packages/eslint-plugin/docs/rules/TEMPLATE.md b/packages/eslint-plugin/docs/rules/TEMPLATE.md index 174fb71c6b3..4b56a5c9be0 100644 --- a/packages/eslint-plugin/docs/rules/TEMPLATE.md +++ b/packages/eslint-plugin/docs/rules/TEMPLATE.md @@ -22,6 +22,8 @@ To fill out: tell us more about this rule. ## Options +This rule is not configurable. + ```jsonc // .eslintrc.json { @@ -53,5 +55,6 @@ For example if this rule requires a feature released in a certain TS version. ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md b/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md index 58f9d77e393..a556620c2d7 100644 --- a/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md +++ b/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md @@ -108,5 +108,6 @@ If you don't care about the general structure of the code, then you will not nee ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/array-type.md b/packages/eslint-plugin/docs/rules/array-type.md index 9e5780fda39..ac049939020 100644 --- a/packages/eslint-plugin/docs/rules/array-type.md +++ b/packages/eslint-plugin/docs/rules/array-type.md @@ -126,5 +126,6 @@ This matrix lists all possible option combinations and their expected results fo ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/await-thenable.md b/packages/eslint-plugin/docs/rules/await-thenable.md index 0cb5c2a1b74..e759c7f258d 100644 --- a/packages/eslint-plugin/docs/rules/await-thenable.md +++ b/packages/eslint-plugin/docs/rules/await-thenable.md @@ -54,5 +54,6 @@ This is generally not preferred, but can sometimes be useful for visual consiste ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/ban-ts-comment.md b/packages/eslint-plugin/docs/rules/ban-ts-comment.md index ee5e86113f0..11b29eba69a 100644 --- a/packages/eslint-plugin/docs/rules/ban-ts-comment.md +++ b/packages/eslint-plugin/docs/rules/ban-ts-comment.md @@ -146,5 +146,6 @@ If you want to use all of the TypeScript directives. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/ban-tslint-comment.md b/packages/eslint-plugin/docs/rules/ban-tslint-comment.md index 95f9ab87543..f9dd6a9d113 100644 --- a/packages/eslint-plugin/docs/rules/ban-tslint-comment.md +++ b/packages/eslint-plugin/docs/rules/ban-tslint-comment.md @@ -30,6 +30,19 @@ someCode(); // tslint:disable-line someCode(); // This is a comment that just happens to mention tslint ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/ban-tslint-comment": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It If you are still using TSLint. @@ -37,5 +50,6 @@ If you are still using TSLint. ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/ban-types.md b/packages/eslint-plugin/docs/rules/ban-types.md index 0a16559e96f..532ee77c405 100644 --- a/packages/eslint-plugin/docs/rules/ban-types.md +++ b/packages/eslint-plugin/docs/rules/ban-types.md @@ -190,5 +190,6 @@ const curly2: Record<'a', string> = { a: 'string' }; ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/brace-style.md b/packages/eslint-plugin/docs/rules/brace-style.md index 83316fa631f..6272851f228 100644 --- a/packages/eslint-plugin/docs/rules/brace-style.md +++ b/packages/eslint-plugin/docs/rules/brace-style.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/class-literal-property-style.md b/packages/eslint-plugin/docs/rules/class-literal-property-style.md index 649a640cc73..2dc9810a2e2 100644 --- a/packages/eslint-plugin/docs/rules/class-literal-property-style.md +++ b/packages/eslint-plugin/docs/rules/class-literal-property-style.md @@ -112,5 +112,6 @@ for how literal values are exposed by your classes. ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/comma-dangle.md b/packages/eslint-plugin/docs/rules/comma-dangle.md index 0605e485438..57320880adc 100644 --- a/packages/eslint-plugin/docs/rules/comma-dangle.md +++ b/packages/eslint-plugin/docs/rules/comma-dangle.md @@ -42,5 +42,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/comma-spacing.md b/packages/eslint-plugin/docs/rules/comma-spacing.md index 2cc5a68694b..626bb25d7cd 100644 --- a/packages/eslint-plugin/docs/rules/comma-spacing.md +++ b/packages/eslint-plugin/docs/rules/comma-spacing.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md b/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md index ae44a024889..01c1a6ed4a7 100644 --- a/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md +++ b/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md @@ -86,5 +86,6 @@ type Foo = { ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-type-assertions.md b/packages/eslint-plugin/docs/rules/consistent-type-assertions.md index cb56c5d8a24..65433ebdf3c 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-assertions.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-assertions.md @@ -120,5 +120,6 @@ If you do not want to enforce consistent type assertions. ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-type-definitions.md b/packages/eslint-plugin/docs/rules/consistent-type-definitions.md index 19f8d0df3d3..f6f48528649 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-definitions.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-definitions.md @@ -88,5 +88,6 @@ If you specifically want to use an interface or type literal for stylistic reaso ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 9145d83d29f..073cadf8565 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -83,5 +83,6 @@ export { Button, type ButtonProps } from 'some-library'; ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-type-imports.md b/packages/eslint-plugin/docs/rules/consistent-type-imports.md index 154fe0a6252..f6c86856ca6 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-imports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-imports.md @@ -68,5 +68,6 @@ const x: import('Bar') = 1; ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/default-param-last.md b/packages/eslint-plugin/docs/rules/default-param-last.md index ec8377ecb88..2419f898bd6 100644 --- a/packages/eslint-plugin/docs/rules/default-param-last.md +++ b/packages/eslint-plugin/docs/rules/default-param-last.md @@ -66,5 +66,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/dot-notation.md b/packages/eslint-plugin/docs/rules/dot-notation.md index 85a8fff08df..76ec121b27c 100644 --- a/packages/eslint-plugin/docs/rules/dot-notation.md +++ b/packages/eslint-plugin/docs/rules/dot-notation.md @@ -91,5 +91,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md index a542f328fb6..c4faa3c34e3 100644 --- a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md +++ b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md @@ -294,5 +294,6 @@ you will not need this rule. ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md index e60af94265a..7223d1d1022 100644 --- a/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md +++ b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md @@ -352,5 +352,6 @@ If you think defaulting to public is a good default, then you should consider us ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md index 038fb8b33ea..5fbe3bd3bb2 100644 --- a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md +++ b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md @@ -289,5 +289,6 @@ If you wish to make sure all functions have explicit return types, as opposed to ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/func-call-spacing.md b/packages/eslint-plugin/docs/rules/func-call-spacing.md index cb96cd5d7c0..f703eaeb9de 100644 --- a/packages/eslint-plugin/docs/rules/func-call-spacing.md +++ b/packages/eslint-plugin/docs/rules/func-call-spacing.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/indent.md b/packages/eslint-plugin/docs/rules/indent.md index 2a8920398d3..6234e874b2b 100644 --- a/packages/eslint-plugin/docs/rules/indent.md +++ b/packages/eslint-plugin/docs/rules/indent.md @@ -34,5 +34,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/init-declarations.md b/packages/eslint-plugin/docs/rules/init-declarations.md index 5df410a8dc5..6393233f204 100644 --- a/packages/eslint-plugin/docs/rules/init-declarations.md +++ b/packages/eslint-plugin/docs/rules/init-declarations.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/keyword-spacing.md b/packages/eslint-plugin/docs/rules/keyword-spacing.md index d2682f17abd..29a03480b89 100644 --- a/packages/eslint-plugin/docs/rules/keyword-spacing.md +++ b/packages/eslint-plugin/docs/rules/keyword-spacing.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/lines-between-class-members.md b/packages/eslint-plugin/docs/rules/lines-between-class-members.md index 8d4a8ce767d..1a3fd76886e 100644 --- a/packages/eslint-plugin/docs/rules/lines-between-class-members.md +++ b/packages/eslint-plugin/docs/rules/lines-between-class-members.md @@ -81,5 +81,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/member-delimiter-style.md b/packages/eslint-plugin/docs/rules/member-delimiter-style.md index 1ad60abbdee..f3848c0b960 100644 --- a/packages/eslint-plugin/docs/rules/member-delimiter-style.md +++ b/packages/eslint-plugin/docs/rules/member-delimiter-style.md @@ -212,5 +212,6 @@ If you don't care about enforcing a consistent member delimiter in interfaces an ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/member-ordering.md b/packages/eslint-plugin/docs/rules/member-ordering.md index ab54967aa3a..e83fc47ef66 100644 --- a/packages/eslint-plugin/docs/rules/member-ordering.md +++ b/packages/eslint-plugin/docs/rules/member-ordering.md @@ -1116,5 +1116,6 @@ If you don't care about the general structure of your classes and interfaces, th ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/method-signature-style.md b/packages/eslint-plugin/docs/rules/method-signature-style.md index 9c55c470902..350781b2324 100644 --- a/packages/eslint-plugin/docs/rules/method-signature-style.md +++ b/packages/eslint-plugin/docs/rules/method-signature-style.md @@ -108,5 +108,6 @@ If you don't want to enforce a particular style for object/interface function ty ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/naming-convention.md b/packages/eslint-plugin/docs/rules/naming-convention.md index 9268e8a9d02..7994198257d 100644 --- a/packages/eslint-plugin/docs/rules/naming-convention.md +++ b/packages/eslint-plugin/docs/rules/naming-convention.md @@ -704,5 +704,6 @@ If you do not want to enforce naming conventions for anything. ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-array-constructor.md b/packages/eslint-plugin/docs/rules/no-array-constructor.md index e3fbaadbf18..10d40c1ff4d 100644 --- a/packages/eslint-plugin/docs/rules/no-array-constructor.md +++ b/packages/eslint-plugin/docs/rules/no-array-constructor.md @@ -53,5 +53,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-base-to-string.md b/packages/eslint-plugin/docs/rules/no-base-to-string.md index 5db6218bb52..92b6611b2ce 100644 --- a/packages/eslint-plugin/docs/rules/no-base-to-string.md +++ b/packages/eslint-plugin/docs/rules/no-base-to-string.md @@ -93,5 +93,6 @@ If you don't mind `"[object Object]"` in your strings, then you will not need th ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md b/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md index ed894aa8eb3..c4fe0e8b354 100644 --- a/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md @@ -41,6 +41,19 @@ const isEqualsBar = foo.bar == 'hello'; const isEqualsNum = (1 + foo.num!) == 2; ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/no-confusing-non-null-assertion": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It If you don't care about this confusion, then you will not need this rule. @@ -52,5 +65,6 @@ If you don't care about this confusion, then you will not need this rule. ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md b/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md index c2af300e0b6..8a6e790f6b9 100644 --- a/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md +++ b/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md @@ -155,5 +155,6 @@ Also, if you prefer concise coding style then also don't use it. ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-dupe-class-members.md b/packages/eslint-plugin/docs/rules/no-dupe-class-members.md index 7d59aec0683..887b844a5a1 100644 --- a/packages/eslint-plugin/docs/rules/no-dupe-class-members.md +++ b/packages/eslint-plugin/docs/rules/no-dupe-class-members.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-duplicate-imports.md b/packages/eslint-plugin/docs/rules/no-duplicate-imports.md index f6d1fc5eb42..b2b01acbe80 100644 --- a/packages/eslint-plugin/docs/rules/no-duplicate-imports.md +++ b/packages/eslint-plugin/docs/rules/no-duplicate-imports.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-dynamic-delete.md b/packages/eslint-plugin/docs/rules/no-dynamic-delete.md index c5349d51983..e35ed789dbd 100644 --- a/packages/eslint-plugin/docs/rules/no-dynamic-delete.md +++ b/packages/eslint-plugin/docs/rules/no-dynamic-delete.md @@ -40,6 +40,19 @@ delete container[7]; delete container['-Infinity']; ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/no-dynamic-delete": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It When you know your keys are safe to delete, this rule can be unnecessary. @@ -55,5 +68,6 @@ Even repeated minor performance slowdowns likely do not significantly affect you ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-empty-function.md b/packages/eslint-plugin/docs/rules/no-empty-function.md index db450a46121..e4ae9dca913 100644 --- a/packages/eslint-plugin/docs/rules/no-empty-function.md +++ b/packages/eslint-plugin/docs/rules/no-empty-function.md @@ -96,5 +96,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-empty-interface.md b/packages/eslint-plugin/docs/rules/no-empty-interface.md index b2db028106f..ca5388291cb 100644 --- a/packages/eslint-plugin/docs/rules/no-empty-interface.md +++ b/packages/eslint-plugin/docs/rules/no-empty-interface.md @@ -72,5 +72,6 @@ If you don't care about having empty/meaningless interfaces, then you will not n ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-explicit-any.md b/packages/eslint-plugin/docs/rules/no-explicit-any.md index 222c08c5123..5d276e11ee9 100644 --- a/packages/eslint-plugin/docs/rules/no-explicit-any.md +++ b/packages/eslint-plugin/docs/rules/no-explicit-any.md @@ -187,5 +187,6 @@ and you want to be able to specify `any`. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md b/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md index 6e19e8b0dd7..889454c25f5 100644 --- a/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md @@ -62,5 +62,6 @@ This rule is not configurable. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-extra-parens.md b/packages/eslint-plugin/docs/rules/no-extra-parens.md index 287918a2b44..d7bc6b209d2 100644 --- a/packages/eslint-plugin/docs/rules/no-extra-parens.md +++ b/packages/eslint-plugin/docs/rules/no-extra-parens.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-extra-semi.md b/packages/eslint-plugin/docs/rules/no-extra-semi.md index 2ca8c2f14bc..d61999e4672 100644 --- a/packages/eslint-plugin/docs/rules/no-extra-semi.md +++ b/packages/eslint-plugin/docs/rules/no-extra-semi.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-extraneous-class.md b/packages/eslint-plugin/docs/rules/no-extraneous-class.md index 470da5c607d..cfbb6b218df 100644 --- a/packages/eslint-plugin/docs/rules/no-extraneous-class.md +++ b/packages/eslint-plugin/docs/rules/no-extraneous-class.md @@ -88,5 +88,6 @@ team or if you use classes as namespaces. ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-floating-promises.md b/packages/eslint-plugin/docs/rules/no-floating-promises.md index 34c855fdcd7..aacaca9f900 100644 --- a/packages/eslint-plugin/docs/rules/no-floating-promises.md +++ b/packages/eslint-plugin/docs/rules/no-floating-promises.md @@ -123,5 +123,6 @@ If you do not use Promise-like values in your codebase, or want to allow them to ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-for-in-array.md b/packages/eslint-plugin/docs/rules/no-for-in-array.md index d21ab4e6081..62abb6eaced 100644 --- a/packages/eslint-plugin/docs/rules/no-for-in-array.md +++ b/packages/eslint-plugin/docs/rules/no-for-in-array.md @@ -65,5 +65,6 @@ If you want to iterate through a loop using the indices in an array as strings, ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md b/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md index d17e53209c8..c45b0e8de66 100644 --- a/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md +++ b/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md @@ -84,5 +84,6 @@ If you are not using TypeScript 4.0 (or greater), then you will not be able to u ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-implied-eval.md b/packages/eslint-plugin/docs/rules/no-implied-eval.md index fe0bc5a79df..2266f95b2a9 100644 --- a/packages/eslint-plugin/docs/rules/no-implied-eval.md +++ b/packages/eslint-plugin/docs/rules/no-implied-eval.md @@ -117,5 +117,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-inferrable-types.md b/packages/eslint-plugin/docs/rules/no-inferrable-types.md index 473676bac0e..7203888046e 100644 --- a/packages/eslint-plugin/docs/rules/no-inferrable-types.md +++ b/packages/eslint-plugin/docs/rules/no-inferrable-types.md @@ -156,5 +156,6 @@ TSLint: [no-inferrable-types](https://palantir.github.io/tslint/rules/no-inferra ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-invalid-this.md b/packages/eslint-plugin/docs/rules/no-invalid-this.md index a8a3256b8e3..5d097f19919 100644 --- a/packages/eslint-plugin/docs/rules/no-invalid-this.md +++ b/packages/eslint-plugin/docs/rules/no-invalid-this.md @@ -34,5 +34,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-invalid-void-type.md b/packages/eslint-plugin/docs/rules/no-invalid-void-type.md index 3771f572b10..9c8b23bb4bf 100644 --- a/packages/eslint-plugin/docs/rules/no-invalid-void-type.md +++ b/packages/eslint-plugin/docs/rules/no-invalid-void-type.md @@ -134,5 +134,6 @@ or in invalid places, then you don't need this rule. ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-loop-func.md b/packages/eslint-plugin/docs/rules/no-loop-func.md index e69a0d7b0a1..c2e7833ec50 100644 --- a/packages/eslint-plugin/docs/rules/no-loop-func.md +++ b/packages/eslint-plugin/docs/rules/no-loop-func.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-loss-of-precision.md b/packages/eslint-plugin/docs/rules/no-loss-of-precision.md index 7165f945b07..d000da4868e 100644 --- a/packages/eslint-plugin/docs/rules/no-loss-of-precision.md +++ b/packages/eslint-plugin/docs/rules/no-loss-of-precision.md @@ -27,5 +27,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-magic-numbers.md b/packages/eslint-plugin/docs/rules/no-magic-numbers.md index b67aeae6788..85033b3d144 100644 --- a/packages/eslint-plugin/docs/rules/no-magic-numbers.md +++ b/packages/eslint-plugin/docs/rules/no-magic-numbers.md @@ -127,5 +127,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md b/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md index 79e43d04ce5..633134aceee 100644 --- a/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md +++ b/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md @@ -58,5 +58,6 @@ This rule accepts a single object option with the following default configuratio ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-misused-new.md b/packages/eslint-plugin/docs/rules/no-misused-new.md index e56ff23012a..fe3eb2c5ce9 100644 --- a/packages/eslint-plugin/docs/rules/no-misused-new.md +++ b/packages/eslint-plugin/docs/rules/no-misused-new.md @@ -54,5 +54,6 @@ This rule is not configurable. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-misused-promises.md b/packages/eslint-plugin/docs/rules/no-misused-promises.md index 09292aa31b7..244d94cb77b 100644 --- a/packages/eslint-plugin/docs/rules/no-misused-promises.md +++ b/packages/eslint-plugin/docs/rules/no-misused-promises.md @@ -228,5 +228,6 @@ misuses of them outside of what the TypeScript compiler will check. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-namespace.md b/packages/eslint-plugin/docs/rules/no-namespace.md index bee784373ac..dda9b58cc81 100644 --- a/packages/eslint-plugin/docs/rules/no-namespace.md +++ b/packages/eslint-plugin/docs/rules/no-namespace.md @@ -139,5 +139,6 @@ If you are using the ES2015 module syntax, then you will not need this rule. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md b/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md index fd4b524b8cb..a759e4c039b 100644 --- a/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +++ b/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md @@ -45,6 +45,19 @@ let x: string; x! ?? ''; ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It If you are not using TypeScript 3.7 (or greater), then you will not need to use this rule, as the nullish coalescing operator is not supported. @@ -57,5 +70,6 @@ If you are not using TypeScript 3.7 (or greater), then you will not need to use ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md b/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md index 196f709bab8..5a0f91d92f2 100644 --- a/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +++ b/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md @@ -69,5 +69,6 @@ If you are not using TypeScript 3.7 (or greater), then you will not need to use ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-non-null-assertion.md b/packages/eslint-plugin/docs/rules/no-non-null-assertion.md index cc3f5a13814..2a098c69ba3 100644 --- a/packages/eslint-plugin/docs/rules/no-non-null-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-non-null-assertion.md @@ -56,5 +56,6 @@ If you don't care about strict null-checking, then you will not need this rule. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-parameter-properties.md b/packages/eslint-plugin/docs/rules/no-parameter-properties.md index e915acb1403..832df89fee7 100644 --- a/packages/eslint-plugin/docs/rules/no-parameter-properties.md +++ b/packages/eslint-plugin/docs/rules/no-parameter-properties.md @@ -403,5 +403,6 @@ If you don't care about the using parameter properties in constructors, then you ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-redeclare.md b/packages/eslint-plugin/docs/rules/no-redeclare.md index c8c55025577..bca119c58f9 100644 --- a/packages/eslint-plugin/docs/rules/no-redeclare.md +++ b/packages/eslint-plugin/docs/rules/no-redeclare.md @@ -88,5 +88,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md b/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md index e427c671d3f..8201dee9621 100644 --- a/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md +++ b/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md @@ -66,6 +66,19 @@ type IntersectionStringLiteral = 'foo'; type ReturnUnionNever = () => string | never; ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/no-redundant-type-constituents": "warn" + } +} +``` + +This rule is not configurable. + ## Limitations This rule plays it safe and only works with bottom types, top types, and comparing literal types to primitive types. @@ -81,5 +94,6 @@ It also does not provide an auto-fixer just yet. ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-require-imports.md b/packages/eslint-plugin/docs/rules/no-require-imports.md index 0be131f6484..3c3d65ce591 100644 --- a/packages/eslint-plugin/docs/rules/no-require-imports.md +++ b/packages/eslint-plugin/docs/rules/no-require-imports.md @@ -31,6 +31,19 @@ import lib9 = lib2.anotherSubImport; import lib10 from 'lib10'; ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/no-require-imports": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It If you don't care about TypeScript module syntax, then you will not need this rule. @@ -42,5 +55,6 @@ If you don't care about TypeScript module syntax, then you will not need this ru ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-restricted-imports.md b/packages/eslint-plugin/docs/rules/no-restricted-imports.md index ee7d341d3a4..04ebee1b2ce 100644 --- a/packages/eslint-plugin/docs/rules/no-restricted-imports.md +++ b/packages/eslint-plugin/docs/rules/no-restricted-imports.md @@ -72,5 +72,6 @@ export type { Baz } from 'import-baz'; ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-shadow.md b/packages/eslint-plugin/docs/rules/no-shadow.md index 11b9f62c0bd..04a585c584e 100644 --- a/packages/eslint-plugin/docs/rules/no-shadow.md +++ b/packages/eslint-plugin/docs/rules/no-shadow.md @@ -95,5 +95,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-this-alias.md b/packages/eslint-plugin/docs/rules/no-this-alias.md index 9ce436eb6e5..7dcd57bf22f 100644 --- a/packages/eslint-plugin/docs/rules/no-this-alias.md +++ b/packages/eslint-plugin/docs/rules/no-this-alias.md @@ -64,5 +64,6 @@ If you need to assign `this` to variables, you shouldn’t use this rule. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-throw-literal.md b/packages/eslint-plugin/docs/rules/no-throw-literal.md index 2216a05f74c..1977e04c9b5 100644 --- a/packages/eslint-plugin/docs/rules/no-throw-literal.md +++ b/packages/eslint-plugin/docs/rules/no-throw-literal.md @@ -120,5 +120,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-type-alias.md b/packages/eslint-plugin/docs/rules/no-type-alias.md index 20302bdd740..a6a0d57dff9 100644 --- a/packages/eslint-plugin/docs/rules/no-type-alias.md +++ b/packages/eslint-plugin/docs/rules/no-type-alias.md @@ -600,5 +600,6 @@ callback, etc. that would cause the code to be unreadable or impractical. ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md b/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md index 5ba48cc6488..6dcc875dd4f 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md @@ -154,5 +154,6 @@ if (!(someNullCondition ?? true)) { ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md index 53532b2371b..db91e9320e3 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md @@ -116,5 +116,6 @@ The main downside to using this rule is the need for type information. ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md b/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md index 55feda0a188..b76773b151f 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md @@ -76,6 +76,19 @@ namespace X { } ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/no-unnecessary-qualifier": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It If you don't care about having unneeded namespace or enum qualifiers, then you don't need to use this rule. @@ -87,5 +100,6 @@ If you don't care about having unneeded namespace or enum qualifiers, then you d ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md index b7829c9405c..7b87151de8b 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md @@ -54,6 +54,19 @@ interface I {} class Impl implements I {} ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/no-unnecessary-type-arguments": "warn" + } +} +``` + +This rule is not configurable. + ## Related To - TSLint: [use-default-type-parameter](https://palantir.github.io/tslint/rules/use-default-type-parameter) @@ -61,5 +74,6 @@ class Impl implements I {} ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md index 8cf43cbe50e..25a1f3fcd4f 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md @@ -81,5 +81,6 @@ If you don't care about having no-op type assertions in your code, then you can ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md index 5bbb2c6cb65..a88294f9a5d 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md @@ -76,5 +76,6 @@ If you don't care about the specific styles of your type constraints, or never u ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-argument.md b/packages/eslint-plugin/docs/rules/no-unsafe-argument.md index cd0a1e83096..c0033ff0a55 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-argument.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-argument.md @@ -92,5 +92,6 @@ This rule is not configurable. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md b/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md index cf2ed503207..d3b21e3f35d 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md @@ -95,5 +95,6 @@ This rule is not configurable. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-call.md b/packages/eslint-plugin/docs/rules/no-unsafe-call.md index e6eb6fe3aaa..0399e8b2b1c 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-call.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-call.md @@ -69,5 +69,6 @@ This rule is not configurable. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md index 92eacedf6c7..72bda9b125a 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md @@ -75,5 +75,6 @@ This rule is not configurable. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-return.md b/packages/eslint-plugin/docs/rules/no-unsafe-return.md index 792eb91c418..14b195cf8fc 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-return.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-return.md @@ -112,5 +112,6 @@ This rule is not configurable. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unused-expressions.md b/packages/eslint-plugin/docs/rules/no-unused-expressions.md index 4a0abf2fc43..a6a58aff4a2 100644 --- a/packages/eslint-plugin/docs/rules/no-unused-expressions.md +++ b/packages/eslint-plugin/docs/rules/no-unused-expressions.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unused-vars.md b/packages/eslint-plugin/docs/rules/no-unused-vars.md index 0de95a4ac1e..e1e1415a729 100644 --- a/packages/eslint-plugin/docs/rules/no-unused-vars.md +++ b/packages/eslint-plugin/docs/rules/no-unused-vars.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-use-before-define.md b/packages/eslint-plugin/docs/rules/no-use-before-define.md index d96b3099ee8..860a00d6a73 100644 --- a/packages/eslint-plugin/docs/rules/no-use-before-define.md +++ b/packages/eslint-plugin/docs/rules/no-use-before-define.md @@ -116,5 +116,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-useless-constructor.md b/packages/eslint-plugin/docs/rules/no-useless-constructor.md index f8a3812efc8..30cb746a020 100644 --- a/packages/eslint-plugin/docs/rules/no-useless-constructor.md +++ b/packages/eslint-plugin/docs/rules/no-useless-constructor.md @@ -39,5 +39,6 @@ See [discussion on this rule's lack of type information](https://github.com/type ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-useless-empty-export.md b/packages/eslint-plugin/docs/rules/no-useless-empty-export.md index 0cb24763f12..4f9273d8f10 100644 --- a/packages/eslint-plugin/docs/rules/no-useless-empty-export.md +++ b/packages/eslint-plugin/docs/rules/no-useless-empty-export.md @@ -38,8 +38,22 @@ export const value = 'Hello, world!'; import 'some-other-module'; ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/no-useless-empty-export": "warn" + } +} +``` + +This rule is not configurable. + ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-var-requires.md b/packages/eslint-plugin/docs/rules/no-var-requires.md index 1d1a4a84eea..c17d816cdd0 100644 --- a/packages/eslint-plugin/docs/rules/no-var-requires.md +++ b/packages/eslint-plugin/docs/rules/no-var-requires.md @@ -50,5 +50,6 @@ If you don't care about TypeScript module syntax, then you will not need this ru ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md b/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md index 07d8839091f..5b20d316622 100644 --- a/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +++ b/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md @@ -28,6 +28,19 @@ const definitely = maybe!; const alsoDefinitely = maybe!; ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/non-nullable-type-assertion-style": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It If you don't mind having unnecessarily verbose type casts, you can avoid this rule. @@ -35,5 +48,6 @@ If you don't mind having unnecessarily verbose type casts, you can avoid this ru ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/object-curly-spacing.md b/packages/eslint-plugin/docs/rules/object-curly-spacing.md index f8f2811d7b7..eb351670a4f 100644 --- a/packages/eslint-plugin/docs/rules/object-curly-spacing.md +++ b/packages/eslint-plugin/docs/rules/object-curly-spacing.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/padding-line-between-statements.md b/packages/eslint-plugin/docs/rules/padding-line-between-statements.md index 4e25f2073a6..fdae8e01de0 100644 --- a/packages/eslint-plugin/docs/rules/padding-line-between-statements.md +++ b/packages/eslint-plugin/docs/rules/padding-line-between-statements.md @@ -58,5 +58,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-as-const.md b/packages/eslint-plugin/docs/rules/prefer-as-const.md index 47ab9787ec9..203d3793f11 100644 --- a/packages/eslint-plugin/docs/rules/prefer-as-const.md +++ b/packages/eslint-plugin/docs/rules/prefer-as-const.md @@ -51,5 +51,6 @@ If you are using TypeScript < 3.4 ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md b/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md index 357350b7642..64e01338627 100644 --- a/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md +++ b/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md @@ -71,6 +71,19 @@ enum Color { } ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/prefer-enum-initializers": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It If you don't care about `enum`s having implicit values you can safely disable this rule. @@ -78,5 +91,6 @@ If you don't care about `enum`s having implicit values you can safely disable th ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-for-of.md b/packages/eslint-plugin/docs/rules/prefer-for-of.md index f7447d82f17..d9db0809b1d 100644 --- a/packages/eslint-plugin/docs/rules/prefer-for-of.md +++ b/packages/eslint-plugin/docs/rules/prefer-for-of.md @@ -38,6 +38,19 @@ for (let i = 0; i < arr.length; i++) { } ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/prefer-for-of": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It If you transpile for browsers that do not support for-of loops, you may wish to use traditional for loops that produce more compact code. @@ -49,5 +62,6 @@ If you transpile for browsers that do not support for-of loops, you may wish to ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-function-type.md b/packages/eslint-plugin/docs/rules/prefer-function-type.md index ffa187df83c..12841ff760a 100644 --- a/packages/eslint-plugin/docs/rules/prefer-function-type.md +++ b/packages/eslint-plugin/docs/rules/prefer-function-type.md @@ -78,6 +78,19 @@ interface Overloaded { type Intersection = ((data: string) => number) & ((id: number) => string); ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/prefer-function-type": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It If you specifically want to use an interface or type literal with a single call signature for stylistic reasons, you can disable this rule. @@ -89,5 +102,6 @@ If you specifically want to use an interface or type literal with a single call ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-includes.md b/packages/eslint-plugin/docs/rules/prefer-includes.md index f23889a4900..16884f8bc32 100644 --- a/packages/eslint-plugin/docs/rules/prefer-includes.md +++ b/packages/eslint-plugin/docs/rules/prefer-includes.md @@ -72,7 +72,16 @@ mismatchExample.indexOf(value) >= 0; ## Options -There are no options. +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/prefer-includes": "warn" + } +} +``` + +This rule is not configurable. ## When Not To Use It @@ -81,5 +90,6 @@ If you don't want to suggest `includes`, you can safely turn this rule off. ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md b/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md index ff7a1ce821d..6e589ca5190 100644 --- a/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md +++ b/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md @@ -100,5 +100,6 @@ If you want use anything other than simple literals as an enum value. ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md b/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md index 887c8171b36..0d45a7bcb15 100644 --- a/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md +++ b/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md @@ -39,5 +39,6 @@ This rule is not configurable. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md b/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md index dd9c02009f9..61cf9f0d3c7 100644 --- a/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +++ b/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md @@ -145,5 +145,6 @@ If you are not using TypeScript 3.7 (or greater), then you will not be able to u ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-optional-chain.md b/packages/eslint-plugin/docs/rules/prefer-optional-chain.md index 4d0e0871c73..82e43651ea9 100644 --- a/packages/eslint-plugin/docs/rules/prefer-optional-chain.md +++ b/packages/eslint-plugin/docs/rules/prefer-optional-chain.md @@ -85,6 +85,19 @@ foo?.a?.b?.c?.d?.e; **Note:** there are a few edge cases where this rule will false positive. Use your best judgement when evaluating reported errors. +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/prefer-optional-chain": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It If you are not using TypeScript 3.7 (or greater), then you will not be able to use this rule, as the operator is not supported. @@ -97,5 +110,6 @@ If you are not using TypeScript 3.7 (or greater), then you will not be able to u ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md b/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md index 0446c34de46..63d61b34d78 100644 --- a/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +++ b/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md @@ -281,5 +281,6 @@ function foo(arg: MyType) {} ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-readonly.md b/packages/eslint-plugin/docs/rules/prefer-readonly.md index 9698c8e9251..4d01410d324 100644 --- a/packages/eslint-plugin/docs/rules/prefer-readonly.md +++ b/packages/eslint-plugin/docs/rules/prefer-readonly.md @@ -93,5 +93,6 @@ class Container { ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md b/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md index b5359343899..247b4fa6777 100644 --- a/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +++ b/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md @@ -53,7 +53,16 @@ Examples of code for this rule: ## Options -There are no options. +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/prefer-reduce-type-parameter": "warn" + } +} +``` + +This rule is not configurable. ## When Not To Use It @@ -62,5 +71,6 @@ If you don't want to use typechecking in your linting, you can't use this rule. ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md b/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md index 1c820245741..fa4e2c97013 100644 --- a/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md +++ b/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md @@ -44,14 +44,17 @@ search.exec(text); ## Options -There are no options. - -```json +```jsonc +// .eslintrc.json { - "@typescript-eslint/prefer-regexp-exec": "error" + "rules": { + "@typescript-eslint/prefer-regexp-exec": "warn" + } } ``` +This rule is not configurable. + ## When Not To Use It If you prefer consistent use of `String#match` for both, with `g` flag and without it, you can turn this rule off. @@ -59,5 +62,6 @@ If you prefer consistent use of `String#match` for both, with `g` flag and witho ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-return-this-type.md b/packages/eslint-plugin/docs/rules/prefer-return-this-type.md index c60bee7ec0d..59895c14f40 100644 --- a/packages/eslint-plugin/docs/rules/prefer-return-this-type.md +++ b/packages/eslint-plugin/docs/rules/prefer-return-this-type.md @@ -93,6 +93,19 @@ class Derived extends Base { } ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/prefer-return-this-type": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It If you don't use method chaining or explicit return values, you can safely turn this rule off. @@ -100,5 +113,6 @@ If you don't use method chaining or explicit return values, you can safely turn ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md b/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md index 9b7cc2902ec..7ecc4c77f4f 100644 --- a/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +++ b/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md @@ -47,14 +47,17 @@ foo.endsWith('bar'); ## Options -There are no options. - -```json +```jsonc +// .eslintrc.json { - "@typescript-eslint/prefer-string-starts-ends-with": "error" + "rules": { + "@typescript-eslint/prefer-string-starts-ends-with": "warn" + } } ``` +This rule is not configurable. + ## When Not To Use It If you don't mind that style, you can turn this rule off safely. @@ -62,5 +65,6 @@ If you don't mind that style, you can turn this rule off safely. ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md b/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md index ad9ee974530..a08980a5505 100644 --- a/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md +++ b/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md @@ -62,6 +62,19 @@ const isOptionEnabled = (key: string): boolean => { }; ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/prefer-ts-expect-error": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It If you are **NOT** using TypeScript 3.9 (or greater), then you will not be able to use this rule, as the directive is not supported @@ -73,5 +86,6 @@ If you are **NOT** using TypeScript 3.9 (or greater), then you will not be able ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/promise-function-async.md b/packages/eslint-plugin/docs/rules/promise-function-async.md index 9791f586d57..7d672981b70 100644 --- a/packages/eslint-plugin/docs/rules/promise-function-async.md +++ b/packages/eslint-plugin/docs/rules/promise-function-async.md @@ -74,5 +74,6 @@ In addition, each of the following properties may be provided, and default to `t ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/quotes.md b/packages/eslint-plugin/docs/rules/quotes.md index 391c8168247..a5637262819 100644 --- a/packages/eslint-plugin/docs/rules/quotes.md +++ b/packages/eslint-plugin/docs/rules/quotes.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/require-array-sort-compare.md b/packages/eslint-plugin/docs/rules/require-array-sort-compare.md index 18248cca444..129e9dbc7bd 100644 --- a/packages/eslint-plugin/docs/rules/require-array-sort-compare.md +++ b/packages/eslint-plugin/docs/rules/require-array-sort-compare.md @@ -101,5 +101,6 @@ If you understand the language specification enough, you can turn this rule off ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/require-await.md b/packages/eslint-plugin/docs/rules/require-await.md index 86a5d580d87..5746f46a042 100644 --- a/packages/eslint-plugin/docs/rules/require-await.md +++ b/packages/eslint-plugin/docs/rules/require-await.md @@ -40,5 +40,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/restrict-plus-operands.md b/packages/eslint-plugin/docs/rules/restrict-plus-operands.md index c87d3a29064..0e98dfdeb36 100644 --- a/packages/eslint-plugin/docs/rules/restrict-plus-operands.md +++ b/packages/eslint-plugin/docs/rules/restrict-plus-operands.md @@ -108,5 +108,6 @@ var fn = (a: any, b: number) => a + b; ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/restrict-template-expressions.md b/packages/eslint-plugin/docs/rules/restrict-template-expressions.md index e248863cfda..cd78738aa06 100644 --- a/packages/eslint-plugin/docs/rules/restrict-template-expressions.md +++ b/packages/eslint-plugin/docs/rules/restrict-template-expressions.md @@ -112,5 +112,6 @@ const msg1 = `arg = ${arg}`; ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/return-await.md b/packages/eslint-plugin/docs/rules/return-await.md index 09e4f2e2b28..620e299c048 100644 --- a/packages/eslint-plugin/docs/rules/return-await.md +++ b/packages/eslint-plugin/docs/rules/return-await.md @@ -224,5 +224,6 @@ async function validNever3() { ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/semi.md b/packages/eslint-plugin/docs/rules/semi.md index 46d21bfccd3..af7837a214d 100644 --- a/packages/eslint-plugin/docs/rules/semi.md +++ b/packages/eslint-plugin/docs/rules/semi.md @@ -34,5 +34,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md b/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md index 19aa2ad18bb..0bb006fafcf 100644 --- a/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +++ b/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md @@ -155,5 +155,6 @@ The ordering of groups is determined by this option. ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/space-before-blocks.md b/packages/eslint-plugin/docs/rules/space-before-blocks.md index 52f8a121df6..f0b1bbdae95 100644 --- a/packages/eslint-plugin/docs/rules/space-before-blocks.md +++ b/packages/eslint-plugin/docs/rules/space-before-blocks.md @@ -56,5 +56,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/maste ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/space-before-function-paren.md b/packages/eslint-plugin/docs/rules/space-before-function-paren.md index 46e352e54d8..9dc01253e25 100644 --- a/packages/eslint-plugin/docs/rules/space-before-function-paren.md +++ b/packages/eslint-plugin/docs/rules/space-before-function-paren.md @@ -30,5 +30,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/space-infix-ops.md b/packages/eslint-plugin/docs/rules/space-infix-ops.md index c95b91a4f8c..fd2ac74b4c7 100644 --- a/packages/eslint-plugin/docs/rules/space-infix-ops.md +++ b/packages/eslint-plugin/docs/rules/space-infix-ops.md @@ -34,5 +34,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md index 5b06af74c3f..9b3be765cde 100644 --- a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md +++ b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md @@ -201,5 +201,6 @@ This rule provides following fixes and suggestions for particular types in boole ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md b/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md index 13f4123a9d0..549265598c8 100644 --- a/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +++ b/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md @@ -106,6 +106,19 @@ switch (day) { } ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/switch-exhaustiveness-check": "warn" + } +} +``` + +This rule is not configurable. + ## When Not To Use It If program doesn't have union types with many parts. Downside of this rule is the need for type information, so it's slower than regular rules. @@ -113,5 +126,6 @@ If program doesn't have union types with many parts. Downside of this rule is th ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/triple-slash-reference.md b/packages/eslint-plugin/docs/rules/triple-slash-reference.md index 23d8e12c297..73a2aa75735 100644 --- a/packages/eslint-plugin/docs/rules/triple-slash-reference.md +++ b/packages/eslint-plugin/docs/rules/triple-slash-reference.md @@ -60,5 +60,6 @@ If you want to use all flavors of triple slash reference directives. ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/type-annotation-spacing.md b/packages/eslint-plugin/docs/rules/type-annotation-spacing.md index 46beee117e0..42792fac4cd 100644 --- a/packages/eslint-plugin/docs/rules/type-annotation-spacing.md +++ b/packages/eslint-plugin/docs/rules/type-annotation-spacing.md @@ -315,5 +315,6 @@ If you don't want to enforce spacing for your type annotations, you can safely t ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/typedef.md b/packages/eslint-plugin/docs/rules/typedef.md index 75e4b1ccb57..7bf4e40db6f 100644 --- a/packages/eslint-plugin/docs/rules/typedef.md +++ b/packages/eslint-plugin/docs/rules/typedef.md @@ -344,5 +344,6 @@ In general, if you do not consider the cost of writing unnecessary type annotati ## Attributes - [ ] ✅ Recommended +- [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/unbound-method.md b/packages/eslint-plugin/docs/rules/unbound-method.md index 69f049b6c42..5143db9ea24 100644 --- a/packages/eslint-plugin/docs/rules/unbound-method.md +++ b/packages/eslint-plugin/docs/rules/unbound-method.md @@ -122,5 +122,6 @@ If you're wanting to use `toBeCalled` and similar matches in `jest` tests, you c ## Attributes - [x] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/unified-signatures.md b/packages/eslint-plugin/docs/rules/unified-signatures.md index 0b5b527568b..dcbd3d4acdc 100644 --- a/packages/eslint-plugin/docs/rules/unified-signatures.md +++ b/packages/eslint-plugin/docs/rules/unified-signatures.md @@ -32,6 +32,19 @@ function x(x: number | string): void; function y(...x: number[]): void; ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/unified-signatures": "warn" + } +} +``` + +This rule is not configurable. + ## Related To - TSLint: [`unified-signatures`](https://palantir.github.io/tslint/rules/unified-signatures/) @@ -39,5 +52,6 @@ function y(...x: number[]): void; ## Attributes - [ ] ✅ Recommended +- [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/tests/docs.test.ts b/packages/eslint-plugin/tests/docs.test.ts index d5d048d28ed..e3fe7fc10c8 100644 --- a/packages/eslint-plugin/tests/docs.test.ts +++ b/packages/eslint-plugin/tests/docs.test.ts @@ -94,96 +94,107 @@ describe('Validating rule docs', () => { }); for (const [ruleName, rule] of rulesData) { - const filePath = path.join(docsRoot, `${ruleName}.md`); + describe(ruleName, () => { + const filePath = path.join(docsRoot, `${ruleName}.md`); - it(`First header in ${ruleName}.md must be the name of the rule`, () => { - const tokens = parseMarkdownFile(filePath); + it(`First header in ${ruleName}.md must be the name of the rule`, () => { + const tokens = parseMarkdownFile(filePath); - const header = tokens.find(tokenIsH1)!; + const header = tokens.find(tokenIsH1)!; - expect(header.text).toBe(`\`${ruleName}\``); - }); + expect(header.text).toBe(`\`${ruleName}\``); + }); - it(`Description of ${ruleName}.md must match`, () => { - // validate if description of rule is same as in docs - const tokens = parseMarkdownFile(filePath); + it(`Description of ${ruleName}.md must match`, () => { + // validate if description of rule is same as in docs + const tokens = parseMarkdownFile(filePath); - // Rule title not found. - // Rule title does not match the rule metadata. - expect(tokens[1]).toMatchObject({ - type: 'paragraph', - text: `${rule.meta.docs?.description}.`, + // Rule title not found. + // Rule title does not match the rule metadata. + expect(tokens[1]).toMatchObject({ + type: 'paragraph', + text: `${rule.meta.docs?.description}.`, + }); }); - }); - it(`Headers in ${ruleName}.md must be title-cased`, () => { - const tokens = parseMarkdownFile(filePath); + it(`Headers in ${ruleName}.md must be title-cased`, () => { + const tokens = parseMarkdownFile(filePath); - // Get all H2 headers objects as the other levels are variable by design. - const headers = tokens.filter(tokenIsH2); + // Get all H2 headers objects as the other levels are variable by design. + const headers = tokens.filter(tokenIsH2); - headers.forEach(header => - expect(header.text).toBe(titleCase(header.text)), - ); - }); + headers.forEach(header => + expect(header.text).toBe(titleCase(header.text)), + ); + }); - it(`Options in ${ruleName}.md must match the rule meta`, () => { - // TODO(#4365): We don't yet enforce formatting for all rules. - if ( - !isEmptySchema(rule.meta.schema) || - rule.meta.docs?.extendsBaseRule || - !shouldBeRecommended(rule.meta.docs) - ) { - return; - } + it(`Options in ${ruleName}.md must match the rule meta`, () => { + // TODO(#4365): We don't yet enforce formatting for all rules. + if ( + !isEmptySchema(rule.meta.schema) || + !rule.meta.docs?.recommended || + rule.meta.docs.extendsBaseRule + ) { + return; + } - const tokens = parseMarkdownFile(filePath); + const tokens = parseMarkdownFile(filePath); - const optionsIndex = tokens.findIndex( - token => tokenIsH2(token) && token.text === 'Options', - ); - expect(optionsIndex).toBeGreaterThan(0); + const optionsIndex = tokens.findIndex( + token => tokenIsH2(token) && token.text === 'Options', + ); + expect(optionsIndex).toBeGreaterThan(0); - const codeBlock = tokenAs(tokens[optionsIndex + 1], 'code'); - tokenAs(tokens[optionsIndex + 2], 'space'); - const descriptionBlock = tokenAs(tokens[optionsIndex + 3], 'paragraph'); + const codeBlock = tokenAs(tokens[optionsIndex + 1], 'code'); + tokenAs(tokens[optionsIndex + 2], 'space'); + const descriptionBlock = tokenAs(tokens[optionsIndex + 3], 'paragraph'); - expect(codeBlock).toMatchObject({ - lang: 'jsonc', - text: ` + expect(codeBlock).toMatchObject({ + lang: 'jsonc', + text: ` // .eslintrc.json { "rules": { - "@typescript-eslint/${ruleName}": "${rule.meta.docs?.recommended}" + "@typescript-eslint/${ruleName}": "${ + rule.meta.docs.recommended === 'strict' + ? 'warn' + : rule.meta.docs.recommended + }" } } `.trim(), - type: 'code', - }); - expect(descriptionBlock).toMatchObject({ - text: 'This rule is not configurable.', + type: 'code', + }); + expect(descriptionBlock).toMatchObject({ + text: 'This rule is not configurable.', + }); }); - }); - it(`Attributes in ${ruleName}.md must match the metadata`, () => { - const tokens = parseMarkdownFile(filePath); - - // Verify attributes header exists - const attributesHeaderIndex = tokens.findIndex( - token => tokenIs(token, 'heading') && token.text === 'Attributes', - ); - expect(attributesHeaderIndex).toBeGreaterThan(-1); - - // Verify attributes content - const attributesList = tokenAs(tokens[attributesHeaderIndex + 1], 'list'); - const recommended = attributesList.items[0]; - expect(shouldBeRecommended(rule.meta.docs)).toBe(recommended.checked); - const fixable = attributesList.items[1]; - expect(rule.meta.fixable !== undefined).toBe(fixable.checked); - const requiresTypeChecking = attributesList.items[2]; - expect(rule.meta.docs?.requiresTypeChecking === true).toBe( - requiresTypeChecking.checked, - ); + it(`Attributes in ${ruleName}.md must match the metadata`, () => { + const tokens = parseMarkdownFile(filePath); + + // Verify attributes header exists + const attributesHeaderIndex = tokens.findIndex( + token => tokenIs(token, 'heading') && token.text === 'Attributes', + ); + expect(attributesHeaderIndex).toBeGreaterThan(-1); + + // Verify attributes content + const attributesList = tokenAs( + tokens[attributesHeaderIndex + 1], + 'list', + ); + const recommended = attributesList.items[0]; + expect(shouldBeRecommended(rule.meta.docs)).toBe(recommended.checked); + const strict = attributesList.items[1]; + expect(shouldBeStrict(rule.meta.docs)).toBe(strict.checked); + const fixable = attributesList.items[2]; + expect(rule.meta.fixable !== undefined).toBe(fixable.checked); + const requiresTypeChecking = attributesList.items[3]; + expect(rule.meta.docs?.requiresTypeChecking === true).toBe( + requiresTypeChecking.checked, + ); + }); }); } }); @@ -275,7 +286,11 @@ describe('Validating README.md', () => { it('Recommended column should be correct', () => { expect(ruleRow[2]).toBe( - shouldBeRecommended(rule.meta.docs) ? ':white_check_mark:' : '', + rule.meta.docs?.recommended === 'strict' + ? ':heavy_check_mark:' + : rule.meta.docs?.recommended + ? ':white_check_mark:' + : '', ); }); @@ -301,3 +316,7 @@ function shouldBeRecommended( ): boolean { return docs?.recommended !== false && docs?.recommended !== 'strict'; } + +function shouldBeStrict(docs: TSESLint.RuleMetaDataDocs | undefined): boolean { + return docs?.recommended !== false; +} diff --git a/packages/eslint-plugin/tools/generate-rules-lists.ts b/packages/eslint-plugin/tools/generate-rules-lists.ts index d508f9e8330..0831f432a03 100644 --- a/packages/eslint-plugin/tools/generate-rules-lists.ts +++ b/packages/eslint-plugin/tools/generate-rules-lists.ts @@ -6,11 +6,12 @@ import path from 'path'; import rules from '../src/rules'; import prettier from 'prettier'; +import { TSESLint } from '@typescript-eslint/utils'; interface RuleDetails { name: string; description: string; - recommended: boolean; + recommended: TSESLint.RuleRecommendation; fixable: boolean; requiresTypeChecking: boolean; extendsBaseRule: boolean; @@ -19,13 +20,14 @@ interface RuleDetails { type RuleColumn = [ string, string, - ':white_check_mark:' | '', + ':heavy_check_mark:' | ':white_check_mark:' | '', ':wrench:' | '', ':thought_balloon:' | '', ]; const emojiKey = { recommended: ':white_check_mark:', + strict: ':heavy_check_mark:', fixable: ':wrench:', requiresTypeChecking: ':thought_balloon:', } as const; @@ -33,13 +35,14 @@ const emojiKey = { const staticElements = { rulesListKey: [ `**Key**: ${emojiKey.recommended} = recommended`, + `${emojiKey.strict} = strict`, `${emojiKey.fixable} = fixable`, `${emojiKey.requiresTypeChecking} = requires type information`, ].join(', '), listHeaderRow: [ 'Name', 'Description', - emojiKey.recommended, + `${emojiKey.recommended}${emojiKey.strict}`, emojiKey.fixable, emojiKey.requiresTypeChecking, ], @@ -57,7 +60,9 @@ const createRuleLink = (ruleName: string, basePath: string): string => const buildRuleRow = (rule: RuleDetails, basePath: string): RuleColumn => [ createRuleLink(rule.name, basePath), rule.description, - returnEmojiIfTrue('recommended', rule), + rule.recommended === 'strict' + ? emojiKey.strict + : returnEmojiIfTrue('recommended', rule), returnEmojiIfTrue('fixable', rule), returnEmojiIfTrue('requiresTypeChecking', rule), ]; @@ -119,7 +124,7 @@ const rulesDetails: RuleDetails[] = Object.entries(rules) .map(([name, rule]) => ({ name, description: rule.meta.docs?.description ?? '', - recommended: !!rule.meta.docs?.recommended ?? false, + recommended: rule.meta.docs?.recommended ?? false, fixable: !!rule.meta.fixable, requiresTypeChecking: rule.meta.docs?.requiresTypeChecking ?? false, extendsBaseRule: !!rule.meta.docs?.extendsBaseRule ?? false, diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 699deff005a..e288c7263ff 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -73,7 +73,7 @@ interface RuleMetaData { */ replacedBy?: readonly string[]; /** - * The options schema. Supply an empty array if there are no options. + * The options schema. Supply an empty array if This rule is not configurable. */ schema: JSONSchema4 | readonly JSONSchema4[]; } From d741d55d0c1ee3ca898060d04db847f1323d85f1 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 3 Apr 2022 19:47:19 -0500 Subject: [PATCH 06/20] chore: update configs.test.ts too --- packages/eslint-plugin/tests/configs.test.ts | 23 +++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin/tests/configs.test.ts b/packages/eslint-plugin/tests/configs.test.ts index f8fc068ad64..a7966573027 100644 --- a/packages/eslint-plugin/tests/configs.test.ts +++ b/packages/eslint-plugin/tests/configs.test.ts @@ -68,7 +68,8 @@ describe('recommended.json config', () => { const ruleConfigs = Object.entries(rules) .filter( ([, rule]) => - rule.meta.docs?.recommended !== false && + rule.meta.docs?.recommended && + rule.meta.docs.recommended !== 'strict' && rule.meta.docs?.requiresTypeChecking !== true, ) .map<[string, string]>(([name, rule]) => [ @@ -91,8 +92,9 @@ describe('recommended-requiring-type-checking.json config', () => { const ruleConfigs = Object.entries(rules) .filter( ([, rule]) => - rule.meta.docs?.recommended !== false && - rule.meta.docs?.requiresTypeChecking === true, + rule.meta.docs?.recommended && + rule.meta.docs.recommended !== 'strict' && + rule.meta.docs.requiresTypeChecking === true, ) .map<[string, string]>(([name, rule]) => [ `${RULE_NAME_PREFIX}${name}`, @@ -105,3 +107,18 @@ describe('recommended-requiring-type-checking.json config', () => { itHasBaseRulesOverriden(unfilteredConfigRules); }); + +describe('strict.json config', () => { + const unfilteredConfigRules: Record = + plugin.configs['strict'].rules; + const configRules = filterRules(unfilteredConfigRules); + const ruleConfigs = Object.entries(rules) + .filter(([, rule]) => rule.meta.docs?.recommended === 'strict') + .map<[string, string]>(([name]) => [`${RULE_NAME_PREFIX}${name}`, 'warn']); + + it('contains all recommended rules that require type checking, excluding the deprecated ones', () => { + expect(entriesToObject(ruleConfigs)).toEqual(entriesToObject(configRules)); + }); + + itHasBaseRulesOverriden(unfilteredConfigRules); +}); From b237870de4679c92d48130328e70ff9ad3959180 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 8 Apr 2022 13:41:17 -0400 Subject: [PATCH 07/20] chore: update website docs --- docs/linting/PRESETS.md | 54 +++++++++++++++++++++ packages/eslint-plugin/docs/rules/README.md | 8 +-- packages/website/sidebars/sidebar.base.js | 1 + 3 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 docs/linting/PRESETS.md diff --git a/docs/linting/PRESETS.md b/docs/linting/PRESETS.md new file mode 100644 index 00000000000..cb5f95f0d27 --- /dev/null +++ b/docs/linting/PRESETS.md @@ -0,0 +1,54 @@ +--- +id: presets +sidebar_label: Presets +title: Presets +--- + +`@typescript-eslint/eslint-plugin` includes three rulesets you can extend from to pull in the recommended starting rules. + +### `plugin:@typescript-eslint/recommended` + +Recommended rules for code correctness that you can drop in without additional configuration. +We strongly recommend all TypeScript projects extend from this preset. + +This preset is considered "stable": rule additions and removals will only be done in major version bumps. + +```json +{ + "extends": ["plugin:@typescript-eslint/recommended"] +} +``` + +### `plugin:@typescript-eslint/recommended-requiring-type-checking` + +```json +{ + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking" + ] +} +``` + +Additional recommended rules that require type information. +We recommend all TypeScript projects extend from this preset, with the caveat that rules using type information take longer to run. +See [Linting with Type Information](/docs/linting/type-linting) for more details. + +This preset is considered "stable": rule additions and removals will only be done in major version bumps. + +### `plugin:@typescript-eslint/strict` + +```json +{ + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:@typescript-eslint/strict" + ] +} +``` + +Additional strict rules that can also catch bugs but are more opinionated than recommended rules. +If you are an experienced TypeScript user, you may find benefit from extending from this preset. + +This preset is considered "unstable": rule additions and removals may be done in minor or even patch version bumps. diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md index 890eaa4ac43..34404fc218c 100644 --- a/packages/eslint-plugin/docs/rules/README.md +++ b/packages/eslint-plugin/docs/rules/README.md @@ -6,12 +6,8 @@ pagination_prev: null slug: / --- -`@typescript-eslint/eslint-plugin` comes with two rulesets you can extend from to pull in the recommended starting rules: - -- `'plugin:@typescript-eslint/recommended'`: recommended rules for code correctness that you can drop in without additional configuration. - See [Linting](https://typescript-eslint.io/docs/linting) for more details. -- `'plugin:@typescript-eslint/recommended-requiring-type-checking'` additional recommended rules that require type information. - See [Linting](https://typescript-eslint.io/docs/linting/type-linting) for more details. +`@typescript-eslint/eslint-plugin` includes over 100 rules that detect best practice violations, bugs, and/or stylistic issues specifically for TypeScript code. +See [Presets](/docs/linting/presets) for how to enable recommended rules using presets. ## Supported Rules diff --git a/packages/website/sidebars/sidebar.base.js b/packages/website/sidebars/sidebar.base.js index 5d50b266eef..942fd98e405 100644 --- a/packages/website/sidebars/sidebar.base.js +++ b/packages/website/sidebars/sidebar.base.js @@ -8,6 +8,7 @@ module.exports = { items: [ 'linting/linting', 'linting/type-linting', + 'linting/presets', 'linting/monorepo', 'linting/troubleshooting', 'linting/tslint', From 5131919430c85cbb9c67f8ec84560fc160810ff6 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 12 Apr 2022 19:19:58 -0400 Subject: [PATCH 08/20] docs: add sub-list of configs to attributes --- packages/eslint-plugin/docs/rules/TEMPLATE.md | 5 +++-- .../docs/rules/adjacent-overload-signatures.md | 5 +++-- packages/eslint-plugin/docs/rules/array-type.md | 5 +++-- .../eslint-plugin/docs/rules/await-thenable.md | 5 +++-- .../eslint-plugin/docs/rules/ban-ts-comment.md | 5 +++-- .../docs/rules/ban-tslint-comment.md | 5 +++-- packages/eslint-plugin/docs/rules/ban-types.md | 5 +++-- packages/eslint-plugin/docs/rules/brace-style.md | 5 +++-- .../docs/rules/class-literal-property-style.md | 5 +++-- .../eslint-plugin/docs/rules/comma-dangle.md | 5 +++-- .../eslint-plugin/docs/rules/comma-spacing.md | 5 +++-- .../rules/consistent-indexed-object-style.md | 5 +++-- .../docs/rules/consistent-type-assertions.md | 5 +++-- .../docs/rules/consistent-type-definitions.md | 5 +++-- .../docs/rules/consistent-type-exports.md | 5 +++-- .../docs/rules/consistent-type-imports.md | 5 +++-- .../docs/rules/default-param-last.md | 5 +++-- .../eslint-plugin/docs/rules/dot-notation.md | 5 +++-- .../docs/rules/explicit-function-return-type.md | 5 +++-- .../docs/rules/explicit-member-accessibility.md | 5 +++-- .../docs/rules/explicit-module-boundary-types.md | 5 +++-- .../docs/rules/func-call-spacing.md | 5 +++-- packages/eslint-plugin/docs/rules/indent.md | 5 +++-- .../docs/rules/init-declarations.md | 5 +++-- .../eslint-plugin/docs/rules/keyword-spacing.md | 5 +++-- .../docs/rules/lines-between-class-members.md | 5 +++-- .../docs/rules/member-delimiter-style.md | 5 +++-- .../eslint-plugin/docs/rules/member-ordering.md | 5 +++-- .../docs/rules/method-signature-style.md | 5 +++-- .../docs/rules/naming-convention.md | 5 +++-- .../docs/rules/no-array-constructor.md | 5 +++-- .../docs/rules/no-base-to-string.md | 5 +++-- .../rules/no-confusing-non-null-assertion.md | 5 +++-- .../docs/rules/no-confusing-void-expression.md | 5 +++-- .../docs/rules/no-dupe-class-members.md | 5 +++-- .../docs/rules/no-duplicate-imports.md | 5 +++-- .../docs/rules/no-dynamic-delete.md | 5 +++-- .../docs/rules/no-empty-function.md | 5 +++-- .../docs/rules/no-empty-interface.md | 5 +++-- .../eslint-plugin/docs/rules/no-explicit-any.md | 5 +++-- .../docs/rules/no-extra-non-null-assertion.md | 5 +++-- .../eslint-plugin/docs/rules/no-extra-parens.md | 5 +++-- .../eslint-plugin/docs/rules/no-extra-semi.md | 5 +++-- .../docs/rules/no-extraneous-class.md | 5 +++-- .../docs/rules/no-floating-promises.md | 5 +++-- .../eslint-plugin/docs/rules/no-for-in-array.md | 5 +++-- .../docs/rules/no-implicit-any-catch.md | 5 +++-- .../eslint-plugin/docs/rules/no-implied-eval.md | 5 +++-- .../docs/rules/no-inferrable-types.md | 5 +++-- .../eslint-plugin/docs/rules/no-invalid-this.md | 5 +++-- .../docs/rules/no-invalid-void-type.md | 5 +++-- .../eslint-plugin/docs/rules/no-loop-func.md | 5 +++-- .../docs/rules/no-loss-of-precision.md | 5 +++-- .../eslint-plugin/docs/rules/no-magic-numbers.md | 5 +++-- .../docs/rules/no-meaningless-void-operator.md | 5 +++-- .../eslint-plugin/docs/rules/no-misused-new.md | 5 +++-- .../docs/rules/no-misused-promises.md | 5 +++-- .../eslint-plugin/docs/rules/no-namespace.md | 5 +++-- .../no-non-null-asserted-nullish-coalescing.md | 5 +++-- .../rules/no-non-null-asserted-optional-chain.md | 5 +++-- .../docs/rules/no-non-null-assertion.md | 5 +++-- .../docs/rules/no-parameter-properties.md | 5 +++-- .../eslint-plugin/docs/rules/no-redeclare.md | 5 +++-- .../docs/rules/no-redundant-type-constituents.md | 5 +++-- .../docs/rules/no-require-imports.md | 5 +++-- .../docs/rules/no-restricted-imports.md | 5 +++-- packages/eslint-plugin/docs/rules/no-shadow.md | 5 +++-- .../eslint-plugin/docs/rules/no-this-alias.md | 5 +++-- .../eslint-plugin/docs/rules/no-throw-literal.md | 5 +++-- .../eslint-plugin/docs/rules/no-type-alias.md | 5 +++-- .../no-unnecessary-boolean-literal-compare.md | 5 +++-- .../docs/rules/no-unnecessary-condition.md | 5 +++-- .../docs/rules/no-unnecessary-qualifier.md | 5 +++-- .../docs/rules/no-unnecessary-type-arguments.md | 5 +++-- .../docs/rules/no-unnecessary-type-assertion.md | 5 +++-- .../docs/rules/no-unnecessary-type-constraint.md | 5 +++-- .../docs/rules/no-unsafe-argument.md | 5 +++-- .../docs/rules/no-unsafe-assignment.md | 5 +++-- .../eslint-plugin/docs/rules/no-unsafe-call.md | 5 +++-- .../docs/rules/no-unsafe-member-access.md | 5 +++-- .../eslint-plugin/docs/rules/no-unsafe-return.md | 5 +++-- .../docs/rules/no-unused-expressions.md | 5 +++-- .../eslint-plugin/docs/rules/no-unused-vars.md | 5 +++-- .../docs/rules/no-use-before-define.md | 5 +++-- .../docs/rules/no-useless-constructor.md | 5 +++-- .../docs/rules/no-useless-empty-export.md | 5 +++-- .../eslint-plugin/docs/rules/no-var-requires.md | 5 +++-- .../rules/non-nullable-type-assertion-style.md | 5 +++-- .../docs/rules/object-curly-spacing.md | 5 +++-- .../rules/padding-line-between-statements.md | 5 +++-- .../eslint-plugin/docs/rules/prefer-as-const.md | 5 +++-- .../docs/rules/prefer-enum-initializers.md | 5 +++-- .../eslint-plugin/docs/rules/prefer-for-of.md | 5 +++-- .../docs/rules/prefer-function-type.md | 5 +++-- .../eslint-plugin/docs/rules/prefer-includes.md | 5 +++-- .../docs/rules/prefer-literal-enum-member.md | 5 +++-- .../docs/rules/prefer-namespace-keyword.md | 5 +++-- .../docs/rules/prefer-nullish-coalescing.md | 5 +++-- .../docs/rules/prefer-optional-chain.md | 5 +++-- .../rules/prefer-readonly-parameter-types.md | 5 +++-- .../eslint-plugin/docs/rules/prefer-readonly.md | 5 +++-- .../docs/rules/prefer-reduce-type-parameter.md | 5 +++-- .../docs/rules/prefer-regexp-exec.md | 5 +++-- .../docs/rules/prefer-return-this-type.md | 5 +++-- .../docs/rules/prefer-string-starts-ends-with.md | 5 +++-- .../docs/rules/prefer-ts-expect-error.md | 5 +++-- .../docs/rules/promise-function-async.md | 5 +++-- packages/eslint-plugin/docs/rules/quotes.md | 5 +++-- .../docs/rules/require-array-sort-compare.md | 5 +++-- .../eslint-plugin/docs/rules/require-await.md | 5 +++-- .../docs/rules/restrict-plus-operands.md | 5 +++-- .../docs/rules/restrict-template-expressions.md | 5 +++-- .../eslint-plugin/docs/rules/return-await.md | 5 +++-- packages/eslint-plugin/docs/rules/semi.md | 5 +++-- .../sort-type-union-intersection-members.md | 5 +++-- .../docs/rules/space-before-blocks.md | 5 +++-- .../docs/rules/space-before-function-paren.md | 5 +++-- .../eslint-plugin/docs/rules/space-infix-ops.md | 5 +++-- .../docs/rules/strict-boolean-expressions.md | 5 +++-- .../docs/rules/switch-exhaustiveness-check.md | 5 +++-- .../docs/rules/triple-slash-reference.md | 5 +++-- .../docs/rules/type-annotation-spacing.md | 5 +++-- packages/eslint-plugin/docs/rules/typedef.md | 5 +++-- .../eslint-plugin/docs/rules/unbound-method.md | 5 +++-- .../docs/rules/unified-signatures.md | 5 +++-- packages/eslint-plugin/tests/docs.test.ts | 16 +++++++++++----- 126 files changed, 386 insertions(+), 255 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/TEMPLATE.md b/packages/eslint-plugin/docs/rules/TEMPLATE.md index 4b56a5c9be0..c68bff3fdb9 100644 --- a/packages/eslint-plugin/docs/rules/TEMPLATE.md +++ b/packages/eslint-plugin/docs/rules/TEMPLATE.md @@ -54,7 +54,8 @@ For example if this rule requires a feature released in a certain TS version. ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md b/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md index a556620c2d7..1e162cc0bb2 100644 --- a/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md +++ b/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md @@ -107,7 +107,8 @@ If you don't care about the general structure of the code, then you will not nee ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/array-type.md b/packages/eslint-plugin/docs/rules/array-type.md index ac049939020..34724711c65 100644 --- a/packages/eslint-plugin/docs/rules/array-type.md +++ b/packages/eslint-plugin/docs/rules/array-type.md @@ -125,7 +125,8 @@ This matrix lists all possible option combinations and their expected results fo ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/await-thenable.md b/packages/eslint-plugin/docs/rules/await-thenable.md index e759c7f258d..5472cceb4a1 100644 --- a/packages/eslint-plugin/docs/rules/await-thenable.md +++ b/packages/eslint-plugin/docs/rules/await-thenable.md @@ -53,7 +53,8 @@ This is generally not preferred, but can sometimes be useful for visual consiste ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/ban-ts-comment.md b/packages/eslint-plugin/docs/rules/ban-ts-comment.md index 11b29eba69a..f4fbf4e49b3 100644 --- a/packages/eslint-plugin/docs/rules/ban-ts-comment.md +++ b/packages/eslint-plugin/docs/rules/ban-ts-comment.md @@ -145,7 +145,8 @@ If you want to use all of the TypeScript directives. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/ban-tslint-comment.md b/packages/eslint-plugin/docs/rules/ban-tslint-comment.md index f9dd6a9d113..7b231a723f4 100644 --- a/packages/eslint-plugin/docs/rules/ban-tslint-comment.md +++ b/packages/eslint-plugin/docs/rules/ban-tslint-comment.md @@ -49,7 +49,8 @@ If you are still using TSLint. ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/ban-types.md b/packages/eslint-plugin/docs/rules/ban-types.md index 532ee77c405..13aa8b5c1fa 100644 --- a/packages/eslint-plugin/docs/rules/ban-types.md +++ b/packages/eslint-plugin/docs/rules/ban-types.md @@ -189,7 +189,8 @@ const curly2: Record<'a', string> = { a: 'string' }; ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/brace-style.md b/packages/eslint-plugin/docs/rules/brace-style.md index 6272851f228..5cae2f84b3f 100644 --- a/packages/eslint-plugin/docs/rules/brace-style.md +++ b/packages/eslint-plugin/docs/rules/brace-style.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/class-literal-property-style.md b/packages/eslint-plugin/docs/rules/class-literal-property-style.md index 2dc9810a2e2..718881e7e4f 100644 --- a/packages/eslint-plugin/docs/rules/class-literal-property-style.md +++ b/packages/eslint-plugin/docs/rules/class-literal-property-style.md @@ -111,7 +111,8 @@ for how literal values are exposed by your classes. ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/comma-dangle.md b/packages/eslint-plugin/docs/rules/comma-dangle.md index 57320880adc..80c84b94950 100644 --- a/packages/eslint-plugin/docs/rules/comma-dangle.md +++ b/packages/eslint-plugin/docs/rules/comma-dangle.md @@ -41,7 +41,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/comma-spacing.md b/packages/eslint-plugin/docs/rules/comma-spacing.md index 626bb25d7cd..d0197b7fa52 100644 --- a/packages/eslint-plugin/docs/rules/comma-spacing.md +++ b/packages/eslint-plugin/docs/rules/comma-spacing.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md b/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md index 01c1a6ed4a7..253a8b058f7 100644 --- a/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md +++ b/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md @@ -85,7 +85,8 @@ type Foo = { ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-type-assertions.md b/packages/eslint-plugin/docs/rules/consistent-type-assertions.md index 65433ebdf3c..c7fff6261f0 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-assertions.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-assertions.md @@ -119,7 +119,8 @@ If you do not want to enforce consistent type assertions. ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-type-definitions.md b/packages/eslint-plugin/docs/rules/consistent-type-definitions.md index f6f48528649..e28746a782f 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-definitions.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-definitions.md @@ -87,7 +87,8 @@ If you specifically want to use an interface or type literal for stylistic reaso ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 073cadf8565..bf16468b678 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -82,7 +82,8 @@ export { Button, type ButtonProps } from 'some-library'; ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-type-imports.md b/packages/eslint-plugin/docs/rules/consistent-type-imports.md index f6c86856ca6..165ca2c0533 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-imports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-imports.md @@ -67,7 +67,8 @@ const x: import('Bar') = 1; ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/default-param-last.md b/packages/eslint-plugin/docs/rules/default-param-last.md index 2419f898bd6..d7ca25213fc 100644 --- a/packages/eslint-plugin/docs/rules/default-param-last.md +++ b/packages/eslint-plugin/docs/rules/default-param-last.md @@ -65,7 +65,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/dot-notation.md b/packages/eslint-plugin/docs/rules/dot-notation.md index 76ec121b27c..7f22fa0f4a3 100644 --- a/packages/eslint-plugin/docs/rules/dot-notation.md +++ b/packages/eslint-plugin/docs/rules/dot-notation.md @@ -90,7 +90,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md index c4faa3c34e3..9fd46653d30 100644 --- a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md +++ b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md @@ -293,7 +293,8 @@ you will not need this rule. ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md index 7223d1d1022..03e0d6586f6 100644 --- a/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md +++ b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md @@ -351,7 +351,8 @@ If you think defaulting to public is a good default, then you should consider us ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md index 5fbe3bd3bb2..f53057c6a65 100644 --- a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md +++ b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md @@ -288,7 +288,8 @@ If you wish to make sure all functions have explicit return types, as opposed to ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/func-call-spacing.md b/packages/eslint-plugin/docs/rules/func-call-spacing.md index f703eaeb9de..94dcc5d30dd 100644 --- a/packages/eslint-plugin/docs/rules/func-call-spacing.md +++ b/packages/eslint-plugin/docs/rules/func-call-spacing.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/indent.md b/packages/eslint-plugin/docs/rules/indent.md index 6234e874b2b..32b21d34fdf 100644 --- a/packages/eslint-plugin/docs/rules/indent.md +++ b/packages/eslint-plugin/docs/rules/indent.md @@ -33,7 +33,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/init-declarations.md b/packages/eslint-plugin/docs/rules/init-declarations.md index 6393233f204..d22f7805dc9 100644 --- a/packages/eslint-plugin/docs/rules/init-declarations.md +++ b/packages/eslint-plugin/docs/rules/init-declarations.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/keyword-spacing.md b/packages/eslint-plugin/docs/rules/keyword-spacing.md index 29a03480b89..db49f79a1bd 100644 --- a/packages/eslint-plugin/docs/rules/keyword-spacing.md +++ b/packages/eslint-plugin/docs/rules/keyword-spacing.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/lines-between-class-members.md b/packages/eslint-plugin/docs/rules/lines-between-class-members.md index 1a3fd76886e..12db029bd86 100644 --- a/packages/eslint-plugin/docs/rules/lines-between-class-members.md +++ b/packages/eslint-plugin/docs/rules/lines-between-class-members.md @@ -80,7 +80,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/member-delimiter-style.md b/packages/eslint-plugin/docs/rules/member-delimiter-style.md index f3848c0b960..5951b1f8626 100644 --- a/packages/eslint-plugin/docs/rules/member-delimiter-style.md +++ b/packages/eslint-plugin/docs/rules/member-delimiter-style.md @@ -211,7 +211,8 @@ If you don't care about enforcing a consistent member delimiter in interfaces an ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/member-ordering.md b/packages/eslint-plugin/docs/rules/member-ordering.md index e83fc47ef66..7451c1bc400 100644 --- a/packages/eslint-plugin/docs/rules/member-ordering.md +++ b/packages/eslint-plugin/docs/rules/member-ordering.md @@ -1115,7 +1115,8 @@ If you don't care about the general structure of your classes and interfaces, th ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/method-signature-style.md b/packages/eslint-plugin/docs/rules/method-signature-style.md index 350781b2324..712b07f628b 100644 --- a/packages/eslint-plugin/docs/rules/method-signature-style.md +++ b/packages/eslint-plugin/docs/rules/method-signature-style.md @@ -107,7 +107,8 @@ If you don't want to enforce a particular style for object/interface function ty ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/naming-convention.md b/packages/eslint-plugin/docs/rules/naming-convention.md index 7994198257d..21a619b9a27 100644 --- a/packages/eslint-plugin/docs/rules/naming-convention.md +++ b/packages/eslint-plugin/docs/rules/naming-convention.md @@ -703,7 +703,8 @@ If you do not want to enforce naming conventions for anything. ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-array-constructor.md b/packages/eslint-plugin/docs/rules/no-array-constructor.md index 10d40c1ff4d..77f3fcca88e 100644 --- a/packages/eslint-plugin/docs/rules/no-array-constructor.md +++ b/packages/eslint-plugin/docs/rules/no-array-constructor.md @@ -52,7 +52,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-base-to-string.md b/packages/eslint-plugin/docs/rules/no-base-to-string.md index 92b6611b2ce..0a9f1854cd5 100644 --- a/packages/eslint-plugin/docs/rules/no-base-to-string.md +++ b/packages/eslint-plugin/docs/rules/no-base-to-string.md @@ -92,7 +92,8 @@ If you don't mind `"[object Object]"` in your strings, then you will not need th ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md b/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md index c4fe0e8b354..a13dbdc9ed4 100644 --- a/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md @@ -64,7 +64,8 @@ If you don't care about this confusion, then you will not need this rule. ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md b/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md index 8a6e790f6b9..55951da17b2 100644 --- a/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md +++ b/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md @@ -154,7 +154,8 @@ Also, if you prefer concise coding style then also don't use it. ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-dupe-class-members.md b/packages/eslint-plugin/docs/rules/no-dupe-class-members.md index 887b844a5a1..706772c6f80 100644 --- a/packages/eslint-plugin/docs/rules/no-dupe-class-members.md +++ b/packages/eslint-plugin/docs/rules/no-dupe-class-members.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-duplicate-imports.md b/packages/eslint-plugin/docs/rules/no-duplicate-imports.md index b2b01acbe80..d706815ffc3 100644 --- a/packages/eslint-plugin/docs/rules/no-duplicate-imports.md +++ b/packages/eslint-plugin/docs/rules/no-duplicate-imports.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-dynamic-delete.md b/packages/eslint-plugin/docs/rules/no-dynamic-delete.md index e35ed789dbd..928baf4a217 100644 --- a/packages/eslint-plugin/docs/rules/no-dynamic-delete.md +++ b/packages/eslint-plugin/docs/rules/no-dynamic-delete.md @@ -67,7 +67,8 @@ Even repeated minor performance slowdowns likely do not significantly affect you ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-empty-function.md b/packages/eslint-plugin/docs/rules/no-empty-function.md index e4ae9dca913..3c1f74533e6 100644 --- a/packages/eslint-plugin/docs/rules/no-empty-function.md +++ b/packages/eslint-plugin/docs/rules/no-empty-function.md @@ -95,7 +95,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-empty-interface.md b/packages/eslint-plugin/docs/rules/no-empty-interface.md index ca5388291cb..b31fa854976 100644 --- a/packages/eslint-plugin/docs/rules/no-empty-interface.md +++ b/packages/eslint-plugin/docs/rules/no-empty-interface.md @@ -71,7 +71,8 @@ If you don't care about having empty/meaningless interfaces, then you will not n ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-explicit-any.md b/packages/eslint-plugin/docs/rules/no-explicit-any.md index 5d276e11ee9..82ac1a7e0ca 100644 --- a/packages/eslint-plugin/docs/rules/no-explicit-any.md +++ b/packages/eslint-plugin/docs/rules/no-explicit-any.md @@ -186,7 +186,8 @@ and you want to be able to specify `any`. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md b/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md index 889454c25f5..cb1a684b88e 100644 --- a/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md @@ -61,7 +61,8 @@ This rule is not configurable. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-extra-parens.md b/packages/eslint-plugin/docs/rules/no-extra-parens.md index d7bc6b209d2..e575ae1504f 100644 --- a/packages/eslint-plugin/docs/rules/no-extra-parens.md +++ b/packages/eslint-plugin/docs/rules/no-extra-parens.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-extra-semi.md b/packages/eslint-plugin/docs/rules/no-extra-semi.md index d61999e4672..583fdfd1f8a 100644 --- a/packages/eslint-plugin/docs/rules/no-extra-semi.md +++ b/packages/eslint-plugin/docs/rules/no-extra-semi.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-extraneous-class.md b/packages/eslint-plugin/docs/rules/no-extraneous-class.md index cfbb6b218df..a51afb03e6c 100644 --- a/packages/eslint-plugin/docs/rules/no-extraneous-class.md +++ b/packages/eslint-plugin/docs/rules/no-extraneous-class.md @@ -87,7 +87,8 @@ team or if you use classes as namespaces. ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-floating-promises.md b/packages/eslint-plugin/docs/rules/no-floating-promises.md index aacaca9f900..552e34c0618 100644 --- a/packages/eslint-plugin/docs/rules/no-floating-promises.md +++ b/packages/eslint-plugin/docs/rules/no-floating-promises.md @@ -122,7 +122,8 @@ If you do not use Promise-like values in your codebase, or want to allow them to ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-for-in-array.md b/packages/eslint-plugin/docs/rules/no-for-in-array.md index 62abb6eaced..aa4434e6755 100644 --- a/packages/eslint-plugin/docs/rules/no-for-in-array.md +++ b/packages/eslint-plugin/docs/rules/no-for-in-array.md @@ -64,7 +64,8 @@ If you want to iterate through a loop using the indices in an array as strings, ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md b/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md index c45b0e8de66..b2b6a60aa30 100644 --- a/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md +++ b/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md @@ -83,7 +83,8 @@ If you are not using TypeScript 4.0 (or greater), then you will not be able to u ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-implied-eval.md b/packages/eslint-plugin/docs/rules/no-implied-eval.md index 2266f95b2a9..790c6f21e60 100644 --- a/packages/eslint-plugin/docs/rules/no-implied-eval.md +++ b/packages/eslint-plugin/docs/rules/no-implied-eval.md @@ -116,7 +116,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-inferrable-types.md b/packages/eslint-plugin/docs/rules/no-inferrable-types.md index 7203888046e..fec87f681a7 100644 --- a/packages/eslint-plugin/docs/rules/no-inferrable-types.md +++ b/packages/eslint-plugin/docs/rules/no-inferrable-types.md @@ -155,7 +155,8 @@ TSLint: [no-inferrable-types](https://palantir.github.io/tslint/rules/no-inferra ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-invalid-this.md b/packages/eslint-plugin/docs/rules/no-invalid-this.md index 5d097f19919..68e876575fb 100644 --- a/packages/eslint-plugin/docs/rules/no-invalid-this.md +++ b/packages/eslint-plugin/docs/rules/no-invalid-this.md @@ -33,7 +33,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-invalid-void-type.md b/packages/eslint-plugin/docs/rules/no-invalid-void-type.md index 9c8b23bb4bf..3e51448d9a6 100644 --- a/packages/eslint-plugin/docs/rules/no-invalid-void-type.md +++ b/packages/eslint-plugin/docs/rules/no-invalid-void-type.md @@ -133,7 +133,8 @@ or in invalid places, then you don't need this rule. ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-loop-func.md b/packages/eslint-plugin/docs/rules/no-loop-func.md index c2e7833ec50..5914369f5cb 100644 --- a/packages/eslint-plugin/docs/rules/no-loop-func.md +++ b/packages/eslint-plugin/docs/rules/no-loop-func.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-loss-of-precision.md b/packages/eslint-plugin/docs/rules/no-loss-of-precision.md index d000da4868e..309f9d8b272 100644 --- a/packages/eslint-plugin/docs/rules/no-loss-of-precision.md +++ b/packages/eslint-plugin/docs/rules/no-loss-of-precision.md @@ -26,7 +26,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-magic-numbers.md b/packages/eslint-plugin/docs/rules/no-magic-numbers.md index 85033b3d144..55f503cba87 100644 --- a/packages/eslint-plugin/docs/rules/no-magic-numbers.md +++ b/packages/eslint-plugin/docs/rules/no-magic-numbers.md @@ -126,7 +126,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md b/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md index 633134aceee..7583aadb984 100644 --- a/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md +++ b/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md @@ -57,7 +57,8 @@ This rule accepts a single object option with the following default configuratio ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-misused-new.md b/packages/eslint-plugin/docs/rules/no-misused-new.md index fe3eb2c5ce9..42e7c3d35e2 100644 --- a/packages/eslint-plugin/docs/rules/no-misused-new.md +++ b/packages/eslint-plugin/docs/rules/no-misused-new.md @@ -53,7 +53,8 @@ This rule is not configurable. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-misused-promises.md b/packages/eslint-plugin/docs/rules/no-misused-promises.md index 244d94cb77b..eabd36cb78f 100644 --- a/packages/eslint-plugin/docs/rules/no-misused-promises.md +++ b/packages/eslint-plugin/docs/rules/no-misused-promises.md @@ -227,7 +227,8 @@ misuses of them outside of what the TypeScript compiler will check. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-namespace.md b/packages/eslint-plugin/docs/rules/no-namespace.md index dda9b58cc81..f785d38fda8 100644 --- a/packages/eslint-plugin/docs/rules/no-namespace.md +++ b/packages/eslint-plugin/docs/rules/no-namespace.md @@ -138,7 +138,8 @@ If you are using the ES2015 module syntax, then you will not need this rule. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md b/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md index a759e4c039b..3d36d16ef36 100644 --- a/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +++ b/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md @@ -69,7 +69,8 @@ If you are not using TypeScript 3.7 (or greater), then you will not need to use ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md b/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md index 5a0f91d92f2..18bbab165e2 100644 --- a/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +++ b/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md @@ -68,7 +68,8 @@ If you are not using TypeScript 3.7 (or greater), then you will not need to use ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-non-null-assertion.md b/packages/eslint-plugin/docs/rules/no-non-null-assertion.md index 2a098c69ba3..6844c3ff3b3 100644 --- a/packages/eslint-plugin/docs/rules/no-non-null-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-non-null-assertion.md @@ -55,7 +55,8 @@ If you don't care about strict null-checking, then you will not need this rule. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-parameter-properties.md b/packages/eslint-plugin/docs/rules/no-parameter-properties.md index 832df89fee7..aa06f67967a 100644 --- a/packages/eslint-plugin/docs/rules/no-parameter-properties.md +++ b/packages/eslint-plugin/docs/rules/no-parameter-properties.md @@ -402,7 +402,8 @@ If you don't care about the using parameter properties in constructors, then you ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-redeclare.md b/packages/eslint-plugin/docs/rules/no-redeclare.md index bca119c58f9..45d67ee5a89 100644 --- a/packages/eslint-plugin/docs/rules/no-redeclare.md +++ b/packages/eslint-plugin/docs/rules/no-redeclare.md @@ -87,7 +87,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md b/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md index 8201dee9621..099393ffbcc 100644 --- a/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md +++ b/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md @@ -93,7 +93,8 @@ It also does not provide an auto-fixer just yet. ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-require-imports.md b/packages/eslint-plugin/docs/rules/no-require-imports.md index 3c3d65ce591..7645ca54f73 100644 --- a/packages/eslint-plugin/docs/rules/no-require-imports.md +++ b/packages/eslint-plugin/docs/rules/no-require-imports.md @@ -54,7 +54,8 @@ If you don't care about TypeScript module syntax, then you will not need this ru ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-restricted-imports.md b/packages/eslint-plugin/docs/rules/no-restricted-imports.md index 04ebee1b2ce..1878a5fbd39 100644 --- a/packages/eslint-plugin/docs/rules/no-restricted-imports.md +++ b/packages/eslint-plugin/docs/rules/no-restricted-imports.md @@ -71,7 +71,8 @@ export type { Baz } from 'import-baz'; ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-shadow.md b/packages/eslint-plugin/docs/rules/no-shadow.md index 04a585c584e..0c2bc36fafd 100644 --- a/packages/eslint-plugin/docs/rules/no-shadow.md +++ b/packages/eslint-plugin/docs/rules/no-shadow.md @@ -94,7 +94,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-this-alias.md b/packages/eslint-plugin/docs/rules/no-this-alias.md index 7dcd57bf22f..0c4e820d6c8 100644 --- a/packages/eslint-plugin/docs/rules/no-this-alias.md +++ b/packages/eslint-plugin/docs/rules/no-this-alias.md @@ -63,7 +63,8 @@ If you need to assign `this` to variables, you shouldn’t use this rule. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-throw-literal.md b/packages/eslint-plugin/docs/rules/no-throw-literal.md index 1977e04c9b5..3a99996880a 100644 --- a/packages/eslint-plugin/docs/rules/no-throw-literal.md +++ b/packages/eslint-plugin/docs/rules/no-throw-literal.md @@ -119,7 +119,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-type-alias.md b/packages/eslint-plugin/docs/rules/no-type-alias.md index a6a0d57dff9..4cb0f55f793 100644 --- a/packages/eslint-plugin/docs/rules/no-type-alias.md +++ b/packages/eslint-plugin/docs/rules/no-type-alias.md @@ -599,7 +599,8 @@ callback, etc. that would cause the code to be unreadable or impractical. ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md b/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md index 6dcc875dd4f..89325246829 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md @@ -153,7 +153,8 @@ if (!(someNullCondition ?? true)) { ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md index db91e9320e3..d362a13f407 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md @@ -115,7 +115,8 @@ The main downside to using this rule is the need for type information. ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md b/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md index b76773b151f..f5793f4ebb3 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md @@ -99,7 +99,8 @@ If you don't care about having unneeded namespace or enum qualifiers, then you d ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md index 7b87151de8b..c20b93e397d 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md @@ -73,7 +73,8 @@ This rule is not configurable. ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md index 25a1f3fcd4f..53a6cda72d0 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md @@ -80,7 +80,8 @@ If you don't care about having no-op type assertions in your code, then you can ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md index a88294f9a5d..05dc93aaa70 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md @@ -75,7 +75,8 @@ If you don't care about the specific styles of your type constraints, or never u ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-argument.md b/packages/eslint-plugin/docs/rules/no-unsafe-argument.md index c0033ff0a55..8ac5da552dc 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-argument.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-argument.md @@ -91,7 +91,8 @@ This rule is not configurable. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md b/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md index d3b21e3f35d..662d9ba7115 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md @@ -94,7 +94,8 @@ This rule is not configurable. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-call.md b/packages/eslint-plugin/docs/rules/no-unsafe-call.md index 0399e8b2b1c..4d87cc9085f 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-call.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-call.md @@ -68,7 +68,8 @@ This rule is not configurable. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md index 72bda9b125a..d3cf90f63b6 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md @@ -74,7 +74,8 @@ This rule is not configurable. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-return.md b/packages/eslint-plugin/docs/rules/no-unsafe-return.md index 14b195cf8fc..bc67c89ebdd 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-return.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-return.md @@ -111,7 +111,8 @@ This rule is not configurable. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unused-expressions.md b/packages/eslint-plugin/docs/rules/no-unused-expressions.md index a6a58aff4a2..2f6a37046e4 100644 --- a/packages/eslint-plugin/docs/rules/no-unused-expressions.md +++ b/packages/eslint-plugin/docs/rules/no-unused-expressions.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unused-vars.md b/packages/eslint-plugin/docs/rules/no-unused-vars.md index e1e1415a729..b7f85b8b49b 100644 --- a/packages/eslint-plugin/docs/rules/no-unused-vars.md +++ b/packages/eslint-plugin/docs/rules/no-unused-vars.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-use-before-define.md b/packages/eslint-plugin/docs/rules/no-use-before-define.md index 860a00d6a73..cec3d0a908d 100644 --- a/packages/eslint-plugin/docs/rules/no-use-before-define.md +++ b/packages/eslint-plugin/docs/rules/no-use-before-define.md @@ -115,7 +115,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-useless-constructor.md b/packages/eslint-plugin/docs/rules/no-useless-constructor.md index 30cb746a020..1429e32b434 100644 --- a/packages/eslint-plugin/docs/rules/no-useless-constructor.md +++ b/packages/eslint-plugin/docs/rules/no-useless-constructor.md @@ -38,7 +38,8 @@ See [discussion on this rule's lack of type information](https://github.com/type ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-useless-empty-export.md b/packages/eslint-plugin/docs/rules/no-useless-empty-export.md index 4f9273d8f10..29761052596 100644 --- a/packages/eslint-plugin/docs/rules/no-useless-empty-export.md +++ b/packages/eslint-plugin/docs/rules/no-useless-empty-export.md @@ -53,7 +53,8 @@ This rule is not configurable. ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-var-requires.md b/packages/eslint-plugin/docs/rules/no-var-requires.md index c17d816cdd0..83e67d1af8b 100644 --- a/packages/eslint-plugin/docs/rules/no-var-requires.md +++ b/packages/eslint-plugin/docs/rules/no-var-requires.md @@ -49,7 +49,8 @@ If you don't care about TypeScript module syntax, then you will not need this ru ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md b/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md index 5b20d316622..bb8107d4e66 100644 --- a/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +++ b/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md @@ -47,7 +47,8 @@ If you don't mind having unnecessarily verbose type casts, you can avoid this ru ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/object-curly-spacing.md b/packages/eslint-plugin/docs/rules/object-curly-spacing.md index eb351670a4f..bd40cf86394 100644 --- a/packages/eslint-plugin/docs/rules/object-curly-spacing.md +++ b/packages/eslint-plugin/docs/rules/object-curly-spacing.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/padding-line-between-statements.md b/packages/eslint-plugin/docs/rules/padding-line-between-statements.md index fdae8e01de0..31bcee1049d 100644 --- a/packages/eslint-plugin/docs/rules/padding-line-between-statements.md +++ b/packages/eslint-plugin/docs/rules/padding-line-between-statements.md @@ -57,7 +57,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-as-const.md b/packages/eslint-plugin/docs/rules/prefer-as-const.md index 203d3793f11..f0482e3066a 100644 --- a/packages/eslint-plugin/docs/rules/prefer-as-const.md +++ b/packages/eslint-plugin/docs/rules/prefer-as-const.md @@ -50,7 +50,8 @@ If you are using TypeScript < 3.4 ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md b/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md index 64e01338627..caa86d7e540 100644 --- a/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md +++ b/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md @@ -90,7 +90,8 @@ If you don't care about `enum`s having implicit values you can safely disable th ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-for-of.md b/packages/eslint-plugin/docs/rules/prefer-for-of.md index d9db0809b1d..ff26ffa9d7a 100644 --- a/packages/eslint-plugin/docs/rules/prefer-for-of.md +++ b/packages/eslint-plugin/docs/rules/prefer-for-of.md @@ -61,7 +61,8 @@ If you transpile for browsers that do not support for-of loops, you may wish to ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-function-type.md b/packages/eslint-plugin/docs/rules/prefer-function-type.md index 12841ff760a..e99eb5154a4 100644 --- a/packages/eslint-plugin/docs/rules/prefer-function-type.md +++ b/packages/eslint-plugin/docs/rules/prefer-function-type.md @@ -101,7 +101,8 @@ If you specifically want to use an interface or type literal with a single call ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-includes.md b/packages/eslint-plugin/docs/rules/prefer-includes.md index 16884f8bc32..36c167247a4 100644 --- a/packages/eslint-plugin/docs/rules/prefer-includes.md +++ b/packages/eslint-plugin/docs/rules/prefer-includes.md @@ -89,7 +89,8 @@ If you don't want to suggest `includes`, you can safely turn this rule off. ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md b/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md index 6e589ca5190..cffb9569ada 100644 --- a/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md +++ b/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md @@ -99,7 +99,8 @@ If you want use anything other than simple literals as an enum value. ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md b/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md index 0d45a7bcb15..8c82e76f2bd 100644 --- a/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md +++ b/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md @@ -38,7 +38,8 @@ This rule is not configurable. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md b/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md index 61cf9f0d3c7..f349db7a86c 100644 --- a/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +++ b/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md @@ -144,7 +144,8 @@ If you are not using TypeScript 3.7 (or greater), then you will not be able to u ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-optional-chain.md b/packages/eslint-plugin/docs/rules/prefer-optional-chain.md index 82e43651ea9..f285873e166 100644 --- a/packages/eslint-plugin/docs/rules/prefer-optional-chain.md +++ b/packages/eslint-plugin/docs/rules/prefer-optional-chain.md @@ -109,7 +109,8 @@ If you are not using TypeScript 3.7 (or greater), then you will not be able to u ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md b/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md index 63d61b34d78..4382d714b13 100644 --- a/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +++ b/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md @@ -280,7 +280,8 @@ function foo(arg: MyType) {} ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-readonly.md b/packages/eslint-plugin/docs/rules/prefer-readonly.md index 4d01410d324..3aaa045e0ee 100644 --- a/packages/eslint-plugin/docs/rules/prefer-readonly.md +++ b/packages/eslint-plugin/docs/rules/prefer-readonly.md @@ -92,7 +92,8 @@ class Container { ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md b/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md index 247b4fa6777..be739601366 100644 --- a/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +++ b/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md @@ -70,7 +70,8 @@ If you don't want to use typechecking in your linting, you can't use this rule. ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md b/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md index fa4e2c97013..43bf7d4b41d 100644 --- a/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md +++ b/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md @@ -61,7 +61,8 @@ If you prefer consistent use of `String#match` for both, with `g` flag and witho ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-return-this-type.md b/packages/eslint-plugin/docs/rules/prefer-return-this-type.md index 59895c14f40..ea711fad854 100644 --- a/packages/eslint-plugin/docs/rules/prefer-return-this-type.md +++ b/packages/eslint-plugin/docs/rules/prefer-return-this-type.md @@ -112,7 +112,8 @@ If you don't use method chaining or explicit return values, you can safely turn ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md b/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md index 7ecc4c77f4f..0bfbd771287 100644 --- a/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +++ b/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md @@ -64,7 +64,8 @@ If you don't mind that style, you can turn this rule off safely. ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md b/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md index a08980a5505..d38b0058616 100644 --- a/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md +++ b/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md @@ -85,7 +85,8 @@ If you are **NOT** using TypeScript 3.9 (or greater), then you will not be able ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/promise-function-async.md b/packages/eslint-plugin/docs/rules/promise-function-async.md index 7d672981b70..98e1bcf95ba 100644 --- a/packages/eslint-plugin/docs/rules/promise-function-async.md +++ b/packages/eslint-plugin/docs/rules/promise-function-async.md @@ -73,7 +73,8 @@ In addition, each of the following properties may be provided, and default to `t ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/quotes.md b/packages/eslint-plugin/docs/rules/quotes.md index a5637262819..ba2e8ba7364 100644 --- a/packages/eslint-plugin/docs/rules/quotes.md +++ b/packages/eslint-plugin/docs/rules/quotes.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/require-array-sort-compare.md b/packages/eslint-plugin/docs/rules/require-array-sort-compare.md index 129e9dbc7bd..6c1750ebb8c 100644 --- a/packages/eslint-plugin/docs/rules/require-array-sort-compare.md +++ b/packages/eslint-plugin/docs/rules/require-array-sort-compare.md @@ -100,7 +100,8 @@ If you understand the language specification enough, you can turn this rule off ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/require-await.md b/packages/eslint-plugin/docs/rules/require-await.md index 5746f46a042..0cfe4a2b924 100644 --- a/packages/eslint-plugin/docs/rules/require-await.md +++ b/packages/eslint-plugin/docs/rules/require-await.md @@ -39,7 +39,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/restrict-plus-operands.md b/packages/eslint-plugin/docs/rules/restrict-plus-operands.md index 0e98dfdeb36..0c9fd72cbec 100644 --- a/packages/eslint-plugin/docs/rules/restrict-plus-operands.md +++ b/packages/eslint-plugin/docs/rules/restrict-plus-operands.md @@ -107,7 +107,8 @@ var fn = (a: any, b: number) => a + b; ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/restrict-template-expressions.md b/packages/eslint-plugin/docs/rules/restrict-template-expressions.md index cd78738aa06..8cc3b2dade8 100644 --- a/packages/eslint-plugin/docs/rules/restrict-template-expressions.md +++ b/packages/eslint-plugin/docs/rules/restrict-template-expressions.md @@ -111,7 +111,8 @@ const msg1 = `arg = ${arg}`; ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/return-await.md b/packages/eslint-plugin/docs/rules/return-await.md index 620e299c048..a7947399fe2 100644 --- a/packages/eslint-plugin/docs/rules/return-await.md +++ b/packages/eslint-plugin/docs/rules/return-await.md @@ -223,7 +223,8 @@ async function validNever3() { ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/semi.md b/packages/eslint-plugin/docs/rules/semi.md index af7837a214d..279edfa5f38 100644 --- a/packages/eslint-plugin/docs/rules/semi.md +++ b/packages/eslint-plugin/docs/rules/semi.md @@ -33,7 +33,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md b/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md index 0bb006fafcf..eda5da2435c 100644 --- a/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +++ b/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md @@ -154,7 +154,8 @@ The ordering of groups is determined by this option. ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/space-before-blocks.md b/packages/eslint-plugin/docs/rules/space-before-blocks.md index f0b1bbdae95..0de1755826b 100644 --- a/packages/eslint-plugin/docs/rules/space-before-blocks.md +++ b/packages/eslint-plugin/docs/rules/space-before-blocks.md @@ -55,7 +55,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/maste ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/space-before-function-paren.md b/packages/eslint-plugin/docs/rules/space-before-function-paren.md index 9dc01253e25..7b03dcba979 100644 --- a/packages/eslint-plugin/docs/rules/space-before-function-paren.md +++ b/packages/eslint-plugin/docs/rules/space-before-function-paren.md @@ -29,7 +29,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/space-infix-ops.md b/packages/eslint-plugin/docs/rules/space-infix-ops.md index fd2ac74b4c7..26fa5e34ec8 100644 --- a/packages/eslint-plugin/docs/rules/space-infix-ops.md +++ b/packages/eslint-plugin/docs/rules/space-infix-ops.md @@ -33,7 +33,8 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md index 9b3be765cde..f1d25ba595c 100644 --- a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md +++ b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md @@ -200,7 +200,8 @@ This rule provides following fixes and suggestions for particular types in boole ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md b/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md index 549265598c8..8884022bb26 100644 --- a/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +++ b/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md @@ -125,7 +125,8 @@ If program doesn't have union types with many parts. Downside of this rule is th ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/triple-slash-reference.md b/packages/eslint-plugin/docs/rules/triple-slash-reference.md index 73a2aa75735..1dda84ec30d 100644 --- a/packages/eslint-plugin/docs/rules/triple-slash-reference.md +++ b/packages/eslint-plugin/docs/rules/triple-slash-reference.md @@ -59,7 +59,8 @@ If you want to use all flavors of triple slash reference directives. ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/type-annotation-spacing.md b/packages/eslint-plugin/docs/rules/type-annotation-spacing.md index 42792fac4cd..ca6f0152171 100644 --- a/packages/eslint-plugin/docs/rules/type-annotation-spacing.md +++ b/packages/eslint-plugin/docs/rules/type-annotation-spacing.md @@ -314,7 +314,8 @@ If you don't want to enforce spacing for your type annotations, you can safely t ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/typedef.md b/packages/eslint-plugin/docs/rules/typedef.md index 7bf4e40db6f..8f8ed5568c4 100644 --- a/packages/eslint-plugin/docs/rules/typedef.md +++ b/packages/eslint-plugin/docs/rules/typedef.md @@ -343,7 +343,8 @@ In general, if you do not consider the cost of writing unnecessary type annotati ## Attributes -- [ ] ✅ Recommended -- [ ] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [ ] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/unbound-method.md b/packages/eslint-plugin/docs/rules/unbound-method.md index 5143db9ea24..17a968dc689 100644 --- a/packages/eslint-plugin/docs/rules/unbound-method.md +++ b/packages/eslint-plugin/docs/rules/unbound-method.md @@ -121,7 +121,8 @@ If you're wanting to use `toBeCalled` and similar matches in `jest` tests, you c ## Attributes -- [x] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [x] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/unified-signatures.md b/packages/eslint-plugin/docs/rules/unified-signatures.md index dcbd3d4acdc..8a86f114ef7 100644 --- a/packages/eslint-plugin/docs/rules/unified-signatures.md +++ b/packages/eslint-plugin/docs/rules/unified-signatures.md @@ -51,7 +51,8 @@ This rule is not configurable. ## Attributes -- [ ] ✅ Recommended -- [x] ✔ Strict +- Configs: + - [ ] ✅ Recommended + - [x] ✔ Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/tests/docs.test.ts b/packages/eslint-plugin/tests/docs.test.ts index e3fe7fc10c8..201d3876be3 100644 --- a/packages/eslint-plugin/tests/docs.test.ts +++ b/packages/eslint-plugin/tests/docs.test.ts @@ -179,18 +179,24 @@ describe('Validating rule docs', () => { ); expect(attributesHeaderIndex).toBeGreaterThan(-1); - // Verify attributes content + // Verify attributes content... const attributesList = tokenAs( tokens[attributesHeaderIndex + 1], 'list', ); - const recommended = attributesList.items[0]; + // ...starting with configs + const configs = attributesList.items[0]; + expect(configs.text).toMatch(/Configs:\n/); + const configsList = tokenAs(configs.tokens[1], 'list'); + const recommended = configsList.items[0]; expect(shouldBeRecommended(rule.meta.docs)).toBe(recommended.checked); - const strict = attributesList.items[1]; + const strict = configsList.items[1]; expect(shouldBeStrict(rule.meta.docs)).toBe(strict.checked); - const fixable = attributesList.items[2]; + + // Verify other attributes + const fixable = attributesList.items[1]; expect(rule.meta.fixable !== undefined).toBe(fixable.checked); - const requiresTypeChecking = attributesList.items[3]; + const requiresTypeChecking = attributesList.items[2]; expect(rule.meta.docs?.requiresTypeChecking === true).toBe( requiresTypeChecking.checked, ); From 51b19d2b770d077e3a7bb2e5c5f83899d52004ad Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 12 Apr 2022 19:20:30 -0400 Subject: [PATCH 09/20] docs: unified configs readme and presets file --- docs/linting/PRESETS.md | 68 +++++++++++++++----- packages/eslint-plugin/src/configs/README.md | 54 +--------------- 2 files changed, 55 insertions(+), 67 deletions(-) diff --git a/docs/linting/PRESETS.md b/docs/linting/PRESETS.md index cb5f95f0d27..2aeb1e7936d 100644 --- a/docs/linting/PRESETS.md +++ b/docs/linting/PRESETS.md @@ -1,17 +1,38 @@ --- -id: presets -sidebar_label: Presets -title: Presets +id: configurations +sidebar_label: Configurations +title: Configurations --- +## Built-In Configurations + `@typescript-eslint/eslint-plugin` includes three rulesets you can extend from to pull in the recommended starting rules. -### `plugin:@typescript-eslint/recommended` +With the exception of `strict`, all configurations are considered "stable". +Rule additions and removals are treated as breaking changes and will only be done in major version bumps. -Recommended rules for code correctness that you can drop in without additional configuration. -We strongly recommend all TypeScript projects extend from this preset. +### `eslint-recommended` -This preset is considered "stable": rule additions and removals will only be done in major version bumps. +This ruleset is meant to be used after extending `eslint:recommended`. +It disables core ESLint rules that are already checked by the TypeScript compiler. +Additionally, it enables rules that promote using the more modern constructs TypeScript allows for. + +```jsonc +{ + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended" + ] +} +``` + +This config is automatically included if you use any of the other configurations mentioned on this page. + +### `recommended` + +Recommended rules for code correctness that you can drop in without additional configuration. +These rules are those whose reports are almost always for a bad practice and/or likely bug. +`recommended` also disables rules known to conflict with this repository, or cause issues in TypeScript codebases. ```json { @@ -19,7 +40,14 @@ This preset is considered "stable": rule additions and removals will only be don } ``` -### `plugin:@typescript-eslint/recommended-requiring-type-checking` +::tip +We strongly recommend all TypeScript projects extend from this configuration. +:: + +### `recommended-requiring-type-checking` + +Additional recommended rules that require type information. +Rules in this configuration are similarly useful to those in `recommended`. ```json { @@ -30,13 +58,14 @@ This preset is considered "stable": rule additions and removals will only be don } ``` -Additional recommended rules that require type information. -We recommend all TypeScript projects extend from this preset, with the caveat that rules using type information take longer to run. +::tip +We recommend all TypeScript projects extend from this configuration, with the caveat that rules using type information take longer to run. See [Linting with Type Information](/docs/linting/type-linting) for more details. +:: -This preset is considered "stable": rule additions and removals will only be done in major version bumps. +### `strict` -### `plugin:@typescript-eslint/strict` +Additional strict rules that can also catch bugs but are more opinionated than recommended rules. ```json { @@ -48,7 +77,16 @@ This preset is considered "stable": rule additions and removals will only be don } ``` -Additional strict rules that can also catch bugs but are more opinionated than recommended rules. -If you are an experienced TypeScript user, you may find benefit from extending from this preset. +::tip +We recommend a TypeScript project extend from this configuration only if a nontrivial percentage of its developers are highly proficient in TypeScript. +:: + +## Overriding Configurations + +These configurations are our recommended starting points, but **you don't need to use them as-is**. +ESLint allows you to configure your own rule settings on top of any extended configurations. +See [ESLint's Configuring Rules docs](https://eslint.org/docs/user-guide/configuring/rules#using-configuration-files). + +### Suggesting Configuration Changes -This preset is considered "unstable": rule additions and removals may be done in minor or even patch version bumps. +If you feel strongly that a specific rule should (or should not) be one of these configurations, please feel free to [file an issue](TODO: NEW ISSUE TEMPLATE) along with a **detailed** argument explaining your reasoning. diff --git a/packages/eslint-plugin/src/configs/README.md b/packages/eslint-plugin/src/configs/README.md index c3ee9dbddf8..e01337db99b 100644 --- a/packages/eslint-plugin/src/configs/README.md +++ b/packages/eslint-plugin/src/configs/README.md @@ -1,40 +1,6 @@ -# Premade configs +# Premade Configs -These configs exist for your convenience. They contain configuration intended to save you time and effort when configuring your project by disabling rules known to conflict with this repository, or cause issues in TypeScript codebases. - -## `eslint-recommended` - -The `eslint-recommended` ruleset is meant to be used after extending `eslint:recommended`. It disables rules that are already checked by the TypeScript compiler and enables rules that promote using the more modern constructs TypeScript allows for. - -This config is automatically included if you use either the `recommended` or `recommended-requiring-type-checking` configs. - -```jsonc -{ - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended" - ] -} -``` - -We will not add new rules to the `eslint-recommended` set unless we release a major package version (i.e. it is seen as a breaking change). - -## `recommended` - -The `recommended` set is an **_opinionated_** set of rules that we think you should use because: - -1. They help you adhere to TypeScript best practices. -2. They help catch probable issue vectors in your code. - -That being said, it is not the only way to use `@typescript-eslint/eslint-plugin`, nor is it the way that will necessarily work 100% for your project/company. It has been built based off of two main things: - -1. TypeScript best practices collected and collated from places like: - - [TypeScript repo](https://github.com/Microsoft/TypeScript). - - [TypeScript documentation](https://www.typescriptlang.org/docs/home.html). - - The style used by many OSS TypeScript projects. -2. The combined state of community contributed rulesets at the time of creation. - -We will not add new rules to the `recommended` set unless we release a major package version (i.e. it is seen as a breaking change). +This page has moved to [docs/linting/PRESETS.md](../../../../docs/linting/PRESETS.md). ### Altering the `recommended` set to suit your project @@ -51,19 +17,3 @@ If you disagree with a rule (or it disagrees with your codebase), consider using ``` ### Suggesting changes to the `recommended` set - - -If you feel _very_, **very**, ***very*** strongly that a specific rule should (or should not) be in the recommended ruleset, please feel free to file an issue along with a **detailed** argument explaining your reasoning. We expect to see you citing concrete evidence supporting why (or why not) a rule is considered best practice. **Please note that if your reasoning is along the lines of "it's what my project/company does", or "I don't like the rule", then we will likely close the request without discussion.** - -## `recommended-requiring-type-checking` - -Similar to `recommended`, the `recommended-requiring-type-checking` set is an **_opinionated_** set of rules. The difference being that all rules in this set will require type information to use. - -We will not add new rules to the `recommended-requiring-type-checking` set unless we release a major package version (i.e. it is seen as a breaking change). - -## `all` - -The `all` set simply contains every single rule in this plugin, turn on with its default configuration. -There may be some conflicts between the rules as defaults do not quite align - please file an issue if you encounter any of these. - -This set is considered unstable, as any new rules will be added with only a minor package version bump. From 48d72250690642d0521f25a533ce1c9f957f026f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 12 Apr 2022 19:50:30 -0400 Subject: [PATCH 10/20] docs: finish trimming configs readme --- packages/eslint-plugin/src/configs/README.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/packages/eslint-plugin/src/configs/README.md b/packages/eslint-plugin/src/configs/README.md index e01337db99b..5e7a50e4d8a 100644 --- a/packages/eslint-plugin/src/configs/README.md +++ b/packages/eslint-plugin/src/configs/README.md @@ -1,19 +1,3 @@ # Premade Configs This page has moved to [docs/linting/PRESETS.md](../../../../docs/linting/PRESETS.md). - -### Altering the `recommended` set to suit your project - -If you disagree with a rule (or it disagrees with your codebase), consider using your local config to change the rule config so it works for your project. - -```jsonc -{ - "extends": ["plugin:@typescript-eslint/recommended"], - "rules": { - // our project thinks using IPrefixedInterfaces is a good practice - "@typescript-eslint/interface-name-prefix": ["error", "always"] - } -} -``` - -### Suggesting changes to the `recommended` set From c9d67dc724ef6af1f9bb5300c6ef7c87853edd6a Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 12 Apr 2022 20:13:10 -0400 Subject: [PATCH 11/20] fix: sidebar.base.js --- packages/website/sidebars/sidebar.base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/sidebars/sidebar.base.js b/packages/website/sidebars/sidebar.base.js index 942fd98e405..8fbf27e2dc9 100644 --- a/packages/website/sidebars/sidebar.base.js +++ b/packages/website/sidebars/sidebar.base.js @@ -8,7 +8,7 @@ module.exports = { items: [ 'linting/linting', 'linting/type-linting', - 'linting/presets', + 'linting/configs', 'linting/monorepo', 'linting/troubleshooting', 'linting/tslint', From a5134bdddb22725fbed3e07c507b748d0a2536f2 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 12 Apr 2022 20:21:28 -0400 Subject: [PATCH 12/20] fix: finish renaming presets to config --- docs/linting/{PRESETS.md => CONFIGS.md} | 0 packages/eslint-plugin/src/configs/README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename docs/linting/{PRESETS.md => CONFIGS.md} (100%) diff --git a/docs/linting/PRESETS.md b/docs/linting/CONFIGS.md similarity index 100% rename from docs/linting/PRESETS.md rename to docs/linting/CONFIGS.md diff --git a/packages/eslint-plugin/src/configs/README.md b/packages/eslint-plugin/src/configs/README.md index 5e7a50e4d8a..c440d3d61c5 100644 --- a/packages/eslint-plugin/src/configs/README.md +++ b/packages/eslint-plugin/src/configs/README.md @@ -1,3 +1,3 @@ # Premade Configs -This page has moved to [docs/linting/PRESETS.md](../../../../docs/linting/PRESETS.md). +This page has moved to [docs/linting/CONFIGS.md](../../../../docs/linting/CONFIGS.md). From 009bc6d43bef100ff3c9a49a164a2d1f3c827b0c Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 12 Apr 2022 21:02:53 -0400 Subject: [PATCH 13/20] fix: configs docs id --- docs/linting/CONFIGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/linting/CONFIGS.md b/docs/linting/CONFIGS.md index 2aeb1e7936d..7bdbd6ee041 100644 --- a/docs/linting/CONFIGS.md +++ b/docs/linting/CONFIGS.md @@ -1,5 +1,5 @@ --- -id: configurations +id: configs sidebar_label: Configurations title: Configurations --- From 789cab6d2663f37df5d87b7dc91c21cc09a78f74 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 12 Apr 2022 21:23:08 -0400 Subject: [PATCH 14/20] fix: typo; not 'three' --- docs/linting/CONFIGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/linting/CONFIGS.md b/docs/linting/CONFIGS.md index 7bdbd6ee041..4d6c2311027 100644 --- a/docs/linting/CONFIGS.md +++ b/docs/linting/CONFIGS.md @@ -6,7 +6,7 @@ title: Configurations ## Built-In Configurations -`@typescript-eslint/eslint-plugin` includes three rulesets you can extend from to pull in the recommended starting rules. +`@typescript-eslint/eslint-plugin` includes built-in configurations you can extend from to pull in the recommended starting rules. With the exception of `strict`, all configurations are considered "stable". Rule additions and removals are treated as breaking changes and will only be done in major version bumps. From d5773321229ef60dab486a79bdd8d2ac174b150b Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 12 Apr 2022 21:24:04 -0400 Subject: [PATCH 15/20] fix: tip colons --- docs/linting/CONFIGS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/linting/CONFIGS.md b/docs/linting/CONFIGS.md index 4d6c2311027..51ef4957b34 100644 --- a/docs/linting/CONFIGS.md +++ b/docs/linting/CONFIGS.md @@ -42,7 +42,7 @@ These rules are those whose reports are almost always for a bad practice and/or ::tip We strongly recommend all TypeScript projects extend from this configuration. -:: +::: ### `recommended-requiring-type-checking` @@ -61,7 +61,7 @@ Rules in this configuration are similarly useful to those in `recommended`. ::tip We recommend all TypeScript projects extend from this configuration, with the caveat that rules using type information take longer to run. See [Linting with Type Information](/docs/linting/type-linting) for more details. -:: +::: ### `strict` @@ -79,7 +79,7 @@ Additional strict rules that can also catch bugs but are more opinionated than r ::tip We recommend a TypeScript project extend from this configuration only if a nontrivial percentage of its developers are highly proficient in TypeScript. -:: +::: ## Overriding Configurations From 3bebc550be4a75df46ef10ea306ad01ca6787b2e Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 15 May 2022 15:31:25 -0400 Subject: [PATCH 16/20] chore: replace heavy_check_mark with lock --- packages/eslint-plugin/README.md | 262 +++++++++--------- packages/eslint-plugin/docs/rules/README.md | 258 ++++++++--------- packages/eslint-plugin/docs/rules/TEMPLATE.md | 2 +- .../rules/adjacent-overload-signatures.md | 2 +- .../eslint-plugin/docs/rules/array-type.md | 2 +- .../docs/rules/await-thenable.md | 2 +- .../docs/rules/ban-ts-comment.md | 2 +- .../docs/rules/ban-tslint-comment.md | 2 +- .../eslint-plugin/docs/rules/ban-types.md | 2 +- .../eslint-plugin/docs/rules/brace-style.md | 2 +- .../rules/class-literal-property-style.md | 2 +- .../eslint-plugin/docs/rules/comma-dangle.md | 2 +- .../eslint-plugin/docs/rules/comma-spacing.md | 2 +- .../rules/consistent-indexed-object-style.md | 2 +- .../docs/rules/consistent-type-assertions.md | 2 +- .../docs/rules/consistent-type-definitions.md | 2 +- .../docs/rules/consistent-type-exports.md | 2 +- .../docs/rules/consistent-type-imports.md | 2 +- .../docs/rules/default-param-last.md | 2 +- .../eslint-plugin/docs/rules/dot-notation.md | 2 +- .../rules/explicit-function-return-type.md | 2 +- .../rules/explicit-member-accessibility.md | 2 +- .../rules/explicit-module-boundary-types.md | 2 +- .../docs/rules/func-call-spacing.md | 2 +- packages/eslint-plugin/docs/rules/indent.md | 2 +- .../docs/rules/init-declarations.md | 2 +- .../docs/rules/keyword-spacing.md | 2 +- .../docs/rules/lines-between-class-members.md | 2 +- .../docs/rules/member-delimiter-style.md | 2 +- .../docs/rules/member-ordering.md | 2 +- .../docs/rules/method-signature-style.md | 2 +- .../docs/rules/naming-convention.md | 2 +- .../docs/rules/no-array-constructor.md | 2 +- .../docs/rules/no-base-to-string.md | 2 +- .../rules/no-confusing-non-null-assertion.md | 2 +- .../rules/no-confusing-void-expression.md | 2 +- .../docs/rules/no-dupe-class-members.md | 2 +- .../docs/rules/no-duplicate-imports.md | 2 +- .../docs/rules/no-dynamic-delete.md | 2 +- .../docs/rules/no-empty-function.md | 2 +- .../docs/rules/no-empty-interface.md | 2 +- .../docs/rules/no-explicit-any.md | 2 +- .../docs/rules/no-extra-non-null-assertion.md | 2 +- .../docs/rules/no-extra-parens.md | 2 +- .../eslint-plugin/docs/rules/no-extra-semi.md | 2 +- .../docs/rules/no-extraneous-class.md | 2 +- .../docs/rules/no-floating-promises.md | 2 +- .../docs/rules/no-for-in-array.md | 2 +- .../docs/rules/no-implicit-any-catch.md | 2 +- .../docs/rules/no-implied-eval.md | 2 +- .../docs/rules/no-inferrable-types.md | 2 +- .../docs/rules/no-invalid-this.md | 2 +- .../docs/rules/no-invalid-void-type.md | 2 +- .../eslint-plugin/docs/rules/no-loop-func.md | 2 +- .../docs/rules/no-loss-of-precision.md | 2 +- .../docs/rules/no-magic-numbers.md | 2 +- .../rules/no-meaningless-void-operator.md | 2 +- .../docs/rules/no-misused-new.md | 2 +- .../docs/rules/no-misused-promises.md | 2 +- .../eslint-plugin/docs/rules/no-namespace.md | 2 +- ...no-non-null-asserted-nullish-coalescing.md | 2 +- .../no-non-null-asserted-optional-chain.md | 2 +- .../docs/rules/no-non-null-assertion.md | 2 +- .../docs/rules/no-parameter-properties.md | 2 +- .../eslint-plugin/docs/rules/no-redeclare.md | 2 +- .../rules/no-redundant-type-constituents.md | 2 +- .../docs/rules/no-require-imports.md | 2 +- .../docs/rules/no-restricted-imports.md | 2 +- .../eslint-plugin/docs/rules/no-shadow.md | 2 +- .../eslint-plugin/docs/rules/no-this-alias.md | 2 +- .../docs/rules/no-throw-literal.md | 2 +- .../eslint-plugin/docs/rules/no-type-alias.md | 2 +- .../no-unnecessary-boolean-literal-compare.md | 2 +- .../docs/rules/no-unnecessary-condition.md | 2 +- .../docs/rules/no-unnecessary-qualifier.md | 2 +- .../rules/no-unnecessary-type-arguments.md | 2 +- .../rules/no-unnecessary-type-assertion.md | 2 +- .../rules/no-unnecessary-type-constraint.md | 2 +- .../docs/rules/no-unsafe-argument.md | 2 +- .../docs/rules/no-unsafe-assignment.md | 2 +- .../docs/rules/no-unsafe-call.md | 2 +- .../docs/rules/no-unsafe-member-access.md | 2 +- .../docs/rules/no-unsafe-return.md | 2 +- .../docs/rules/no-unused-expressions.md | 2 +- .../docs/rules/no-unused-vars.md | 2 +- .../docs/rules/no-use-before-define.md | 2 +- .../docs/rules/no-useless-constructor.md | 2 +- .../docs/rules/no-useless-empty-export.md | 2 +- .../docs/rules/no-var-requires.md | 2 +- .../non-nullable-type-assertion-style.md | 2 +- .../docs/rules/object-curly-spacing.md | 2 +- .../rules/padding-line-between-statements.md | 2 +- .../docs/rules/prefer-as-const.md | 2 +- .../docs/rules/prefer-enum-initializers.md | 2 +- .../eslint-plugin/docs/rules/prefer-for-of.md | 2 +- .../docs/rules/prefer-function-type.md | 2 +- .../docs/rules/prefer-includes.md | 2 +- .../docs/rules/prefer-literal-enum-member.md | 2 +- .../docs/rules/prefer-namespace-keyword.md | 2 +- .../docs/rules/prefer-nullish-coalescing.md | 2 +- .../docs/rules/prefer-optional-chain.md | 2 +- .../rules/prefer-readonly-parameter-types.md | 2 +- .../docs/rules/prefer-readonly.md | 2 +- .../rules/prefer-reduce-type-parameter.md | 2 +- .../docs/rules/prefer-regexp-exec.md | 2 +- .../docs/rules/prefer-return-this-type.md | 2 +- .../rules/prefer-string-starts-ends-with.md | 2 +- .../docs/rules/prefer-ts-expect-error.md | 2 +- .../docs/rules/promise-function-async.md | 2 +- packages/eslint-plugin/docs/rules/quotes.md | 2 +- .../docs/rules/require-array-sort-compare.md | 2 +- .../eslint-plugin/docs/rules/require-await.md | 2 +- .../docs/rules/restrict-plus-operands.md | 2 +- .../rules/restrict-template-expressions.md | 2 +- .../eslint-plugin/docs/rules/return-await.md | 2 +- packages/eslint-plugin/docs/rules/semi.md | 2 +- .../sort-type-union-intersection-members.md | 2 +- .../docs/rules/space-before-blocks.md | 2 +- .../docs/rules/space-before-function-paren.md | 2 +- .../docs/rules/space-infix-ops.md | 2 +- .../docs/rules/strict-boolean-expressions.md | 2 +- .../docs/rules/switch-exhaustiveness-check.md | 2 +- .../docs/rules/triple-slash-reference.md | 2 +- .../docs/rules/type-annotation-spacing.md | 2 +- packages/eslint-plugin/docs/rules/typedef.md | 2 +- .../docs/rules/unbound-method.md | 2 +- .../docs/rules/unified-signatures.md | 2 +- packages/eslint-plugin/tests/docs.test.ts | 2 +- .../tools/generate-rules-lists.ts | 4 +- packages/utils/src/ts-eslint/Rule.ts | 2 +- 130 files changed, 389 insertions(+), 389 deletions(-) diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index c090a94c60c..696cee8cba8 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -93,95 +93,95 @@ Pro Tip: For larger codebases you may want to consider splitting our linting int -**Key**: :white_check_mark: = recommended, :heavy_check_mark: = strict, :wrench: = fixable, :thought_balloon: = requires type information - -| Name | Description | :white_check_mark::heavy_check_mark: | :wrench: | :thought_balloon: | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | -------- | ----------------- | -| [`@typescript-eslint/adjacent-overload-signatures`](./docs/rules/adjacent-overload-signatures.md) | Require that member overloads be consecutive | :white_check_mark: | | | -| [`@typescript-eslint/array-type`](./docs/rules/array-type.md) | Requires using either `T[]` or `Array` for arrays | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/await-thenable`](./docs/rules/await-thenable.md) | Disallows awaiting a value that is not a Thenable | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/ban-ts-comment`](./docs/rules/ban-ts-comment.md) | Bans `@ts-` comments from being used or requires descriptions after directive | :white_check_mark: | | | -| [`@typescript-eslint/ban-tslint-comment`](./docs/rules/ban-tslint-comment.md) | Bans `// tslint:` comments from being used | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Bans specific types from being used | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/class-literal-property-style`](./docs/rules/class-literal-property-style.md) | Ensures that literals on classes are exposed in a consistent style | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/consistent-indexed-object-style`](./docs/rules/consistent-indexed-object-style.md) | Enforce or disallow the use of the record type | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/consistent-type-assertions`](./docs/rules/consistent-type-assertions.md) | Enforces consistent usage of type assertions | :heavy_check_mark: | | | -| [`@typescript-eslint/consistent-type-definitions`](./docs/rules/consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/consistent-type-exports`](./docs/rules/consistent-type-exports.md) | Enforces consistent usage of type exports | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/consistent-type-imports`](./docs/rules/consistent-type-imports.md) | Enforces consistent usage of type imports | | :wrench: | | -| [`@typescript-eslint/explicit-function-return-type`](./docs/rules/explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | -| [`@typescript-eslint/explicit-member-accessibility`](./docs/rules/explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | -| [`@typescript-eslint/explicit-module-boundary-types`](./docs/rules/explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | -| [`@typescript-eslint/member-delimiter-style`](./docs/rules/member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | -| [`@typescript-eslint/member-ordering`](./docs/rules/member-ordering.md) | Require a consistent member declaration order | | | | -| [`@typescript-eslint/method-signature-style`](./docs/rules/method-signature-style.md) | Enforces using a particular method signature syntax. | | :wrench: | | -| [`@typescript-eslint/naming-convention`](./docs/rules/naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | -| [`@typescript-eslint/no-base-to-string`](./docs/rules/no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | :heavy_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-confusing-non-null-assertion`](./docs/rules/no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/no-confusing-void-expression`](./docs/rules/no-confusing-void-expression.md) | Requires expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-dynamic-delete`](./docs/rules/no-dynamic-delete.md) | Disallow the delete operator with computed key expressions | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/no-empty-interface`](./docs/rules/no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-explicit-any`](./docs/rules/no-explicit-any.md) | Disallow usage of the `any` type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extra-non-null-assertion`](./docs/rules/no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extraneous-class`](./docs/rules/no-extraneous-class.md) | Forbids the use of classes as namespaces | :heavy_check_mark: | | | -| [`@typescript-eslint/no-floating-promises`](./docs/rules/no-floating-promises.md) | Requires Promise-like statements to be handled appropriately | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-for-in-array`](./docs/rules/no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-inferrable-types`](./docs/rules/no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-invalid-void-type`](./docs/rules/no-invalid-void-type.md) | Disallows usage of `void` type outside of generic or return types | :heavy_check_mark: | | | -| [`@typescript-eslint/no-meaningless-void-operator`](./docs/rules/no-meaningless-void-operator.md) | Disallow the `void` operator except when used to discard a value | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-misused-new`](./docs/rules/no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :white_check_mark: | | | -| [`@typescript-eslint/no-misused-promises`](./docs/rules/no-misused-promises.md) | Avoid using Promises in places not designed to handle them | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-namespace`](./docs/rules/no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./docs/rules/no-non-null-asserted-nullish-coalescing.md) | Disallows using a non-null assertion in the left operand of the nullish coalescing operator | :heavy_check_mark: | | | -| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./docs/rules/no-non-null-asserted-optional-chain.md) | Disallows using a non-null assertion after an optional chain expression | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-assertion`](./docs/rules/no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :white_check_mark: | | | -| [`@typescript-eslint/no-parameter-properties`](./docs/rules/no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | | -| [`@typescript-eslint/no-redundant-type-constituents`](./docs/rules/no-redundant-type-constituents.md) | Disallow members of unions and intersections that do nothing or override type information | | | :thought_balloon: | -| [`@typescript-eslint/no-require-imports`](./docs/rules/no-require-imports.md) | Disallows invocation of `require()` | | | | -| [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | -| [`@typescript-eslint/no-type-alias`](./docs/rules/no-type-alias.md) | Disallow the use of type aliases | | | | -| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./docs/rules/no-unnecessary-boolean-literal-compare.md) | Flags unnecessary equality comparisons against boolean literals | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-condition`](./docs/rules/no-unnecessary-condition.md) | Prevents conditionals where the type is always truthy or always falsy | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-qualifier`](./docs/rules/no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-arguments`](./docs/rules/no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-assertion`](./docs/rules/no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-constraint`](./docs/rules/no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-unsafe-argument`](./docs/rules/no-unsafe-argument.md) | Disallows calling a function with an any type value | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-assignment`](./docs/rules/no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-call`](./docs/rules/no-unsafe-call.md) | Disallows calling an any type value | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-member-access`](./docs/rules/no-unsafe-member-access.md) | Disallows member access on any typed variables | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-return`](./docs/rules/no-unsafe-return.md) | Disallows returning any from a function | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-useless-empty-export`](./docs/rules/no-useless-empty-export.md) | Disallow empty exports that don't change anything in a module file | | :wrench: | | -| [`@typescript-eslint/no-var-requires`](./docs/rules/no-var-requires.md) | Disallows the use of require statements except in import statements | :white_check_mark: | | | -| [`@typescript-eslint/non-nullable-type-assertion-style`](./docs/rules/non-nullable-type-assertion-style.md) | Prefers a non-null assertion over explicit type cast when possible | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-as-const`](./docs/rules/prefer-as-const.md) | Prefer usage of `as const` over literal type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-enum-initializers`](./docs/rules/prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | -| [`@typescript-eslint/prefer-for-of`](./docs/rules/prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | :heavy_check_mark: | | | -| [`@typescript-eslint/prefer-function-type`](./docs/rules/prefer-function-type.md) | Use function types instead of interfaces with call signatures | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-includes`](./docs/rules/prefer-includes.md) | Enforce `includes` method over `indexOf` method | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-literal-enum-member`](./docs/rules/prefer-literal-enum-member.md) | Require that all enum members be literal values to prevent unintended enum member name shadow issues | :heavy_check_mark: | | | -| [`@typescript-eslint/prefer-namespace-keyword`](./docs/rules/prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-nullish-coalescing`](./docs/rules/prefer-nullish-coalescing.md) | Enforce the usage of the nullish coalescing operator instead of logical chaining | :heavy_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/prefer-optional-chain`](./docs/rules/prefer-optional-chain.md) | Prefer using concise optional chain expressions instead of chained logical ands | :heavy_check_mark: | | | -| [`@typescript-eslint/prefer-readonly`](./docs/rules/prefer-readonly.md) | Requires that private members are marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-readonly-parameter-types`](./docs/rules/prefer-readonly-parameter-types.md) | Requires that function parameters are typed as readonly to prevent accidental mutation of inputs | | | :thought_balloon: | -| [`@typescript-eslint/prefer-reduce-type-parameter`](./docs/rules/prefer-reduce-type-parameter.md) | Prefer using type parameter when calling `Array#reduce` instead of casting | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-regexp-exec`](./docs/rules/prefer-regexp-exec.md) | Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-return-this-type`](./docs/rules/prefer-return-this-type.md) | Enforce that `this` is used when only `this` type is returned | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-string-starts-ends-with`](./docs/rules/prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-ts-expect-error`](./docs/rules/prefer-ts-expect-error.md) | Recommends using `@ts-expect-error` over `@ts-ignore` | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/promise-function-async`](./docs/rules/promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/require-array-sort-compare`](./docs/rules/require-array-sort-compare.md) | Requires `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | -| [`@typescript-eslint/restrict-plus-operands`](./docs/rules/restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/restrict-template-expressions`](./docs/rules/restrict-template-expressions.md) | Enforce template literal expressions to be of string type | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/sort-type-union-intersection-members`](./docs/rules/sort-type-union-intersection-members.md) | Enforces that members of a type union/intersection are sorted alphabetically | | :wrench: | | -| [`@typescript-eslint/strict-boolean-expressions`](./docs/rules/strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/switch-exhaustiveness-check`](./docs/rules/switch-exhaustiveness-check.md) | Exhaustiveness checking in switch with union type | | | :thought_balloon: | -| [`@typescript-eslint/triple-slash-reference`](./docs/rules/triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :white_check_mark: | | | -| [`@typescript-eslint/type-annotation-spacing`](./docs/rules/type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | -| [`@typescript-eslint/typedef`](./docs/rules/typedef.md) | Requires type annotations to exist | | | | -| [`@typescript-eslint/unbound-method`](./docs/rules/unbound-method.md) | Enforces unbound methods are called with their expected scope | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/unified-signatures`](./docs/rules/unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | :heavy_check_mark: | | | +**Key**: :white_check_mark: = recommended, :lock: = strict, :wrench: = fixable, :thought_balloon: = requires type information + +| Name | Description | :white_check_mark::lock: | :wrench: | :thought_balloon: | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------ | -------- | ----------------- | +| [`@typescript-eslint/adjacent-overload-signatures`](./docs/rules/adjacent-overload-signatures.md) | Require that member overloads be consecutive | :white_check_mark: | | | +| [`@typescript-eslint/array-type`](./docs/rules/array-type.md) | Requires using either `T[]` or `Array` for arrays | :lock: | :wrench: | | +| [`@typescript-eslint/await-thenable`](./docs/rules/await-thenable.md) | Disallows awaiting a value that is not a Thenable | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/ban-ts-comment`](./docs/rules/ban-ts-comment.md) | Bans `@ts-` comments from being used or requires descriptions after directive | :white_check_mark: | | | +| [`@typescript-eslint/ban-tslint-comment`](./docs/rules/ban-tslint-comment.md) | Bans `// tslint:` comments from being used | :lock: | :wrench: | | +| [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Bans specific types from being used | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/class-literal-property-style`](./docs/rules/class-literal-property-style.md) | Ensures that literals on classes are exposed in a consistent style | :lock: | :wrench: | | +| [`@typescript-eslint/consistent-indexed-object-style`](./docs/rules/consistent-indexed-object-style.md) | Enforce or disallow the use of the record type | :lock: | :wrench: | | +| [`@typescript-eslint/consistent-type-assertions`](./docs/rules/consistent-type-assertions.md) | Enforces consistent usage of type assertions | :lock: | | | +| [`@typescript-eslint/consistent-type-definitions`](./docs/rules/consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | :lock: | :wrench: | | +| [`@typescript-eslint/consistent-type-exports`](./docs/rules/consistent-type-exports.md) | Enforces consistent usage of type exports | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/consistent-type-imports`](./docs/rules/consistent-type-imports.md) | Enforces consistent usage of type imports | | :wrench: | | +| [`@typescript-eslint/explicit-function-return-type`](./docs/rules/explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | +| [`@typescript-eslint/explicit-member-accessibility`](./docs/rules/explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | +| [`@typescript-eslint/explicit-module-boundary-types`](./docs/rules/explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | +| [`@typescript-eslint/member-delimiter-style`](./docs/rules/member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | +| [`@typescript-eslint/member-ordering`](./docs/rules/member-ordering.md) | Require a consistent member declaration order | | | | +| [`@typescript-eslint/method-signature-style`](./docs/rules/method-signature-style.md) | Enforces using a particular method signature syntax. | | :wrench: | | +| [`@typescript-eslint/naming-convention`](./docs/rules/naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | +| [`@typescript-eslint/no-base-to-string`](./docs/rules/no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | :lock: | | :thought_balloon: | +| [`@typescript-eslint/no-confusing-non-null-assertion`](./docs/rules/no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | :lock: | :wrench: | | +| [`@typescript-eslint/no-confusing-void-expression`](./docs/rules/no-confusing-void-expression.md) | Requires expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-dynamic-delete`](./docs/rules/no-dynamic-delete.md) | Disallow the delete operator with computed key expressions | :lock: | :wrench: | | +| [`@typescript-eslint/no-empty-interface`](./docs/rules/no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-explicit-any`](./docs/rules/no-explicit-any.md) | Disallow usage of the `any` type | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-extra-non-null-assertion`](./docs/rules/no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-extraneous-class`](./docs/rules/no-extraneous-class.md) | Forbids the use of classes as namespaces | :lock: | | | +| [`@typescript-eslint/no-floating-promises`](./docs/rules/no-floating-promises.md) | Requires Promise-like statements to be handled appropriately | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-for-in-array`](./docs/rules/no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-inferrable-types`](./docs/rules/no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-invalid-void-type`](./docs/rules/no-invalid-void-type.md) | Disallows usage of `void` type outside of generic or return types | :lock: | | | +| [`@typescript-eslint/no-meaningless-void-operator`](./docs/rules/no-meaningless-void-operator.md) | Disallow the `void` operator except when used to discard a value | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-misused-new`](./docs/rules/no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :white_check_mark: | | | +| [`@typescript-eslint/no-misused-promises`](./docs/rules/no-misused-promises.md) | Avoid using Promises in places not designed to handle them | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-namespace`](./docs/rules/no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :white_check_mark: | | | +| [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./docs/rules/no-non-null-asserted-nullish-coalescing.md) | Disallows using a non-null assertion in the left operand of the nullish coalescing operator | :lock: | | | +| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./docs/rules/no-non-null-asserted-optional-chain.md) | Disallows using a non-null assertion after an optional chain expression | :white_check_mark: | | | +| [`@typescript-eslint/no-non-null-assertion`](./docs/rules/no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :white_check_mark: | | | +| [`@typescript-eslint/no-parameter-properties`](./docs/rules/no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | | +| [`@typescript-eslint/no-redundant-type-constituents`](./docs/rules/no-redundant-type-constituents.md) | Disallow members of unions and intersections that do nothing or override type information | | | :thought_balloon: | +| [`@typescript-eslint/no-require-imports`](./docs/rules/no-require-imports.md) | Disallows invocation of `require()` | | | | +| [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | +| [`@typescript-eslint/no-type-alias`](./docs/rules/no-type-alias.md) | Disallow the use of type aliases | | | | +| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./docs/rules/no-unnecessary-boolean-literal-compare.md) | Flags unnecessary equality comparisons against boolean literals | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-condition`](./docs/rules/no-unnecessary-condition.md) | Prevents conditionals where the type is always truthy or always falsy | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-qualifier`](./docs/rules/no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-arguments`](./docs/rules/no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-assertion`](./docs/rules/no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-constraint`](./docs/rules/no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-unsafe-argument`](./docs/rules/no-unsafe-argument.md) | Disallows calling a function with an any type value | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-assignment`](./docs/rules/no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-call`](./docs/rules/no-unsafe-call.md) | Disallows calling an any type value | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-member-access`](./docs/rules/no-unsafe-member-access.md) | Disallows member access on any typed variables | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-return`](./docs/rules/no-unsafe-return.md) | Disallows returning any from a function | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-useless-empty-export`](./docs/rules/no-useless-empty-export.md) | Disallow empty exports that don't change anything in a module file | | :wrench: | | +| [`@typescript-eslint/no-var-requires`](./docs/rules/no-var-requires.md) | Disallows the use of require statements except in import statements | :white_check_mark: | | | +| [`@typescript-eslint/non-nullable-type-assertion-style`](./docs/rules/non-nullable-type-assertion-style.md) | Prefers a non-null assertion over explicit type cast when possible | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-as-const`](./docs/rules/prefer-as-const.md) | Prefer usage of `as const` over literal type | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-enum-initializers`](./docs/rules/prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | +| [`@typescript-eslint/prefer-for-of`](./docs/rules/prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | :lock: | | | +| [`@typescript-eslint/prefer-function-type`](./docs/rules/prefer-function-type.md) | Use function types instead of interfaces with call signatures | :lock: | :wrench: | | +| [`@typescript-eslint/prefer-includes`](./docs/rules/prefer-includes.md) | Enforce `includes` method over `indexOf` method | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-literal-enum-member`](./docs/rules/prefer-literal-enum-member.md) | Require that all enum members be literal values to prevent unintended enum member name shadow issues | :lock: | | | +| [`@typescript-eslint/prefer-namespace-keyword`](./docs/rules/prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-nullish-coalescing`](./docs/rules/prefer-nullish-coalescing.md) | Enforce the usage of the nullish coalescing operator instead of logical chaining | :lock: | | :thought_balloon: | +| [`@typescript-eslint/prefer-optional-chain`](./docs/rules/prefer-optional-chain.md) | Prefer using concise optional chain expressions instead of chained logical ands | :lock: | | | +| [`@typescript-eslint/prefer-readonly`](./docs/rules/prefer-readonly.md) | Requires that private members are marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-readonly-parameter-types`](./docs/rules/prefer-readonly-parameter-types.md) | Requires that function parameters are typed as readonly to prevent accidental mutation of inputs | | | :thought_balloon: | +| [`@typescript-eslint/prefer-reduce-type-parameter`](./docs/rules/prefer-reduce-type-parameter.md) | Prefer using type parameter when calling `Array#reduce` instead of casting | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-regexp-exec`](./docs/rules/prefer-regexp-exec.md) | Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-return-this-type`](./docs/rules/prefer-return-this-type.md) | Enforce that `this` is used when only `this` type is returned | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-string-starts-ends-with`](./docs/rules/prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-ts-expect-error`](./docs/rules/prefer-ts-expect-error.md) | Recommends using `@ts-expect-error` over `@ts-ignore` | :lock: | :wrench: | | +| [`@typescript-eslint/promise-function-async`](./docs/rules/promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/require-array-sort-compare`](./docs/rules/require-array-sort-compare.md) | Requires `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | +| [`@typescript-eslint/restrict-plus-operands`](./docs/rules/restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/restrict-template-expressions`](./docs/rules/restrict-template-expressions.md) | Enforce template literal expressions to be of string type | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/sort-type-union-intersection-members`](./docs/rules/sort-type-union-intersection-members.md) | Enforces that members of a type union/intersection are sorted alphabetically | | :wrench: | | +| [`@typescript-eslint/strict-boolean-expressions`](./docs/rules/strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/switch-exhaustiveness-check`](./docs/rules/switch-exhaustiveness-check.md) | Exhaustiveness checking in switch with union type | | | :thought_balloon: | +| [`@typescript-eslint/triple-slash-reference`](./docs/rules/triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :white_check_mark: | | | +| [`@typescript-eslint/type-annotation-spacing`](./docs/rules/type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | +| [`@typescript-eslint/typedef`](./docs/rules/typedef.md) | Requires type annotations to exist | | | | +| [`@typescript-eslint/unbound-method`](./docs/rules/unbound-method.md) | Enforces unbound methods are called with their expected scope | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/unified-signatures`](./docs/rules/unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | :lock: | | | @@ -192,48 +192,48 @@ In these cases, we create what we call an extension rule; a rule within our plug -**Key**: :white_check_mark: = recommended, :heavy_check_mark: = strict, :wrench: = fixable, :thought_balloon: = requires type information - -| Name | Description | :white_check_mark::heavy_check_mark: | :wrench: | :thought_balloon: | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------ | -------- | ----------------- | -| [`@typescript-eslint/brace-style`](./docs/rules/brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | -| [`@typescript-eslint/comma-dangle`](./docs/rules/comma-dangle.md) | Require or disallow trailing comma | | :wrench: | | -| [`@typescript-eslint/comma-spacing`](./docs/rules/comma-spacing.md) | Enforces consistent spacing before and after commas | | :wrench: | | -| [`@typescript-eslint/default-param-last`](./docs/rules/default-param-last.md) | Enforce default parameters to be last | | | | -| [`@typescript-eslint/dot-notation`](./docs/rules/dot-notation.md) | enforce dot notation whenever possible | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/func-call-spacing`](./docs/rules/func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | -| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | | :wrench: | | -| [`@typescript-eslint/init-declarations`](./docs/rules/init-declarations.md) | require or disallow initialization in variable declarations | | | | -| [`@typescript-eslint/keyword-spacing`](./docs/rules/keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | -| [`@typescript-eslint/lines-between-class-members`](./docs/rules/lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | -| [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-dupe-class-members`](./docs/rules/no-dupe-class-members.md) | Disallow duplicate class members | | | | -| [`@typescript-eslint/no-duplicate-imports`](./docs/rules/no-duplicate-imports.md) | Disallow duplicate imports | | | | -| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :white_check_mark: | | | -| [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | -| [`@typescript-eslint/no-extra-semi`](./docs/rules/no-extra-semi.md) | Disallow unnecessary semicolons | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-implied-eval`](./docs/rules/no-implied-eval.md) | Disallow the use of `eval()`-like methods | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-invalid-this`](./docs/rules/no-invalid-this.md) | Disallow `this` keywords outside of classes or class-like objects | | | | -| [`@typescript-eslint/no-loop-func`](./docs/rules/no-loop-func.md) | Disallow function declarations that contain unsafe references inside loop statements | | | | -| [`@typescript-eslint/no-loss-of-precision`](./docs/rules/no-loss-of-precision.md) | Disallow literal numbers that lose precision | :white_check_mark: | | | -| [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallow magic numbers | | | | -| [`@typescript-eslint/no-redeclare`](./docs/rules/no-redeclare.md) | Disallow variable redeclaration | | | | -| [`@typescript-eslint/no-restricted-imports`](./docs/rules/no-restricted-imports.md) | Disallow specified modules when loaded by `import` | | | | -| [`@typescript-eslint/no-shadow`](./docs/rules/no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | -| [`@typescript-eslint/no-throw-literal`](./docs/rules/no-throw-literal.md) | Disallow throwing literals as exceptions | :heavy_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unused-expressions`](./docs/rules/no-unused-expressions.md) | Disallow unused expressions | | | | -| [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables | :white_check_mark: | | | -| [`@typescript-eslint/no-use-before-define`](./docs/rules/no-use-before-define.md) | Disallow the use of variables before they are defined | | | | -| [`@typescript-eslint/no-useless-constructor`](./docs/rules/no-useless-constructor.md) | Disallow unnecessary constructors | :heavy_check_mark: | | | -| [`@typescript-eslint/object-curly-spacing`](./docs/rules/object-curly-spacing.md) | Enforce consistent spacing inside braces | | :wrench: | | -| [`@typescript-eslint/padding-line-between-statements`](./docs/rules/padding-line-between-statements.md) | require or disallow padding lines between statements | | :wrench: | | -| [`@typescript-eslint/quotes`](./docs/rules/quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | -| [`@typescript-eslint/require-await`](./docs/rules/require-await.md) | Disallow async functions which have no `await` expression | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/return-await`](./docs/rules/return-await.md) | Enforces consistent returning of awaited values | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/semi`](./docs/rules/semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | -| [`@typescript-eslint/space-before-blocks`](./docs/rules/space-before-blocks.md) | Enforces consistent spacing before blocks | | :wrench: | | -| [`@typescript-eslint/space-before-function-paren`](./docs/rules/space-before-function-paren.md) | Enforces consistent spacing before function parenthesis | | :wrench: | | -| [`@typescript-eslint/space-infix-ops`](./docs/rules/space-infix-ops.md) | This rule is aimed at ensuring there are spaces around infix operators. | | :wrench: | | +**Key**: :white_check_mark: = recommended, :lock: = strict, :wrench: = fixable, :thought_balloon: = requires type information + +| Name | Description | :white_check_mark::lock: | :wrench: | :thought_balloon: | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------ | -------- | ----------------- | +| [`@typescript-eslint/brace-style`](./docs/rules/brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | +| [`@typescript-eslint/comma-dangle`](./docs/rules/comma-dangle.md) | Require or disallow trailing comma | | :wrench: | | +| [`@typescript-eslint/comma-spacing`](./docs/rules/comma-spacing.md) | Enforces consistent spacing before and after commas | | :wrench: | | +| [`@typescript-eslint/default-param-last`](./docs/rules/default-param-last.md) | Enforce default parameters to be last | | | | +| [`@typescript-eslint/dot-notation`](./docs/rules/dot-notation.md) | enforce dot notation whenever possible | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/func-call-spacing`](./docs/rules/func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | +| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | | :wrench: | | +| [`@typescript-eslint/init-declarations`](./docs/rules/init-declarations.md) | require or disallow initialization in variable declarations | | | | +| [`@typescript-eslint/keyword-spacing`](./docs/rules/keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | +| [`@typescript-eslint/lines-between-class-members`](./docs/rules/lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | +| [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-dupe-class-members`](./docs/rules/no-dupe-class-members.md) | Disallow duplicate class members | | | | +| [`@typescript-eslint/no-duplicate-imports`](./docs/rules/no-duplicate-imports.md) | Disallow duplicate imports | | | | +| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :white_check_mark: | | | +| [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | +| [`@typescript-eslint/no-extra-semi`](./docs/rules/no-extra-semi.md) | Disallow unnecessary semicolons | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-implied-eval`](./docs/rules/no-implied-eval.md) | Disallow the use of `eval()`-like methods | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-invalid-this`](./docs/rules/no-invalid-this.md) | Disallow `this` keywords outside of classes or class-like objects | | | | +| [`@typescript-eslint/no-loop-func`](./docs/rules/no-loop-func.md) | Disallow function declarations that contain unsafe references inside loop statements | | | | +| [`@typescript-eslint/no-loss-of-precision`](./docs/rules/no-loss-of-precision.md) | Disallow literal numbers that lose precision | :white_check_mark: | | | +| [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallow magic numbers | | | | +| [`@typescript-eslint/no-redeclare`](./docs/rules/no-redeclare.md) | Disallow variable redeclaration | | | | +| [`@typescript-eslint/no-restricted-imports`](./docs/rules/no-restricted-imports.md) | Disallow specified modules when loaded by `import` | | | | +| [`@typescript-eslint/no-shadow`](./docs/rules/no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | +| [`@typescript-eslint/no-throw-literal`](./docs/rules/no-throw-literal.md) | Disallow throwing literals as exceptions | :lock: | | :thought_balloon: | +| [`@typescript-eslint/no-unused-expressions`](./docs/rules/no-unused-expressions.md) | Disallow unused expressions | | | | +| [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables | :white_check_mark: | | | +| [`@typescript-eslint/no-use-before-define`](./docs/rules/no-use-before-define.md) | Disallow the use of variables before they are defined | | | | +| [`@typescript-eslint/no-useless-constructor`](./docs/rules/no-useless-constructor.md) | Disallow unnecessary constructors | :lock: | | | +| [`@typescript-eslint/object-curly-spacing`](./docs/rules/object-curly-spacing.md) | Enforce consistent spacing inside braces | | :wrench: | | +| [`@typescript-eslint/padding-line-between-statements`](./docs/rules/padding-line-between-statements.md) | require or disallow padding lines between statements | | :wrench: | | +| [`@typescript-eslint/quotes`](./docs/rules/quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | +| [`@typescript-eslint/require-await`](./docs/rules/require-await.md) | Disallow async functions which have no `await` expression | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/return-await`](./docs/rules/return-await.md) | Enforces consistent returning of awaited values | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/semi`](./docs/rules/semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | +| [`@typescript-eslint/space-before-blocks`](./docs/rules/space-before-blocks.md) | Enforces consistent spacing before blocks | | :wrench: | | +| [`@typescript-eslint/space-before-function-paren`](./docs/rules/space-before-function-paren.md) | Enforces consistent spacing before function parenthesis | | :wrench: | | +| [`@typescript-eslint/space-infix-ops`](./docs/rules/space-infix-ops.md) | This rule is aimed at ensuring there are spaces around infix operators. | | :wrench: | | diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md index 34404fc218c..b7fc7d1c032 100644 --- a/packages/eslint-plugin/docs/rules/README.md +++ b/packages/eslint-plugin/docs/rules/README.md @@ -13,95 +13,95 @@ See [Presets](/docs/linting/presets) for how to enable recommended rules using p -**Key**: :white_check_mark: = recommended, :heavy_check_mark: = strict, :wrench: = fixable, :thought_balloon: = requires type information +**Key**: :white_check_mark: = recommended, :lock: = strict, :wrench: = fixable, :thought_balloon: = requires type information -| Name | Description | :white_check_mark::heavy_check_mark: | :wrench: | :thought_balloon: | -| ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | -------- | ----------------- | -| [`@typescript-eslint/adjacent-overload-signatures`](./adjacent-overload-signatures.md) | Require that member overloads be consecutive | :white_check_mark: | | | -| [`@typescript-eslint/array-type`](./array-type.md) | Requires using either `T[]` or `Array` for arrays | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/await-thenable`](./await-thenable.md) | Disallows awaiting a value that is not a Thenable | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/ban-ts-comment`](./ban-ts-comment.md) | Bans `@ts-` comments from being used or requires descriptions after directive | :white_check_mark: | | | -| [`@typescript-eslint/ban-tslint-comment`](./ban-tslint-comment.md) | Bans `// tslint:` comments from being used | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/ban-types`](./ban-types.md) | Bans specific types from being used | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/class-literal-property-style`](./class-literal-property-style.md) | Ensures that literals on classes are exposed in a consistent style | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/consistent-indexed-object-style`](./consistent-indexed-object-style.md) | Enforce or disallow the use of the record type | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/consistent-type-assertions`](./consistent-type-assertions.md) | Enforces consistent usage of type assertions | :heavy_check_mark: | | | -| [`@typescript-eslint/consistent-type-definitions`](./consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/consistent-type-exports`](./consistent-type-exports.md) | Enforces consistent usage of type exports | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/consistent-type-imports`](./consistent-type-imports.md) | Enforces consistent usage of type imports | | :wrench: | | -| [`@typescript-eslint/explicit-function-return-type`](./explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | -| [`@typescript-eslint/explicit-member-accessibility`](./explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | -| [`@typescript-eslint/explicit-module-boundary-types`](./explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | -| [`@typescript-eslint/member-delimiter-style`](./member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | -| [`@typescript-eslint/member-ordering`](./member-ordering.md) | Require a consistent member declaration order | | | | -| [`@typescript-eslint/method-signature-style`](./method-signature-style.md) | Enforces using a particular method signature syntax. | | :wrench: | | -| [`@typescript-eslint/naming-convention`](./naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | -| [`@typescript-eslint/no-base-to-string`](./no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | :heavy_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-confusing-non-null-assertion`](./no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/no-confusing-void-expression`](./no-confusing-void-expression.md) | Requires expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-dynamic-delete`](./no-dynamic-delete.md) | Disallow the delete operator with computed key expressions | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/no-empty-interface`](./no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-explicit-any`](./no-explicit-any.md) | Disallow usage of the `any` type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extra-non-null-assertion`](./no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extraneous-class`](./no-extraneous-class.md) | Forbids the use of classes as namespaces | :heavy_check_mark: | | | -| [`@typescript-eslint/no-floating-promises`](./no-floating-promises.md) | Requires Promise-like statements to be handled appropriately | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-for-in-array`](./no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-inferrable-types`](./no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-invalid-void-type`](./no-invalid-void-type.md) | Disallows usage of `void` type outside of generic or return types | :heavy_check_mark: | | | -| [`@typescript-eslint/no-meaningless-void-operator`](./no-meaningless-void-operator.md) | Disallow the `void` operator except when used to discard a value | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-misused-new`](./no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :white_check_mark: | | | -| [`@typescript-eslint/no-misused-promises`](./no-misused-promises.md) | Avoid using Promises in places not designed to handle them | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-namespace`](./no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./no-non-null-asserted-nullish-coalescing.md) | Disallows using a non-null assertion in the left operand of the nullish coalescing operator | :heavy_check_mark: | | | -| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./no-non-null-asserted-optional-chain.md) | Disallows using a non-null assertion after an optional chain expression | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-assertion`](./no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :white_check_mark: | | | -| [`@typescript-eslint/no-parameter-properties`](./no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | | -| [`@typescript-eslint/no-redundant-type-constituents`](./no-redundant-type-constituents.md) | Disallow members of unions and intersections that do nothing or override type information | | | :thought_balloon: | -| [`@typescript-eslint/no-require-imports`](./no-require-imports.md) | Disallows invocation of `require()` | | | | -| [`@typescript-eslint/no-this-alias`](./no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | -| [`@typescript-eslint/no-type-alias`](./no-type-alias.md) | Disallow the use of type aliases | | | | -| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./no-unnecessary-boolean-literal-compare.md) | Flags unnecessary equality comparisons against boolean literals | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-condition`](./no-unnecessary-condition.md) | Prevents conditionals where the type is always truthy or always falsy | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-qualifier`](./no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-arguments`](./no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-assertion`](./no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-constraint`](./no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-unsafe-argument`](./no-unsafe-argument.md) | Disallows calling a function with an any type value | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-assignment`](./no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-call`](./no-unsafe-call.md) | Disallows calling an any type value | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-member-access`](./no-unsafe-member-access.md) | Disallows member access on any typed variables | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-return`](./no-unsafe-return.md) | Disallows returning any from a function | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-useless-empty-export`](./no-useless-empty-export.md) | Disallow empty exports that don't change anything in a module file | | :wrench: | | -| [`@typescript-eslint/no-var-requires`](./no-var-requires.md) | Disallows the use of require statements except in import statements | :white_check_mark: | | | -| [`@typescript-eslint/non-nullable-type-assertion-style`](./non-nullable-type-assertion-style.md) | Prefers a non-null assertion over explicit type cast when possible | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-as-const`](./prefer-as-const.md) | Prefer usage of `as const` over literal type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-enum-initializers`](./prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | -| [`@typescript-eslint/prefer-for-of`](./prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | :heavy_check_mark: | | | -| [`@typescript-eslint/prefer-function-type`](./prefer-function-type.md) | Use function types instead of interfaces with call signatures | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-includes`](./prefer-includes.md) | Enforce `includes` method over `indexOf` method | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-literal-enum-member`](./prefer-literal-enum-member.md) | Require that all enum members be literal values to prevent unintended enum member name shadow issues | :heavy_check_mark: | | | -| [`@typescript-eslint/prefer-namespace-keyword`](./prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-nullish-coalescing`](./prefer-nullish-coalescing.md) | Enforce the usage of the nullish coalescing operator instead of logical chaining | :heavy_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/prefer-optional-chain`](./prefer-optional-chain.md) | Prefer using concise optional chain expressions instead of chained logical ands | :heavy_check_mark: | | | -| [`@typescript-eslint/prefer-readonly`](./prefer-readonly.md) | Requires that private members are marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-readonly-parameter-types`](./prefer-readonly-parameter-types.md) | Requires that function parameters are typed as readonly to prevent accidental mutation of inputs | | | :thought_balloon: | -| [`@typescript-eslint/prefer-reduce-type-parameter`](./prefer-reduce-type-parameter.md) | Prefer using type parameter when calling `Array#reduce` instead of casting | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-regexp-exec`](./prefer-regexp-exec.md) | Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-return-this-type`](./prefer-return-this-type.md) | Enforce that `this` is used when only `this` type is returned | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-string-starts-ends-with`](./prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-ts-expect-error`](./prefer-ts-expect-error.md) | Recommends using `@ts-expect-error` over `@ts-ignore` | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/promise-function-async`](./promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/require-array-sort-compare`](./require-array-sort-compare.md) | Requires `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | -| [`@typescript-eslint/restrict-plus-operands`](./restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/restrict-template-expressions`](./restrict-template-expressions.md) | Enforce template literal expressions to be of string type | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/sort-type-union-intersection-members`](./sort-type-union-intersection-members.md) | Enforces that members of a type union/intersection are sorted alphabetically | | :wrench: | | -| [`@typescript-eslint/strict-boolean-expressions`](./strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/switch-exhaustiveness-check`](./switch-exhaustiveness-check.md) | Exhaustiveness checking in switch with union type | | | :thought_balloon: | -| [`@typescript-eslint/triple-slash-reference`](./triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :white_check_mark: | | | -| [`@typescript-eslint/type-annotation-spacing`](./type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | -| [`@typescript-eslint/typedef`](./typedef.md) | Requires type annotations to exist | | | | -| [`@typescript-eslint/unbound-method`](./unbound-method.md) | Enforces unbound methods are called with their expected scope | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/unified-signatures`](./unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | :heavy_check_mark: | | | +| Name | Description | :white_check_mark::lock: | :wrench: | :thought_balloon: | +| ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- | ------------------------ | -------- | ----------------- | +| [`@typescript-eslint/adjacent-overload-signatures`](./adjacent-overload-signatures.md) | Require that member overloads be consecutive | :white_check_mark: | | | +| [`@typescript-eslint/array-type`](./array-type.md) | Requires using either `T[]` or `Array` for arrays | :lock: | :wrench: | | +| [`@typescript-eslint/await-thenable`](./await-thenable.md) | Disallows awaiting a value that is not a Thenable | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/ban-ts-comment`](./ban-ts-comment.md) | Bans `@ts-` comments from being used or requires descriptions after directive | :white_check_mark: | | | +| [`@typescript-eslint/ban-tslint-comment`](./ban-tslint-comment.md) | Bans `// tslint:` comments from being used | :lock: | :wrench: | | +| [`@typescript-eslint/ban-types`](./ban-types.md) | Bans specific types from being used | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/class-literal-property-style`](./class-literal-property-style.md) | Ensures that literals on classes are exposed in a consistent style | :lock: | :wrench: | | +| [`@typescript-eslint/consistent-indexed-object-style`](./consistent-indexed-object-style.md) | Enforce or disallow the use of the record type | :lock: | :wrench: | | +| [`@typescript-eslint/consistent-type-assertions`](./consistent-type-assertions.md) | Enforces consistent usage of type assertions | :lock: | | | +| [`@typescript-eslint/consistent-type-definitions`](./consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | :lock: | :wrench: | | +| [`@typescript-eslint/consistent-type-exports`](./consistent-type-exports.md) | Enforces consistent usage of type exports | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/consistent-type-imports`](./consistent-type-imports.md) | Enforces consistent usage of type imports | | :wrench: | | +| [`@typescript-eslint/explicit-function-return-type`](./explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | +| [`@typescript-eslint/explicit-member-accessibility`](./explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | +| [`@typescript-eslint/explicit-module-boundary-types`](./explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | +| [`@typescript-eslint/member-delimiter-style`](./member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | +| [`@typescript-eslint/member-ordering`](./member-ordering.md) | Require a consistent member declaration order | | | | +| [`@typescript-eslint/method-signature-style`](./method-signature-style.md) | Enforces using a particular method signature syntax. | | :wrench: | | +| [`@typescript-eslint/naming-convention`](./naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | +| [`@typescript-eslint/no-base-to-string`](./no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | :lock: | | :thought_balloon: | +| [`@typescript-eslint/no-confusing-non-null-assertion`](./no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | :lock: | :wrench: | | +| [`@typescript-eslint/no-confusing-void-expression`](./no-confusing-void-expression.md) | Requires expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-dynamic-delete`](./no-dynamic-delete.md) | Disallow the delete operator with computed key expressions | :lock: | :wrench: | | +| [`@typescript-eslint/no-empty-interface`](./no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-explicit-any`](./no-explicit-any.md) | Disallow usage of the `any` type | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-extra-non-null-assertion`](./no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-extraneous-class`](./no-extraneous-class.md) | Forbids the use of classes as namespaces | :lock: | | | +| [`@typescript-eslint/no-floating-promises`](./no-floating-promises.md) | Requires Promise-like statements to be handled appropriately | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-for-in-array`](./no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-inferrable-types`](./no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-invalid-void-type`](./no-invalid-void-type.md) | Disallows usage of `void` type outside of generic or return types | :lock: | | | +| [`@typescript-eslint/no-meaningless-void-operator`](./no-meaningless-void-operator.md) | Disallow the `void` operator except when used to discard a value | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-misused-new`](./no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :white_check_mark: | | | +| [`@typescript-eslint/no-misused-promises`](./no-misused-promises.md) | Avoid using Promises in places not designed to handle them | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-namespace`](./no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :white_check_mark: | | | +| [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./no-non-null-asserted-nullish-coalescing.md) | Disallows using a non-null assertion in the left operand of the nullish coalescing operator | :lock: | | | +| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./no-non-null-asserted-optional-chain.md) | Disallows using a non-null assertion after an optional chain expression | :white_check_mark: | | | +| [`@typescript-eslint/no-non-null-assertion`](./no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :white_check_mark: | | | +| [`@typescript-eslint/no-parameter-properties`](./no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | | +| [`@typescript-eslint/no-redundant-type-constituents`](./no-redundant-type-constituents.md) | Disallow members of unions and intersections that do nothing or override type information | | | :thought_balloon: | +| [`@typescript-eslint/no-require-imports`](./no-require-imports.md) | Disallows invocation of `require()` | | | | +| [`@typescript-eslint/no-this-alias`](./no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | +| [`@typescript-eslint/no-type-alias`](./no-type-alias.md) | Disallow the use of type aliases | | | | +| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./no-unnecessary-boolean-literal-compare.md) | Flags unnecessary equality comparisons against boolean literals | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-condition`](./no-unnecessary-condition.md) | Prevents conditionals where the type is always truthy or always falsy | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-qualifier`](./no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-arguments`](./no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-assertion`](./no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-constraint`](./no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-unsafe-argument`](./no-unsafe-argument.md) | Disallows calling a function with an any type value | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-assignment`](./no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-call`](./no-unsafe-call.md) | Disallows calling an any type value | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-member-access`](./no-unsafe-member-access.md) | Disallows member access on any typed variables | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-return`](./no-unsafe-return.md) | Disallows returning any from a function | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-useless-empty-export`](./no-useless-empty-export.md) | Disallow empty exports that don't change anything in a module file | | :wrench: | | +| [`@typescript-eslint/no-var-requires`](./no-var-requires.md) | Disallows the use of require statements except in import statements | :white_check_mark: | | | +| [`@typescript-eslint/non-nullable-type-assertion-style`](./non-nullable-type-assertion-style.md) | Prefers a non-null assertion over explicit type cast when possible | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-as-const`](./prefer-as-const.md) | Prefer usage of `as const` over literal type | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-enum-initializers`](./prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | +| [`@typescript-eslint/prefer-for-of`](./prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | :lock: | | | +| [`@typescript-eslint/prefer-function-type`](./prefer-function-type.md) | Use function types instead of interfaces with call signatures | :lock: | :wrench: | | +| [`@typescript-eslint/prefer-includes`](./prefer-includes.md) | Enforce `includes` method over `indexOf` method | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-literal-enum-member`](./prefer-literal-enum-member.md) | Require that all enum members be literal values to prevent unintended enum member name shadow issues | :lock: | | | +| [`@typescript-eslint/prefer-namespace-keyword`](./prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-nullish-coalescing`](./prefer-nullish-coalescing.md) | Enforce the usage of the nullish coalescing operator instead of logical chaining | :lock: | | :thought_balloon: | +| [`@typescript-eslint/prefer-optional-chain`](./prefer-optional-chain.md) | Prefer using concise optional chain expressions instead of chained logical ands | :lock: | | | +| [`@typescript-eslint/prefer-readonly`](./prefer-readonly.md) | Requires that private members are marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-readonly-parameter-types`](./prefer-readonly-parameter-types.md) | Requires that function parameters are typed as readonly to prevent accidental mutation of inputs | | | :thought_balloon: | +| [`@typescript-eslint/prefer-reduce-type-parameter`](./prefer-reduce-type-parameter.md) | Prefer using type parameter when calling `Array#reduce` instead of casting | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-regexp-exec`](./prefer-regexp-exec.md) | Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-return-this-type`](./prefer-return-this-type.md) | Enforce that `this` is used when only `this` type is returned | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-string-starts-ends-with`](./prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-ts-expect-error`](./prefer-ts-expect-error.md) | Recommends using `@ts-expect-error` over `@ts-ignore` | :lock: | :wrench: | | +| [`@typescript-eslint/promise-function-async`](./promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/require-array-sort-compare`](./require-array-sort-compare.md) | Requires `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | +| [`@typescript-eslint/restrict-plus-operands`](./restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/restrict-template-expressions`](./restrict-template-expressions.md) | Enforce template literal expressions to be of string type | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/sort-type-union-intersection-members`](./sort-type-union-intersection-members.md) | Enforces that members of a type union/intersection are sorted alphabetically | | :wrench: | | +| [`@typescript-eslint/strict-boolean-expressions`](./strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/switch-exhaustiveness-check`](./switch-exhaustiveness-check.md) | Exhaustiveness checking in switch with union type | | | :thought_balloon: | +| [`@typescript-eslint/triple-slash-reference`](./triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :white_check_mark: | | | +| [`@typescript-eslint/type-annotation-spacing`](./type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | +| [`@typescript-eslint/typedef`](./typedef.md) | Requires type annotations to exist | | | | +| [`@typescript-eslint/unbound-method`](./unbound-method.md) | Enforces unbound methods are called with their expected scope | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/unified-signatures`](./unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | :lock: | | | @@ -112,47 +112,47 @@ In these cases, we create what we call an extension rule; a rule within our plug -**Key**: :white_check_mark: = recommended, :heavy_check_mark: = strict, :wrench: = fixable, :thought_balloon: = requires type information +**Key**: :white_check_mark: = recommended, :lock: = strict, :wrench: = fixable, :thought_balloon: = requires type information -| Name | Description | :white_check_mark::heavy_check_mark: | :wrench: | :thought_balloon: | -| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------ | -------- | ----------------- | -| [`@typescript-eslint/brace-style`](./brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | -| [`@typescript-eslint/comma-dangle`](./comma-dangle.md) | Require or disallow trailing comma | | :wrench: | | -| [`@typescript-eslint/comma-spacing`](./comma-spacing.md) | Enforces consistent spacing before and after commas | | :wrench: | | -| [`@typescript-eslint/default-param-last`](./default-param-last.md) | Enforce default parameters to be last | | | | -| [`@typescript-eslint/dot-notation`](./dot-notation.md) | enforce dot notation whenever possible | :heavy_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/func-call-spacing`](./func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | -| [`@typescript-eslint/indent`](./indent.md) | Enforce consistent indentation | | :wrench: | | -| [`@typescript-eslint/init-declarations`](./init-declarations.md) | require or disallow initialization in variable declarations | | | | -| [`@typescript-eslint/keyword-spacing`](./keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | -| [`@typescript-eslint/lines-between-class-members`](./lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | -| [`@typescript-eslint/no-array-constructor`](./no-array-constructor.md) | Disallow generic `Array` constructors | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-dupe-class-members`](./no-dupe-class-members.md) | Disallow duplicate class members | | | | -| [`@typescript-eslint/no-duplicate-imports`](./no-duplicate-imports.md) | Disallow duplicate imports | | | | -| [`@typescript-eslint/no-empty-function`](./no-empty-function.md) | Disallow empty functions | :white_check_mark: | | | -| [`@typescript-eslint/no-extra-parens`](./no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | -| [`@typescript-eslint/no-extra-semi`](./no-extra-semi.md) | Disallow unnecessary semicolons | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-implied-eval`](./no-implied-eval.md) | Disallow the use of `eval()`-like methods | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-invalid-this`](./no-invalid-this.md) | Disallow `this` keywords outside of classes or class-like objects | | | | -| [`@typescript-eslint/no-loop-func`](./no-loop-func.md) | Disallow function declarations that contain unsafe references inside loop statements | | | | -| [`@typescript-eslint/no-loss-of-precision`](./no-loss-of-precision.md) | Disallow literal numbers that lose precision | :white_check_mark: | | | -| [`@typescript-eslint/no-magic-numbers`](./no-magic-numbers.md) | Disallow magic numbers | | | | -| [`@typescript-eslint/no-redeclare`](./no-redeclare.md) | Disallow variable redeclaration | | | | -| [`@typescript-eslint/no-restricted-imports`](./no-restricted-imports.md) | Disallow specified modules when loaded by `import` | | | | -| [`@typescript-eslint/no-shadow`](./no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | -| [`@typescript-eslint/no-throw-literal`](./no-throw-literal.md) | Disallow throwing literals as exceptions | :heavy_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unused-expressions`](./no-unused-expressions.md) | Disallow unused expressions | | | | -| [`@typescript-eslint/no-unused-vars`](./no-unused-vars.md) | Disallow unused variables | :white_check_mark: | | | -| [`@typescript-eslint/no-use-before-define`](./no-use-before-define.md) | Disallow the use of variables before they are defined | | | | -| [`@typescript-eslint/no-useless-constructor`](./no-useless-constructor.md) | Disallow unnecessary constructors | :heavy_check_mark: | | | -| [`@typescript-eslint/object-curly-spacing`](./object-curly-spacing.md) | Enforce consistent spacing inside braces | | :wrench: | | -| [`@typescript-eslint/padding-line-between-statements`](./padding-line-between-statements.md) | require or disallow padding lines between statements | | :wrench: | | -| [`@typescript-eslint/quotes`](./quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | -| [`@typescript-eslint/require-await`](./require-await.md) | Disallow async functions which have no `await` expression | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/return-await`](./return-await.md) | Enforces consistent returning of awaited values | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/semi`](./semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | -| [`@typescript-eslint/space-before-blocks`](./space-before-blocks.md) | Enforces consistent spacing before blocks | | :wrench: | | -| [`@typescript-eslint/space-before-function-paren`](./space-before-function-paren.md) | Enforces consistent spacing before function parenthesis | | :wrench: | | -| [`@typescript-eslint/space-infix-ops`](./space-infix-ops.md) | This rule is aimed at ensuring there are spaces around infix operators. | | :wrench: | | +| Name | Description | :white_check_mark::lock: | :wrench: | :thought_balloon: | +| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------ | -------- | ----------------- | +| [`@typescript-eslint/brace-style`](./brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | +| [`@typescript-eslint/comma-dangle`](./comma-dangle.md) | Require or disallow trailing comma | | :wrench: | | +| [`@typescript-eslint/comma-spacing`](./comma-spacing.md) | Enforces consistent spacing before and after commas | | :wrench: | | +| [`@typescript-eslint/default-param-last`](./default-param-last.md) | Enforce default parameters to be last | | | | +| [`@typescript-eslint/dot-notation`](./dot-notation.md) | enforce dot notation whenever possible | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/func-call-spacing`](./func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | +| [`@typescript-eslint/indent`](./indent.md) | Enforce consistent indentation | | :wrench: | | +| [`@typescript-eslint/init-declarations`](./init-declarations.md) | require or disallow initialization in variable declarations | | | | +| [`@typescript-eslint/keyword-spacing`](./keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | +| [`@typescript-eslint/lines-between-class-members`](./lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | +| [`@typescript-eslint/no-array-constructor`](./no-array-constructor.md) | Disallow generic `Array` constructors | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-dupe-class-members`](./no-dupe-class-members.md) | Disallow duplicate class members | | | | +| [`@typescript-eslint/no-duplicate-imports`](./no-duplicate-imports.md) | Disallow duplicate imports | | | | +| [`@typescript-eslint/no-empty-function`](./no-empty-function.md) | Disallow empty functions | :white_check_mark: | | | +| [`@typescript-eslint/no-extra-parens`](./no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | +| [`@typescript-eslint/no-extra-semi`](./no-extra-semi.md) | Disallow unnecessary semicolons | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-implied-eval`](./no-implied-eval.md) | Disallow the use of `eval()`-like methods | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-invalid-this`](./no-invalid-this.md) | Disallow `this` keywords outside of classes or class-like objects | | | | +| [`@typescript-eslint/no-loop-func`](./no-loop-func.md) | Disallow function declarations that contain unsafe references inside loop statements | | | | +| [`@typescript-eslint/no-loss-of-precision`](./no-loss-of-precision.md) | Disallow literal numbers that lose precision | :white_check_mark: | | | +| [`@typescript-eslint/no-magic-numbers`](./no-magic-numbers.md) | Disallow magic numbers | | | | +| [`@typescript-eslint/no-redeclare`](./no-redeclare.md) | Disallow variable redeclaration | | | | +| [`@typescript-eslint/no-restricted-imports`](./no-restricted-imports.md) | Disallow specified modules when loaded by `import` | | | | +| [`@typescript-eslint/no-shadow`](./no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | +| [`@typescript-eslint/no-throw-literal`](./no-throw-literal.md) | Disallow throwing literals as exceptions | :lock: | | :thought_balloon: | +| [`@typescript-eslint/no-unused-expressions`](./no-unused-expressions.md) | Disallow unused expressions | | | | +| [`@typescript-eslint/no-unused-vars`](./no-unused-vars.md) | Disallow unused variables | :white_check_mark: | | | +| [`@typescript-eslint/no-use-before-define`](./no-use-before-define.md) | Disallow the use of variables before they are defined | | | | +| [`@typescript-eslint/no-useless-constructor`](./no-useless-constructor.md) | Disallow unnecessary constructors | :lock: | | | +| [`@typescript-eslint/object-curly-spacing`](./object-curly-spacing.md) | Enforce consistent spacing inside braces | | :wrench: | | +| [`@typescript-eslint/padding-line-between-statements`](./padding-line-between-statements.md) | require or disallow padding lines between statements | | :wrench: | | +| [`@typescript-eslint/quotes`](./quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | +| [`@typescript-eslint/require-await`](./require-await.md) | Disallow async functions which have no `await` expression | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/return-await`](./return-await.md) | Enforces consistent returning of awaited values | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/semi`](./semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | +| [`@typescript-eslint/space-before-blocks`](./space-before-blocks.md) | Enforces consistent spacing before blocks | | :wrench: | | +| [`@typescript-eslint/space-before-function-paren`](./space-before-function-paren.md) | Enforces consistent spacing before function parenthesis | | :wrench: | | +| [`@typescript-eslint/space-infix-ops`](./space-infix-ops.md) | This rule is aimed at ensuring there are spaces around infix operators. | | :wrench: | | diff --git a/packages/eslint-plugin/docs/rules/TEMPLATE.md b/packages/eslint-plugin/docs/rules/TEMPLATE.md index c68bff3fdb9..c2c7136fe3e 100644 --- a/packages/eslint-plugin/docs/rules/TEMPLATE.md +++ b/packages/eslint-plugin/docs/rules/TEMPLATE.md @@ -56,6 +56,6 @@ For example if this rule requires a feature released in a certain TS version. - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md b/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md index 1e162cc0bb2..840fbcdc8d4 100644 --- a/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md +++ b/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md @@ -109,6 +109,6 @@ If you don't care about the general structure of the code, then you will not nee - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/array-type.md b/packages/eslint-plugin/docs/rules/array-type.md index 34724711c65..6755f3d1975 100644 --- a/packages/eslint-plugin/docs/rules/array-type.md +++ b/packages/eslint-plugin/docs/rules/array-type.md @@ -127,6 +127,6 @@ This matrix lists all possible option combinations and their expected results fo - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/await-thenable.md b/packages/eslint-plugin/docs/rules/await-thenable.md index 5472cceb4a1..f308a202e62 100644 --- a/packages/eslint-plugin/docs/rules/await-thenable.md +++ b/packages/eslint-plugin/docs/rules/await-thenable.md @@ -55,6 +55,6 @@ This is generally not preferred, but can sometimes be useful for visual consiste - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/ban-ts-comment.md b/packages/eslint-plugin/docs/rules/ban-ts-comment.md index f4fbf4e49b3..8f521e919fd 100644 --- a/packages/eslint-plugin/docs/rules/ban-ts-comment.md +++ b/packages/eslint-plugin/docs/rules/ban-ts-comment.md @@ -147,6 +147,6 @@ If you want to use all of the TypeScript directives. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/ban-tslint-comment.md b/packages/eslint-plugin/docs/rules/ban-tslint-comment.md index 7b231a723f4..6714000aba8 100644 --- a/packages/eslint-plugin/docs/rules/ban-tslint-comment.md +++ b/packages/eslint-plugin/docs/rules/ban-tslint-comment.md @@ -51,6 +51,6 @@ If you are still using TSLint. - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/ban-types.md b/packages/eslint-plugin/docs/rules/ban-types.md index 13aa8b5c1fa..8a325032147 100644 --- a/packages/eslint-plugin/docs/rules/ban-types.md +++ b/packages/eslint-plugin/docs/rules/ban-types.md @@ -191,6 +191,6 @@ const curly2: Record<'a', string> = { a: 'string' }; - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/brace-style.md b/packages/eslint-plugin/docs/rules/brace-style.md index 5cae2f84b3f..c9a259cdb7a 100644 --- a/packages/eslint-plugin/docs/rules/brace-style.md +++ b/packages/eslint-plugin/docs/rules/brace-style.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/class-literal-property-style.md b/packages/eslint-plugin/docs/rules/class-literal-property-style.md index 718881e7e4f..8dab1dc263b 100644 --- a/packages/eslint-plugin/docs/rules/class-literal-property-style.md +++ b/packages/eslint-plugin/docs/rules/class-literal-property-style.md @@ -113,6 +113,6 @@ for how literal values are exposed by your classes. - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/comma-dangle.md b/packages/eslint-plugin/docs/rules/comma-dangle.md index 80c84b94950..9ee747e1db7 100644 --- a/packages/eslint-plugin/docs/rules/comma-dangle.md +++ b/packages/eslint-plugin/docs/rules/comma-dangle.md @@ -43,6 +43,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/comma-spacing.md b/packages/eslint-plugin/docs/rules/comma-spacing.md index d0197b7fa52..e598c20fcf9 100644 --- a/packages/eslint-plugin/docs/rules/comma-spacing.md +++ b/packages/eslint-plugin/docs/rules/comma-spacing.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md b/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md index 253a8b058f7..6e02816695d 100644 --- a/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md +++ b/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md @@ -87,6 +87,6 @@ type Foo = { - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-type-assertions.md b/packages/eslint-plugin/docs/rules/consistent-type-assertions.md index c7fff6261f0..6cf35c5c160 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-assertions.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-assertions.md @@ -121,6 +121,6 @@ If you do not want to enforce consistent type assertions. - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-type-definitions.md b/packages/eslint-plugin/docs/rules/consistent-type-definitions.md index e28746a782f..37f69af6c7a 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-definitions.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-definitions.md @@ -89,6 +89,6 @@ If you specifically want to use an interface or type literal for stylistic reaso - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 3806564c2ab..f38230dd88e 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -114,6 +114,6 @@ export { Button, type ButtonProps } from 'some-library'; - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/consistent-type-imports.md b/packages/eslint-plugin/docs/rules/consistent-type-imports.md index 165ca2c0533..f3d96bec5ce 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-imports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-imports.md @@ -69,6 +69,6 @@ const x: import('Bar') = 1; - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/default-param-last.md b/packages/eslint-plugin/docs/rules/default-param-last.md index d7ca25213fc..830d2828c01 100644 --- a/packages/eslint-plugin/docs/rules/default-param-last.md +++ b/packages/eslint-plugin/docs/rules/default-param-last.md @@ -67,6 +67,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/dot-notation.md b/packages/eslint-plugin/docs/rules/dot-notation.md index 7f22fa0f4a3..1256f2004fe 100644 --- a/packages/eslint-plugin/docs/rules/dot-notation.md +++ b/packages/eslint-plugin/docs/rules/dot-notation.md @@ -92,6 +92,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md index 9fd46653d30..210871ab347 100644 --- a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md +++ b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md @@ -295,6 +295,6 @@ you will not need this rule. - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md index 03e0d6586f6..4d14797d02c 100644 --- a/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md +++ b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md @@ -353,6 +353,6 @@ If you think defaulting to public is a good default, then you should consider us - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md index f53057c6a65..d968504be07 100644 --- a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md +++ b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md @@ -290,6 +290,6 @@ If you wish to make sure all functions have explicit return types, as opposed to - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/func-call-spacing.md b/packages/eslint-plugin/docs/rules/func-call-spacing.md index 94dcc5d30dd..f968cf45d2c 100644 --- a/packages/eslint-plugin/docs/rules/func-call-spacing.md +++ b/packages/eslint-plugin/docs/rules/func-call-spacing.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/indent.md b/packages/eslint-plugin/docs/rules/indent.md index 32b21d34fdf..aeee0ffcc12 100644 --- a/packages/eslint-plugin/docs/rules/indent.md +++ b/packages/eslint-plugin/docs/rules/indent.md @@ -35,6 +35,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/init-declarations.md b/packages/eslint-plugin/docs/rules/init-declarations.md index d22f7805dc9..895aa0d4dfd 100644 --- a/packages/eslint-plugin/docs/rules/init-declarations.md +++ b/packages/eslint-plugin/docs/rules/init-declarations.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/keyword-spacing.md b/packages/eslint-plugin/docs/rules/keyword-spacing.md index db49f79a1bd..446cdab3e96 100644 --- a/packages/eslint-plugin/docs/rules/keyword-spacing.md +++ b/packages/eslint-plugin/docs/rules/keyword-spacing.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/lines-between-class-members.md b/packages/eslint-plugin/docs/rules/lines-between-class-members.md index 12db029bd86..769e5f8d268 100644 --- a/packages/eslint-plugin/docs/rules/lines-between-class-members.md +++ b/packages/eslint-plugin/docs/rules/lines-between-class-members.md @@ -82,6 +82,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/member-delimiter-style.md b/packages/eslint-plugin/docs/rules/member-delimiter-style.md index 5951b1f8626..741f34171be 100644 --- a/packages/eslint-plugin/docs/rules/member-delimiter-style.md +++ b/packages/eslint-plugin/docs/rules/member-delimiter-style.md @@ -213,6 +213,6 @@ If you don't care about enforcing a consistent member delimiter in interfaces an - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/member-ordering.md b/packages/eslint-plugin/docs/rules/member-ordering.md index 7451c1bc400..8c6441ed451 100644 --- a/packages/eslint-plugin/docs/rules/member-ordering.md +++ b/packages/eslint-plugin/docs/rules/member-ordering.md @@ -1117,6 +1117,6 @@ If you don't care about the general structure of your classes and interfaces, th - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/method-signature-style.md b/packages/eslint-plugin/docs/rules/method-signature-style.md index 712b07f628b..7deb02f4bfd 100644 --- a/packages/eslint-plugin/docs/rules/method-signature-style.md +++ b/packages/eslint-plugin/docs/rules/method-signature-style.md @@ -109,6 +109,6 @@ If you don't want to enforce a particular style for object/interface function ty - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/naming-convention.md b/packages/eslint-plugin/docs/rules/naming-convention.md index 21a619b9a27..7fc4729b966 100644 --- a/packages/eslint-plugin/docs/rules/naming-convention.md +++ b/packages/eslint-plugin/docs/rules/naming-convention.md @@ -705,6 +705,6 @@ If you do not want to enforce naming conventions for anything. - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-array-constructor.md b/packages/eslint-plugin/docs/rules/no-array-constructor.md index 77f3fcca88e..603ba48a5bc 100644 --- a/packages/eslint-plugin/docs/rules/no-array-constructor.md +++ b/packages/eslint-plugin/docs/rules/no-array-constructor.md @@ -54,6 +54,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-base-to-string.md b/packages/eslint-plugin/docs/rules/no-base-to-string.md index 0a9f1854cd5..fde51eccffc 100644 --- a/packages/eslint-plugin/docs/rules/no-base-to-string.md +++ b/packages/eslint-plugin/docs/rules/no-base-to-string.md @@ -94,6 +94,6 @@ If you don't mind `"[object Object]"` in your strings, then you will not need th - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md b/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md index a13dbdc9ed4..1f5d5b040fd 100644 --- a/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md @@ -66,6 +66,6 @@ If you don't care about this confusion, then you will not need this rule. - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md b/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md index 55951da17b2..88c295ae3bb 100644 --- a/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md +++ b/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md @@ -156,6 +156,6 @@ Also, if you prefer concise coding style then also don't use it. - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-dupe-class-members.md b/packages/eslint-plugin/docs/rules/no-dupe-class-members.md index 706772c6f80..e0206510e8d 100644 --- a/packages/eslint-plugin/docs/rules/no-dupe-class-members.md +++ b/packages/eslint-plugin/docs/rules/no-dupe-class-members.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-duplicate-imports.md b/packages/eslint-plugin/docs/rules/no-duplicate-imports.md index d706815ffc3..743e45e0464 100644 --- a/packages/eslint-plugin/docs/rules/no-duplicate-imports.md +++ b/packages/eslint-plugin/docs/rules/no-duplicate-imports.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-dynamic-delete.md b/packages/eslint-plugin/docs/rules/no-dynamic-delete.md index 928baf4a217..abbee2acf02 100644 --- a/packages/eslint-plugin/docs/rules/no-dynamic-delete.md +++ b/packages/eslint-plugin/docs/rules/no-dynamic-delete.md @@ -69,6 +69,6 @@ Even repeated minor performance slowdowns likely do not significantly affect you - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-empty-function.md b/packages/eslint-plugin/docs/rules/no-empty-function.md index 3c1f74533e6..0920bf6f3c7 100644 --- a/packages/eslint-plugin/docs/rules/no-empty-function.md +++ b/packages/eslint-plugin/docs/rules/no-empty-function.md @@ -97,6 +97,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-empty-interface.md b/packages/eslint-plugin/docs/rules/no-empty-interface.md index b31fa854976..508edd1993c 100644 --- a/packages/eslint-plugin/docs/rules/no-empty-interface.md +++ b/packages/eslint-plugin/docs/rules/no-empty-interface.md @@ -73,6 +73,6 @@ If you don't care about having empty/meaningless interfaces, then you will not n - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-explicit-any.md b/packages/eslint-plugin/docs/rules/no-explicit-any.md index 82ac1a7e0ca..aff5ae083e0 100644 --- a/packages/eslint-plugin/docs/rules/no-explicit-any.md +++ b/packages/eslint-plugin/docs/rules/no-explicit-any.md @@ -188,6 +188,6 @@ and you want to be able to specify `any`. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md b/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md index cb1a684b88e..78ab63347bf 100644 --- a/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md @@ -63,6 +63,6 @@ This rule is not configurable. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-extra-parens.md b/packages/eslint-plugin/docs/rules/no-extra-parens.md index e575ae1504f..4cccccdbe79 100644 --- a/packages/eslint-plugin/docs/rules/no-extra-parens.md +++ b/packages/eslint-plugin/docs/rules/no-extra-parens.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-extra-semi.md b/packages/eslint-plugin/docs/rules/no-extra-semi.md index 583fdfd1f8a..6137b6ca21b 100644 --- a/packages/eslint-plugin/docs/rules/no-extra-semi.md +++ b/packages/eslint-plugin/docs/rules/no-extra-semi.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-extraneous-class.md b/packages/eslint-plugin/docs/rules/no-extraneous-class.md index a51afb03e6c..eb229ea655a 100644 --- a/packages/eslint-plugin/docs/rules/no-extraneous-class.md +++ b/packages/eslint-plugin/docs/rules/no-extraneous-class.md @@ -89,6 +89,6 @@ team or if you use classes as namespaces. - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-floating-promises.md b/packages/eslint-plugin/docs/rules/no-floating-promises.md index 552e34c0618..72ce6e2a506 100644 --- a/packages/eslint-plugin/docs/rules/no-floating-promises.md +++ b/packages/eslint-plugin/docs/rules/no-floating-promises.md @@ -124,6 +124,6 @@ If you do not use Promise-like values in your codebase, or want to allow them to - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-for-in-array.md b/packages/eslint-plugin/docs/rules/no-for-in-array.md index aa4434e6755..6c4e46b8591 100644 --- a/packages/eslint-plugin/docs/rules/no-for-in-array.md +++ b/packages/eslint-plugin/docs/rules/no-for-in-array.md @@ -66,6 +66,6 @@ If you want to iterate through a loop using the indices in an array as strings, - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md b/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md index b2b6a60aa30..3174aa28f08 100644 --- a/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md +++ b/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md @@ -85,6 +85,6 @@ If you are not using TypeScript 4.0 (or greater), then you will not be able to u - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-implied-eval.md b/packages/eslint-plugin/docs/rules/no-implied-eval.md index 790c6f21e60..5c59f35bb70 100644 --- a/packages/eslint-plugin/docs/rules/no-implied-eval.md +++ b/packages/eslint-plugin/docs/rules/no-implied-eval.md @@ -118,6 +118,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-inferrable-types.md b/packages/eslint-plugin/docs/rules/no-inferrable-types.md index fec87f681a7..67fd3e2f696 100644 --- a/packages/eslint-plugin/docs/rules/no-inferrable-types.md +++ b/packages/eslint-plugin/docs/rules/no-inferrable-types.md @@ -157,6 +157,6 @@ TSLint: [no-inferrable-types](https://palantir.github.io/tslint/rules/no-inferra - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-invalid-this.md b/packages/eslint-plugin/docs/rules/no-invalid-this.md index 68e876575fb..7681bb07f22 100644 --- a/packages/eslint-plugin/docs/rules/no-invalid-this.md +++ b/packages/eslint-plugin/docs/rules/no-invalid-this.md @@ -35,6 +35,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-invalid-void-type.md b/packages/eslint-plugin/docs/rules/no-invalid-void-type.md index 3e51448d9a6..44ee066b368 100644 --- a/packages/eslint-plugin/docs/rules/no-invalid-void-type.md +++ b/packages/eslint-plugin/docs/rules/no-invalid-void-type.md @@ -135,6 +135,6 @@ or in invalid places, then you don't need this rule. - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-loop-func.md b/packages/eslint-plugin/docs/rules/no-loop-func.md index 5914369f5cb..5652dc62fa5 100644 --- a/packages/eslint-plugin/docs/rules/no-loop-func.md +++ b/packages/eslint-plugin/docs/rules/no-loop-func.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-loss-of-precision.md b/packages/eslint-plugin/docs/rules/no-loss-of-precision.md index 309f9d8b272..4b1e8c6dd29 100644 --- a/packages/eslint-plugin/docs/rules/no-loss-of-precision.md +++ b/packages/eslint-plugin/docs/rules/no-loss-of-precision.md @@ -28,6 +28,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-magic-numbers.md b/packages/eslint-plugin/docs/rules/no-magic-numbers.md index 55f503cba87..05ad8fa1bca 100644 --- a/packages/eslint-plugin/docs/rules/no-magic-numbers.md +++ b/packages/eslint-plugin/docs/rules/no-magic-numbers.md @@ -128,6 +128,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md b/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md index 7583aadb984..58b37b0888c 100644 --- a/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md +++ b/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md @@ -59,6 +59,6 @@ This rule accepts a single object option with the following default configuratio - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-misused-new.md b/packages/eslint-plugin/docs/rules/no-misused-new.md index 42e7c3d35e2..735699c6132 100644 --- a/packages/eslint-plugin/docs/rules/no-misused-new.md +++ b/packages/eslint-plugin/docs/rules/no-misused-new.md @@ -55,6 +55,6 @@ This rule is not configurable. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-misused-promises.md b/packages/eslint-plugin/docs/rules/no-misused-promises.md index eabd36cb78f..b3d5dcbe0cb 100644 --- a/packages/eslint-plugin/docs/rules/no-misused-promises.md +++ b/packages/eslint-plugin/docs/rules/no-misused-promises.md @@ -229,6 +229,6 @@ misuses of them outside of what the TypeScript compiler will check. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-namespace.md b/packages/eslint-plugin/docs/rules/no-namespace.md index f785d38fda8..a6971b5b0b4 100644 --- a/packages/eslint-plugin/docs/rules/no-namespace.md +++ b/packages/eslint-plugin/docs/rules/no-namespace.md @@ -140,6 +140,6 @@ If you are using the ES2015 module syntax, then you will not need this rule. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md b/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md index 3d36d16ef36..faec85a2e57 100644 --- a/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +++ b/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md @@ -71,6 +71,6 @@ If you are not using TypeScript 3.7 (or greater), then you will not need to use - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md b/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md index 18bbab165e2..4772ebc9cca 100644 --- a/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +++ b/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md @@ -70,6 +70,6 @@ If you are not using TypeScript 3.7 (or greater), then you will not need to use - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-non-null-assertion.md b/packages/eslint-plugin/docs/rules/no-non-null-assertion.md index 6844c3ff3b3..9f84436d61c 100644 --- a/packages/eslint-plugin/docs/rules/no-non-null-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-non-null-assertion.md @@ -57,6 +57,6 @@ If you don't care about strict null-checking, then you will not need this rule. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-parameter-properties.md b/packages/eslint-plugin/docs/rules/no-parameter-properties.md index aa06f67967a..3f308256efb 100644 --- a/packages/eslint-plugin/docs/rules/no-parameter-properties.md +++ b/packages/eslint-plugin/docs/rules/no-parameter-properties.md @@ -404,6 +404,6 @@ If you don't care about the using parameter properties in constructors, then you - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-redeclare.md b/packages/eslint-plugin/docs/rules/no-redeclare.md index 45d67ee5a89..37859e58912 100644 --- a/packages/eslint-plugin/docs/rules/no-redeclare.md +++ b/packages/eslint-plugin/docs/rules/no-redeclare.md @@ -89,6 +89,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md b/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md index 099393ffbcc..3b96bd19ad1 100644 --- a/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md +++ b/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md @@ -95,6 +95,6 @@ It also does not provide an auto-fixer just yet. - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-require-imports.md b/packages/eslint-plugin/docs/rules/no-require-imports.md index 7645ca54f73..8344ec726c4 100644 --- a/packages/eslint-plugin/docs/rules/no-require-imports.md +++ b/packages/eslint-plugin/docs/rules/no-require-imports.md @@ -56,6 +56,6 @@ If you don't care about TypeScript module syntax, then you will not need this ru - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-restricted-imports.md b/packages/eslint-plugin/docs/rules/no-restricted-imports.md index 1878a5fbd39..3f20d05bb2b 100644 --- a/packages/eslint-plugin/docs/rules/no-restricted-imports.md +++ b/packages/eslint-plugin/docs/rules/no-restricted-imports.md @@ -73,6 +73,6 @@ export type { Baz } from 'import-baz'; - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-shadow.md b/packages/eslint-plugin/docs/rules/no-shadow.md index 0c2bc36fafd..4706fabe90e 100644 --- a/packages/eslint-plugin/docs/rules/no-shadow.md +++ b/packages/eslint-plugin/docs/rules/no-shadow.md @@ -96,6 +96,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-this-alias.md b/packages/eslint-plugin/docs/rules/no-this-alias.md index 0c4e820d6c8..ec76dcf97a6 100644 --- a/packages/eslint-plugin/docs/rules/no-this-alias.md +++ b/packages/eslint-plugin/docs/rules/no-this-alias.md @@ -65,6 +65,6 @@ If you need to assign `this` to variables, you shouldn’t use this rule. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-throw-literal.md b/packages/eslint-plugin/docs/rules/no-throw-literal.md index 3a99996880a..ff5f8bb04d1 100644 --- a/packages/eslint-plugin/docs/rules/no-throw-literal.md +++ b/packages/eslint-plugin/docs/rules/no-throw-literal.md @@ -121,6 +121,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-type-alias.md b/packages/eslint-plugin/docs/rules/no-type-alias.md index 4cb0f55f793..57e117cca7c 100644 --- a/packages/eslint-plugin/docs/rules/no-type-alias.md +++ b/packages/eslint-plugin/docs/rules/no-type-alias.md @@ -601,6 +601,6 @@ callback, etc. that would cause the code to be unreadable or impractical. - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md b/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md index 89325246829..a3f4316d691 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md @@ -155,6 +155,6 @@ if (!(someNullCondition ?? true)) { - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md index d362a13f407..992e6d409ea 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md @@ -117,6 +117,6 @@ The main downside to using this rule is the need for type information. - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md b/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md index f5793f4ebb3..36fc50d7fe9 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md @@ -101,6 +101,6 @@ If you don't care about having unneeded namespace or enum qualifiers, then you d - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md index c20b93e397d..6473b871264 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md @@ -75,6 +75,6 @@ This rule is not configurable. - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md index 53a6cda72d0..66e37f70f06 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md @@ -82,6 +82,6 @@ If you don't care about having no-op type assertions in your code, then you can - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md index 05dc93aaa70..9a4b947a5d1 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md @@ -77,6 +77,6 @@ If you don't care about the specific styles of your type constraints, or never u - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-argument.md b/packages/eslint-plugin/docs/rules/no-unsafe-argument.md index 8ac5da552dc..2ed2f3f423a 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-argument.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-argument.md @@ -93,6 +93,6 @@ This rule is not configurable. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md b/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md index 662d9ba7115..12a934b25df 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md @@ -96,6 +96,6 @@ This rule is not configurable. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-call.md b/packages/eslint-plugin/docs/rules/no-unsafe-call.md index 4d87cc9085f..c883f0ff277 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-call.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-call.md @@ -70,6 +70,6 @@ This rule is not configurable. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md index d3cf90f63b6..da4b46633e5 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md @@ -76,6 +76,6 @@ This rule is not configurable. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-return.md b/packages/eslint-plugin/docs/rules/no-unsafe-return.md index bc67c89ebdd..933bd5110a0 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-return.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-return.md @@ -113,6 +113,6 @@ This rule is not configurable. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unused-expressions.md b/packages/eslint-plugin/docs/rules/no-unused-expressions.md index 2f6a37046e4..cdd53d2a53d 100644 --- a/packages/eslint-plugin/docs/rules/no-unused-expressions.md +++ b/packages/eslint-plugin/docs/rules/no-unused-expressions.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-unused-vars.md b/packages/eslint-plugin/docs/rules/no-unused-vars.md index b7f85b8b49b..c361b263b0c 100644 --- a/packages/eslint-plugin/docs/rules/no-unused-vars.md +++ b/packages/eslint-plugin/docs/rules/no-unused-vars.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-use-before-define.md b/packages/eslint-plugin/docs/rules/no-use-before-define.md index cec3d0a908d..cdc1e037391 100644 --- a/packages/eslint-plugin/docs/rules/no-use-before-define.md +++ b/packages/eslint-plugin/docs/rules/no-use-before-define.md @@ -117,6 +117,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-useless-constructor.md b/packages/eslint-plugin/docs/rules/no-useless-constructor.md index 1429e32b434..511a81bfc49 100644 --- a/packages/eslint-plugin/docs/rules/no-useless-constructor.md +++ b/packages/eslint-plugin/docs/rules/no-useless-constructor.md @@ -40,6 +40,6 @@ See [discussion on this rule's lack of type information](https://github.com/type - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-useless-empty-export.md b/packages/eslint-plugin/docs/rules/no-useless-empty-export.md index 29761052596..0042e30e97d 100644 --- a/packages/eslint-plugin/docs/rules/no-useless-empty-export.md +++ b/packages/eslint-plugin/docs/rules/no-useless-empty-export.md @@ -55,6 +55,6 @@ This rule is not configurable. - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/no-var-requires.md b/packages/eslint-plugin/docs/rules/no-var-requires.md index 83e67d1af8b..819dab59d83 100644 --- a/packages/eslint-plugin/docs/rules/no-var-requires.md +++ b/packages/eslint-plugin/docs/rules/no-var-requires.md @@ -51,6 +51,6 @@ If you don't care about TypeScript module syntax, then you will not need this ru - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md b/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md index bb8107d4e66..bebf23f2813 100644 --- a/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +++ b/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md @@ -49,6 +49,6 @@ If you don't mind having unnecessarily verbose type casts, you can avoid this ru - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/object-curly-spacing.md b/packages/eslint-plugin/docs/rules/object-curly-spacing.md index bd40cf86394..c90baead9ca 100644 --- a/packages/eslint-plugin/docs/rules/object-curly-spacing.md +++ b/packages/eslint-plugin/docs/rules/object-curly-spacing.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/padding-line-between-statements.md b/packages/eslint-plugin/docs/rules/padding-line-between-statements.md index 31bcee1049d..d8c5a29ca72 100644 --- a/packages/eslint-plugin/docs/rules/padding-line-between-statements.md +++ b/packages/eslint-plugin/docs/rules/padding-line-between-statements.md @@ -59,6 +59,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-as-const.md b/packages/eslint-plugin/docs/rules/prefer-as-const.md index f0482e3066a..736f8734ec1 100644 --- a/packages/eslint-plugin/docs/rules/prefer-as-const.md +++ b/packages/eslint-plugin/docs/rules/prefer-as-const.md @@ -52,6 +52,6 @@ If you are using TypeScript < 3.4 - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md b/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md index caa86d7e540..014349bc0d9 100644 --- a/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md +++ b/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md @@ -92,6 +92,6 @@ If you don't care about `enum`s having implicit values you can safely disable th - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-for-of.md b/packages/eslint-plugin/docs/rules/prefer-for-of.md index ff26ffa9d7a..78fc4543e12 100644 --- a/packages/eslint-plugin/docs/rules/prefer-for-of.md +++ b/packages/eslint-plugin/docs/rules/prefer-for-of.md @@ -63,6 +63,6 @@ If you transpile for browsers that do not support for-of loops, you may wish to - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-function-type.md b/packages/eslint-plugin/docs/rules/prefer-function-type.md index e99eb5154a4..b64b07718bb 100644 --- a/packages/eslint-plugin/docs/rules/prefer-function-type.md +++ b/packages/eslint-plugin/docs/rules/prefer-function-type.md @@ -103,6 +103,6 @@ If you specifically want to use an interface or type literal with a single call - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-includes.md b/packages/eslint-plugin/docs/rules/prefer-includes.md index 36c167247a4..3c3bd628aa7 100644 --- a/packages/eslint-plugin/docs/rules/prefer-includes.md +++ b/packages/eslint-plugin/docs/rules/prefer-includes.md @@ -91,6 +91,6 @@ If you don't want to suggest `includes`, you can safely turn this rule off. - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md b/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md index cffb9569ada..65f0d8dc1a6 100644 --- a/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md +++ b/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md @@ -101,6 +101,6 @@ If you want use anything other than simple literals as an enum value. - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md b/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md index 8c82e76f2bd..b6ec63fd81e 100644 --- a/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md +++ b/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md @@ -40,6 +40,6 @@ This rule is not configurable. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md b/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md index f349db7a86c..54c08e1d464 100644 --- a/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +++ b/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md @@ -146,6 +146,6 @@ If you are not using TypeScript 3.7 (or greater), then you will not be able to u - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-optional-chain.md b/packages/eslint-plugin/docs/rules/prefer-optional-chain.md index f285873e166..df77f58a0e5 100644 --- a/packages/eslint-plugin/docs/rules/prefer-optional-chain.md +++ b/packages/eslint-plugin/docs/rules/prefer-optional-chain.md @@ -111,6 +111,6 @@ If you are not using TypeScript 3.7 (or greater), then you will not be able to u - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md b/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md index 4382d714b13..3663976e27b 100644 --- a/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +++ b/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md @@ -282,6 +282,6 @@ function foo(arg: MyType) {} - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-readonly.md b/packages/eslint-plugin/docs/rules/prefer-readonly.md index 3aaa045e0ee..7d145515e12 100644 --- a/packages/eslint-plugin/docs/rules/prefer-readonly.md +++ b/packages/eslint-plugin/docs/rules/prefer-readonly.md @@ -94,6 +94,6 @@ class Container { - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md b/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md index be739601366..49ef8d4330d 100644 --- a/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +++ b/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md @@ -72,6 +72,6 @@ If you don't want to use typechecking in your linting, you can't use this rule. - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md b/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md index 43bf7d4b41d..d4a415752f3 100644 --- a/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md +++ b/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md @@ -63,6 +63,6 @@ If you prefer consistent use of `String#match` for both, with `g` flag and witho - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-return-this-type.md b/packages/eslint-plugin/docs/rules/prefer-return-this-type.md index ea711fad854..d6648458767 100644 --- a/packages/eslint-plugin/docs/rules/prefer-return-this-type.md +++ b/packages/eslint-plugin/docs/rules/prefer-return-this-type.md @@ -114,6 +114,6 @@ If you don't use method chaining or explicit return values, you can safely turn - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md b/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md index 0bfbd771287..0ae2553c09d 100644 --- a/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +++ b/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md @@ -66,6 +66,6 @@ If you don't mind that style, you can turn this rule off safely. - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md b/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md index d38b0058616..06811604ce2 100644 --- a/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md +++ b/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md @@ -87,6 +87,6 @@ If you are **NOT** using TypeScript 3.9 (or greater), then you will not be able - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/promise-function-async.md b/packages/eslint-plugin/docs/rules/promise-function-async.md index 98e1bcf95ba..2191277b83b 100644 --- a/packages/eslint-plugin/docs/rules/promise-function-async.md +++ b/packages/eslint-plugin/docs/rules/promise-function-async.md @@ -75,6 +75,6 @@ In addition, each of the following properties may be provided, and default to `t - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/quotes.md b/packages/eslint-plugin/docs/rules/quotes.md index ba2e8ba7364..daaf3e509bc 100644 --- a/packages/eslint-plugin/docs/rules/quotes.md +++ b/packages/eslint-plugin/docs/rules/quotes.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/require-array-sort-compare.md b/packages/eslint-plugin/docs/rules/require-array-sort-compare.md index 6c1750ebb8c..74d1a8dc4fb 100644 --- a/packages/eslint-plugin/docs/rules/require-array-sort-compare.md +++ b/packages/eslint-plugin/docs/rules/require-array-sort-compare.md @@ -102,6 +102,6 @@ If you understand the language specification enough, you can turn this rule off - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/require-await.md b/packages/eslint-plugin/docs/rules/require-await.md index 0cfe4a2b924..c75a40803ce 100644 --- a/packages/eslint-plugin/docs/rules/require-await.md +++ b/packages/eslint-plugin/docs/rules/require-await.md @@ -41,6 +41,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/restrict-plus-operands.md b/packages/eslint-plugin/docs/rules/restrict-plus-operands.md index 0c9fd72cbec..d4741186e4c 100644 --- a/packages/eslint-plugin/docs/rules/restrict-plus-operands.md +++ b/packages/eslint-plugin/docs/rules/restrict-plus-operands.md @@ -109,6 +109,6 @@ var fn = (a: any, b: number) => a + b; - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/restrict-template-expressions.md b/packages/eslint-plugin/docs/rules/restrict-template-expressions.md index 8cc3b2dade8..5593090a482 100644 --- a/packages/eslint-plugin/docs/rules/restrict-template-expressions.md +++ b/packages/eslint-plugin/docs/rules/restrict-template-expressions.md @@ -113,6 +113,6 @@ const msg1 = `arg = ${arg}`; - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/return-await.md b/packages/eslint-plugin/docs/rules/return-await.md index a7947399fe2..8d4e97298da 100644 --- a/packages/eslint-plugin/docs/rules/return-await.md +++ b/packages/eslint-plugin/docs/rules/return-await.md @@ -225,6 +225,6 @@ async function validNever3() { - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/semi.md b/packages/eslint-plugin/docs/rules/semi.md index 279edfa5f38..7a9e125fa2b 100644 --- a/packages/eslint-plugin/docs/rules/semi.md +++ b/packages/eslint-plugin/docs/rules/semi.md @@ -35,6 +35,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md b/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md index eda5da2435c..49639338141 100644 --- a/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +++ b/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md @@ -156,6 +156,6 @@ The ordering of groups is determined by this option. - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/space-before-blocks.md b/packages/eslint-plugin/docs/rules/space-before-blocks.md index 0de1755826b..dce543bbf21 100644 --- a/packages/eslint-plugin/docs/rules/space-before-blocks.md +++ b/packages/eslint-plugin/docs/rules/space-before-blocks.md @@ -57,6 +57,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/maste - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/space-before-function-paren.md b/packages/eslint-plugin/docs/rules/space-before-function-paren.md index 7b03dcba979..88f6d5d4c99 100644 --- a/packages/eslint-plugin/docs/rules/space-before-function-paren.md +++ b/packages/eslint-plugin/docs/rules/space-before-function-paren.md @@ -31,6 +31,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/space-infix-ops.md b/packages/eslint-plugin/docs/rules/space-infix-ops.md index 26fa5e34ec8..21dd58c312d 100644 --- a/packages/eslint-plugin/docs/rules/space-infix-ops.md +++ b/packages/eslint-plugin/docs/rules/space-infix-ops.md @@ -35,6 +35,6 @@ Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/ - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md index f1d25ba595c..f993881c8c2 100644 --- a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md +++ b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md @@ -202,6 +202,6 @@ This rule provides following fixes and suggestions for particular types in boole - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md b/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md index 8884022bb26..df6fc1f72bc 100644 --- a/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +++ b/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md @@ -127,6 +127,6 @@ If program doesn't have union types with many parts. Downside of this rule is th - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/triple-slash-reference.md b/packages/eslint-plugin/docs/rules/triple-slash-reference.md index 1dda84ec30d..2488d28ab13 100644 --- a/packages/eslint-plugin/docs/rules/triple-slash-reference.md +++ b/packages/eslint-plugin/docs/rules/triple-slash-reference.md @@ -61,6 +61,6 @@ If you want to use all flavors of triple slash reference directives. - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/type-annotation-spacing.md b/packages/eslint-plugin/docs/rules/type-annotation-spacing.md index ca6f0152171..903e9faf819 100644 --- a/packages/eslint-plugin/docs/rules/type-annotation-spacing.md +++ b/packages/eslint-plugin/docs/rules/type-annotation-spacing.md @@ -316,6 +316,6 @@ If you don't want to enforce spacing for your type annotations, you can safely t - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [x] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/typedef.md b/packages/eslint-plugin/docs/rules/typedef.md index 8f8ed5568c4..cbe3bcd3cb0 100644 --- a/packages/eslint-plugin/docs/rules/typedef.md +++ b/packages/eslint-plugin/docs/rules/typedef.md @@ -345,6 +345,6 @@ In general, if you do not consider the cost of writing unnecessary type annotati - Configs: - [ ] ✅ Recommended - - [ ] ✔ Strict + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/unbound-method.md b/packages/eslint-plugin/docs/rules/unbound-method.md index 17a968dc689..cef79e42601 100644 --- a/packages/eslint-plugin/docs/rules/unbound-method.md +++ b/packages/eslint-plugin/docs/rules/unbound-method.md @@ -123,6 +123,6 @@ If you're wanting to use `toBeCalled` and similar matches in `jest` tests, you c - Configs: - [x] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [x] 💭 Requires type information diff --git a/packages/eslint-plugin/docs/rules/unified-signatures.md b/packages/eslint-plugin/docs/rules/unified-signatures.md index 43961039288..b308aff9d63 100644 --- a/packages/eslint-plugin/docs/rules/unified-signatures.md +++ b/packages/eslint-plugin/docs/rules/unified-signatures.md @@ -84,6 +84,6 @@ function f(...a: string[]): void; - Configs: - [ ] ✅ Recommended - - [x] ✔ Strict + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/tests/docs.test.ts b/packages/eslint-plugin/tests/docs.test.ts index 201d3876be3..40eec1f7dc6 100644 --- a/packages/eslint-plugin/tests/docs.test.ts +++ b/packages/eslint-plugin/tests/docs.test.ts @@ -293,7 +293,7 @@ describe('Validating README.md', () => { it('Recommended column should be correct', () => { expect(ruleRow[2]).toBe( rule.meta.docs?.recommended === 'strict' - ? ':heavy_check_mark:' + ? ':lock:' : rule.meta.docs?.recommended ? ':white_check_mark:' : '', diff --git a/packages/eslint-plugin/tools/generate-rules-lists.ts b/packages/eslint-plugin/tools/generate-rules-lists.ts index 0831f432a03..85110db9ab3 100644 --- a/packages/eslint-plugin/tools/generate-rules-lists.ts +++ b/packages/eslint-plugin/tools/generate-rules-lists.ts @@ -20,14 +20,14 @@ interface RuleDetails { type RuleColumn = [ string, string, - ':heavy_check_mark:' | ':white_check_mark:' | '', + ':lock:' | ':white_check_mark:' | '', ':wrench:' | '', ':thought_balloon:' | '', ]; const emojiKey = { recommended: ':white_check_mark:', - strict: ':heavy_check_mark:', + strict: ':lock:', fixable: ':wrench:', requiresTypeChecking: ':thought_balloon:', } as const; diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index e288c7263ff..699deff005a 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -73,7 +73,7 @@ interface RuleMetaData { */ replacedBy?: readonly string[]; /** - * The options schema. Supply an empty array if This rule is not configurable. + * The options schema. Supply an empty array if there are no options. */ schema: JSONSchema4 | readonly JSONSchema4[]; } From 0fe329e8f851483759e6c9f1a69caae94d7f20be Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 15 May 2022 18:53:50 -0400 Subject: [PATCH 17/20] chore: mostly fixed up docs, probably one or two more things to do --- packages/eslint-plugin/README.md | 1 + packages/eslint-plugin/docs/rules/README.md | 262 ++++++------------ .../docs/rules/no-duplicate-enum-values.md | 4 +- .../src/rules/no-duplicate-enum-values.ts | 2 +- 4 files changed, 92 insertions(+), 177 deletions(-) diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 696cee8cba8..d5288c3b8e1 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -119,6 +119,7 @@ Pro Tip: For larger codebases you may want to consider splitting our linting int | [`@typescript-eslint/no-base-to-string`](./docs/rules/no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | :lock: | | :thought_balloon: | | [`@typescript-eslint/no-confusing-non-null-assertion`](./docs/rules/no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | :lock: | :wrench: | | | [`@typescript-eslint/no-confusing-void-expression`](./docs/rules/no-confusing-void-expression.md) | Requires expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-duplicate-enum-values`](./docs/rules/no-duplicate-enum-values.md) | Disallow duplicate enum member values | :lock: | | | | [`@typescript-eslint/no-dynamic-delete`](./docs/rules/no-dynamic-delete.md) | Disallow the delete operator with computed key expressions | :lock: | :wrench: | | | [`@typescript-eslint/no-empty-interface`](./docs/rules/no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | | [`@typescript-eslint/no-explicit-any`](./docs/rules/no-explicit-any.md) | Disallow usage of the `any` type | :white_check_mark: | :wrench: | | diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md index 017ee012d22..6dced58b861 100644 --- a/packages/eslint-plugin/docs/rules/README.md +++ b/packages/eslint-plugin/docs/rules/README.md @@ -15,182 +15,94 @@ See [Presets](/docs/linting/presets) for how to enable recommended rules using p **Key**: :white_check_mark: = recommended, :lock: = strict, :wrench: = fixable, :thought_balloon: = requires type information -<<<<<<< HEAD -| Name | Description | :white_check_mark::lock: | :wrench: | :thought_balloon: | +| Name | Description | :white_check_mark::lock: | :wrench: | :thought_balloon: | | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- | ------------------------ | -------- | ----------------- | -| [`@typescript-eslint/adjacent-overload-signatures`](./adjacent-overload-signatures.md) | Require that member overloads be consecutive | :white_check_mark: | | | -| [`@typescript-eslint/array-type`](./array-type.md) | Requires using either `T[]` or `Array` for arrays | :lock: | :wrench: | | -| [`@typescript-eslint/await-thenable`](./await-thenable.md) | Disallows awaiting a value that is not a Thenable | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/ban-ts-comment`](./ban-ts-comment.md) | Bans `@ts-` comments from being used or requires descriptions after directive | :white_check_mark: | | | -| [`@typescript-eslint/ban-tslint-comment`](./ban-tslint-comment.md) | Bans `// tslint:` comments from being used | :lock: | :wrench: | | -| [`@typescript-eslint/ban-types`](./ban-types.md) | Bans specific types from being used | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/class-literal-property-style`](./class-literal-property-style.md) | Ensures that literals on classes are exposed in a consistent style | :lock: | :wrench: | | -| [`@typescript-eslint/consistent-indexed-object-style`](./consistent-indexed-object-style.md) | Enforce or disallow the use of the record type | :lock: | :wrench: | | -| [`@typescript-eslint/consistent-type-assertions`](./consistent-type-assertions.md) | Enforces consistent usage of type assertions | :lock: | | | -| [`@typescript-eslint/consistent-type-definitions`](./consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | :lock: | :wrench: | | -| [`@typescript-eslint/consistent-type-exports`](./consistent-type-exports.md) | Enforces consistent usage of type exports | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/consistent-type-imports`](./consistent-type-imports.md) | Enforces consistent usage of type imports | | :wrench: | | -| [`@typescript-eslint/explicit-function-return-type`](./explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | -| [`@typescript-eslint/explicit-member-accessibility`](./explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | -| [`@typescript-eslint/explicit-module-boundary-types`](./explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | -| [`@typescript-eslint/member-delimiter-style`](./member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | -| [`@typescript-eslint/member-ordering`](./member-ordering.md) | Require a consistent member declaration order | | | | -| [`@typescript-eslint/method-signature-style`](./method-signature-style.md) | Enforces using a particular method signature syntax. | | :wrench: | | -| [`@typescript-eslint/naming-convention`](./naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | -| [`@typescript-eslint/no-base-to-string`](./no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | :lock: | | :thought_balloon: | -| [`@typescript-eslint/no-confusing-non-null-assertion`](./no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | :lock: | :wrench: | | -| [`@typescript-eslint/no-confusing-void-expression`](./no-confusing-void-expression.md) | Requires expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-dynamic-delete`](./no-dynamic-delete.md) | Disallow the delete operator with computed key expressions | :lock: | :wrench: | | -| [`@typescript-eslint/no-empty-interface`](./no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-explicit-any`](./no-explicit-any.md) | Disallow usage of the `any` type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extra-non-null-assertion`](./no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extraneous-class`](./no-extraneous-class.md) | Forbids the use of classes as namespaces | :lock: | | | -| [`@typescript-eslint/no-floating-promises`](./no-floating-promises.md) | Requires Promise-like statements to be handled appropriately | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-for-in-array`](./no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-inferrable-types`](./no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-invalid-void-type`](./no-invalid-void-type.md) | Disallows usage of `void` type outside of generic or return types | :lock: | | | -| [`@typescript-eslint/no-meaningless-void-operator`](./no-meaningless-void-operator.md) | Disallow the `void` operator except when used to discard a value | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-misused-new`](./no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :white_check_mark: | | | -| [`@typescript-eslint/no-misused-promises`](./no-misused-promises.md) | Avoid using Promises in places not designed to handle them | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-namespace`](./no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./no-non-null-asserted-nullish-coalescing.md) | Disallows using a non-null assertion in the left operand of the nullish coalescing operator | :lock: | | | -| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./no-non-null-asserted-optional-chain.md) | Disallows using a non-null assertion after an optional chain expression | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-assertion`](./no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :white_check_mark: | | | -| [`@typescript-eslint/no-parameter-properties`](./no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | | -| [`@typescript-eslint/no-redundant-type-constituents`](./no-redundant-type-constituents.md) | Disallow members of unions and intersections that do nothing or override type information | | | :thought_balloon: | -| [`@typescript-eslint/no-require-imports`](./no-require-imports.md) | Disallows invocation of `require()` | | | | -| [`@typescript-eslint/no-this-alias`](./no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | -| [`@typescript-eslint/no-type-alias`](./no-type-alias.md) | Disallow the use of type aliases | | | | -| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./no-unnecessary-boolean-literal-compare.md) | Flags unnecessary equality comparisons against boolean literals | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-condition`](./no-unnecessary-condition.md) | Prevents conditionals where the type is always truthy or always falsy | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-qualifier`](./no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-arguments`](./no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-assertion`](./no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-constraint`](./no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-unsafe-argument`](./no-unsafe-argument.md) | Disallows calling a function with an any type value | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-assignment`](./no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-call`](./no-unsafe-call.md) | Disallows calling an any type value | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-member-access`](./no-unsafe-member-access.md) | Disallows member access on any typed variables | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-return`](./no-unsafe-return.md) | Disallows returning any from a function | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-useless-empty-export`](./no-useless-empty-export.md) | Disallow empty exports that don't change anything in a module file | | :wrench: | | -| [`@typescript-eslint/no-var-requires`](./no-var-requires.md) | Disallows the use of require statements except in import statements | :white_check_mark: | | | -| [`@typescript-eslint/non-nullable-type-assertion-style`](./non-nullable-type-assertion-style.md) | Prefers a non-null assertion over explicit type cast when possible | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-as-const`](./prefer-as-const.md) | Prefer usage of `as const` over literal type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-enum-initializers`](./prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | -| [`@typescript-eslint/prefer-for-of`](./prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | :lock: | | | -| [`@typescript-eslint/prefer-function-type`](./prefer-function-type.md) | Use function types instead of interfaces with call signatures | :lock: | :wrench: | | -| [`@typescript-eslint/prefer-includes`](./prefer-includes.md) | Enforce `includes` method over `indexOf` method | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-literal-enum-member`](./prefer-literal-enum-member.md) | Require that all enum members be literal values to prevent unintended enum member name shadow issues | :lock: | | | -| [`@typescript-eslint/prefer-namespace-keyword`](./prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-nullish-coalescing`](./prefer-nullish-coalescing.md) | Enforce the usage of the nullish coalescing operator instead of logical chaining | :lock: | | :thought_balloon: | -| [`@typescript-eslint/prefer-optional-chain`](./prefer-optional-chain.md) | Prefer using concise optional chain expressions instead of chained logical ands | :lock: | | | -| [`@typescript-eslint/prefer-readonly`](./prefer-readonly.md) | Requires that private members are marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-readonly-parameter-types`](./prefer-readonly-parameter-types.md) | Requires that function parameters are typed as readonly to prevent accidental mutation of inputs | | | :thought_balloon: | -| [`@typescript-eslint/prefer-reduce-type-parameter`](./prefer-reduce-type-parameter.md) | Prefer using type parameter when calling `Array#reduce` instead of casting | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-regexp-exec`](./prefer-regexp-exec.md) | Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-return-this-type`](./prefer-return-this-type.md) | Enforce that `this` is used when only `this` type is returned | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-string-starts-ends-with`](./prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-ts-expect-error`](./prefer-ts-expect-error.md) | Recommends using `@ts-expect-error` over `@ts-ignore` | :lock: | :wrench: | | -| [`@typescript-eslint/promise-function-async`](./promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/require-array-sort-compare`](./require-array-sort-compare.md) | Requires `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | -| [`@typescript-eslint/restrict-plus-operands`](./restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/restrict-template-expressions`](./restrict-template-expressions.md) | Enforce template literal expressions to be of string type | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/sort-type-union-intersection-members`](./sort-type-union-intersection-members.md) | Enforces that members of a type union/intersection are sorted alphabetically | | :wrench: | | -| [`@typescript-eslint/strict-boolean-expressions`](./strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/switch-exhaustiveness-check`](./switch-exhaustiveness-check.md) | Exhaustiveness checking in switch with union type | | | :thought_balloon: | -| [`@typescript-eslint/triple-slash-reference`](./triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :white_check_mark: | | | -| [`@typescript-eslint/type-annotation-spacing`](./type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | -| [`@typescript-eslint/typedef`](./typedef.md) | Requires type annotations to exist | | | | -| [`@typescript-eslint/unbound-method`](./unbound-method.md) | Enforces unbound methods are called with their expected scope | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/unified-signatures`](./unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | :lock: | | | -======= -| Name | Description | :white_check_mark: | :wrench: | :thought_balloon: | -| ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- | ------------------ | -------- | ----------------- | -| [`@typescript-eslint/adjacent-overload-signatures`](./adjacent-overload-signatures.md) | Require that member overloads be consecutive | :white_check_mark: | | | -| [`@typescript-eslint/array-type`](./array-type.md) | Requires using either `T[]` or `Array` for arrays | | :wrench: | | -| [`@typescript-eslint/await-thenable`](./await-thenable.md) | Disallows awaiting a value that is not a Thenable | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/ban-ts-comment`](./ban-ts-comment.md) | Bans `@ts-` comments from being used or requires descriptions after directive | :white_check_mark: | | | -| [`@typescript-eslint/ban-tslint-comment`](./ban-tslint-comment.md) | Bans `// tslint:` comments from being used | | :wrench: | | -| [`@typescript-eslint/ban-types`](./ban-types.md) | Bans specific types from being used | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/class-literal-property-style`](./class-literal-property-style.md) | Ensures that literals on classes are exposed in a consistent style | | :wrench: | | -| [`@typescript-eslint/consistent-indexed-object-style`](./consistent-indexed-object-style.md) | Enforce or disallow the use of the record type | | :wrench: | | -| [`@typescript-eslint/consistent-type-assertions`](./consistent-type-assertions.md) | Enforces consistent usage of type assertions | | | | -| [`@typescript-eslint/consistent-type-definitions`](./consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | | :wrench: | | -| [`@typescript-eslint/consistent-type-exports`](./consistent-type-exports.md) | Enforces consistent usage of type exports | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/consistent-type-imports`](./consistent-type-imports.md) | Enforces consistent usage of type imports | | :wrench: | | -| [`@typescript-eslint/explicit-function-return-type`](./explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | -| [`@typescript-eslint/explicit-member-accessibility`](./explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | -| [`@typescript-eslint/explicit-module-boundary-types`](./explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | -| [`@typescript-eslint/member-delimiter-style`](./member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | -| [`@typescript-eslint/member-ordering`](./member-ordering.md) | Require a consistent member declaration order | | | | -| [`@typescript-eslint/method-signature-style`](./method-signature-style.md) | Enforces using a particular method signature syntax | | :wrench: | | -| [`@typescript-eslint/naming-convention`](./naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | -| [`@typescript-eslint/no-base-to-string`](./no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | | | :thought_balloon: | -| [`@typescript-eslint/no-confusing-non-null-assertion`](./no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | | :wrench: | | -| [`@typescript-eslint/no-confusing-void-expression`](./no-confusing-void-expression.md) | Requires expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-dynamic-delete`](./no-dynamic-delete.md) | Disallow the delete operator with computed key expressions | | :wrench: | | -| [`@typescript-eslint/no-empty-interface`](./no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-explicit-any`](./no-explicit-any.md) | Disallow usage of the `any` type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extra-non-null-assertion`](./no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extraneous-class`](./no-extraneous-class.md) | Forbids the use of classes as namespaces | | | | -| [`@typescript-eslint/no-floating-promises`](./no-floating-promises.md) | Requires Promise-like statements to be handled appropriately | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-for-in-array`](./no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-inferrable-types`](./no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-invalid-void-type`](./no-invalid-void-type.md) | Disallows usage of `void` type outside of generic or return types | | | | -| [`@typescript-eslint/no-meaningless-void-operator`](./no-meaningless-void-operator.md) | Disallow the `void` operator except when used to discard a value | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-misused-new`](./no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :white_check_mark: | | | -| [`@typescript-eslint/no-misused-promises`](./no-misused-promises.md) | Avoid using Promises in places not designed to handle them | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-namespace`](./no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./no-non-null-asserted-nullish-coalescing.md) | Disallows using a non-null assertion in the left operand of the nullish coalescing operator | | | | -| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./no-non-null-asserted-optional-chain.md) | Disallows using a non-null assertion after an optional chain expression | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-assertion`](./no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :white_check_mark: | | | -| [`@typescript-eslint/no-require-imports`](./no-require-imports.md) | Disallows invocation of `require()` | | | | -| [`@typescript-eslint/no-this-alias`](./no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | -| [`@typescript-eslint/no-type-alias`](./no-type-alias.md) | Disallow the use of type aliases | | | | -| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./no-unnecessary-boolean-literal-compare.md) | Flags unnecessary equality comparisons against boolean literals | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-condition`](./no-unnecessary-condition.md) | Prevents conditionals where the type is always truthy or always falsy | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-qualifier`](./no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-arguments`](./no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-assertion`](./no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-constraint`](./no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | | | -| [`@typescript-eslint/no-unsafe-argument`](./no-unsafe-argument.md) | Disallows calling a function with an any type value | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-assignment`](./no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-call`](./no-unsafe-call.md) | Disallows calling an any type value | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-member-access`](./no-unsafe-member-access.md) | Disallows member access on any typed variables | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-return`](./no-unsafe-return.md) | Disallows returning any from a function | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-var-requires`](./no-var-requires.md) | Disallows the use of require statements except in import statements | :white_check_mark: | | | -| [`@typescript-eslint/non-nullable-type-assertion-style`](./non-nullable-type-assertion-style.md) | Prefers a non-null assertion over explicit type cast when possible | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/parameter-properties`](./parameter-properties.md) | Require or disallow the use of parameter properties in class constructors | | | | -| [`@typescript-eslint/prefer-as-const`](./prefer-as-const.md) | Prefer usage of `as const` over literal type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-enum-initializers`](./prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | -| [`@typescript-eslint/prefer-for-of`](./prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | | | | -| [`@typescript-eslint/prefer-function-type`](./prefer-function-type.md) | Use function types instead of interfaces with call signatures | | :wrench: | | -| [`@typescript-eslint/prefer-includes`](./prefer-includes.md) | Enforce `includes` method over `indexOf` method | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-literal-enum-member`](./prefer-literal-enum-member.md) | Require that all enum members be literal values to prevent unintended enum member name shadow issues | | | | -| [`@typescript-eslint/prefer-namespace-keyword`](./prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-nullish-coalescing`](./prefer-nullish-coalescing.md) | Enforce the usage of the nullish coalescing operator instead of logical chaining | | | :thought_balloon: | -| [`@typescript-eslint/prefer-optional-chain`](./prefer-optional-chain.md) | Prefer using concise optional chain expressions instead of chained logical ands | | | | -| [`@typescript-eslint/prefer-readonly`](./prefer-readonly.md) | Requires that private members are marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-readonly-parameter-types`](./prefer-readonly-parameter-types.md) | Requires that function parameters are typed as readonly to prevent accidental mutation of inputs | | | :thought_balloon: | -| [`@typescript-eslint/prefer-reduce-type-parameter`](./prefer-reduce-type-parameter.md) | Prefer using type parameter when calling `Array#reduce` instead of casting | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-regexp-exec`](./prefer-regexp-exec.md) | Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-return-this-type`](./prefer-return-this-type.md) | Enforce that `this` is used when only `this` type is returned | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-string-starts-ends-with`](./prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-ts-expect-error`](./prefer-ts-expect-error.md) | Recommends using `@ts-expect-error` over `@ts-ignore` | | :wrench: | | -| [`@typescript-eslint/promise-function-async`](./promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/require-array-sort-compare`](./require-array-sort-compare.md) | Requires `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | -| [`@typescript-eslint/restrict-plus-operands`](./restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/restrict-template-expressions`](./restrict-template-expressions.md) | Enforce template literal expressions to be of string type | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/sort-type-union-intersection-members`](./sort-type-union-intersection-members.md) | Enforces that members of a type union/intersection are sorted alphabetically | | :wrench: | | -| [`@typescript-eslint/strict-boolean-expressions`](./strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/switch-exhaustiveness-check`](./switch-exhaustiveness-check.md) | Exhaustiveness checking in switch with union type | | | :thought_balloon: | -| [`@typescript-eslint/triple-slash-reference`](./triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :white_check_mark: | | | -| [`@typescript-eslint/type-annotation-spacing`](./type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | -| [`@typescript-eslint/typedef`](./typedef.md) | Requires type annotations to exist | | | | -| [`@typescript-eslint/unbound-method`](./unbound-method.md) | Enforces unbound methods are called with their expected scope | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/unified-signatures`](./unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | | | | - -> > > > > > > main +| [`@typescript-eslint/adjacent-overload-signatures`](./adjacent-overload-signatures.md) | Require that member overloads be consecutive | :white_check_mark: | | | +| [`@typescript-eslint/array-type`](./array-type.md) | Requires using either `T[]` or `Array` for arrays | :lock: | :wrench: | | +| [`@typescript-eslint/await-thenable`](./await-thenable.md) | Disallows awaiting a value that is not a Thenable | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/ban-ts-comment`](./ban-ts-comment.md) | Bans `@ts-` comments from being used or requires descriptions after directive | :white_check_mark: | | | +| [`@typescript-eslint/ban-tslint-comment`](./ban-tslint-comment.md) | Bans `// tslint:` comments from being used | :lock: | :wrench: | | +| [`@typescript-eslint/ban-types`](./ban-types.md) | Bans specific types from being used | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/class-literal-property-style`](./class-literal-property-style.md) | Ensures that literals on classes are exposed in a consistent style | :lock: | :wrench: | | +| [`@typescript-eslint/consistent-indexed-object-style`](./consistent-indexed-object-style.md) | Enforce or disallow the use of the record type | :lock: | :wrench: | | +| [`@typescript-eslint/consistent-type-assertions`](./consistent-type-assertions.md) | Enforces consistent usage of type assertions | :lock: | | | +| [`@typescript-eslint/consistent-type-definitions`](./consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | :lock: | :wrench: | | +| [`@typescript-eslint/consistent-type-exports`](./consistent-type-exports.md) | Enforces consistent usage of type exports | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/consistent-type-imports`](./consistent-type-imports.md) | Enforces consistent usage of type imports | | :wrench: | | +| [`@typescript-eslint/explicit-function-return-type`](./explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | +| [`@typescript-eslint/explicit-member-accessibility`](./explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | +| [`@typescript-eslint/explicit-module-boundary-types`](./explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | +| [`@typescript-eslint/member-delimiter-style`](./member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | +| [`@typescript-eslint/member-ordering`](./member-ordering.md) | Require a consistent member declaration order | | | | +| [`@typescript-eslint/method-signature-style`](./method-signature-style.md) | Enforces using a particular method signature syntax. | | :wrench: | | +| [`@typescript-eslint/naming-convention`](./naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | +| [`@typescript-eslint/no-base-to-string`](./no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | :lock: | | :thought_balloon: | +| [`@typescript-eslint/no-confusing-non-null-assertion`](./no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | :lock: | :wrench: | | +| [`@typescript-eslint/no-confusing-void-expression`](./no-confusing-void-expression.md) | Requires expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-duplicate-enum-values`](./docs/rules/no-duplicate-enum-values.md) | Disallow duplicate enum member values | :lock: | | | +| [`@typescript-eslint/no-dynamic-delete`](./no-dynamic-delete.md) | Disallow the delete operator with computed key expressions | :lock: | :wrench: | | +| [`@typescript-eslint/no-empty-interface`](./no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-explicit-any`](./no-explicit-any.md) | Disallow usage of the `any` type | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-extra-non-null-assertion`](./no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-extraneous-class`](./no-extraneous-class.md) | Forbids the use of classes as namespaces | :lock: | | | +| [`@typescript-eslint/no-floating-promises`](./no-floating-promises.md) | Requires Promise-like statements to be handled appropriately | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-for-in-array`](./no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-inferrable-types`](./no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-invalid-void-type`](./no-invalid-void-type.md) | Disallows usage of `void` type outside of generic or return types | :lock: | | | +| [`@typescript-eslint/no-meaningless-void-operator`](./no-meaningless-void-operator.md) | Disallow the `void` operator except when used to discard a value | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-misused-new`](./no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :white_check_mark: | | | +| [`@typescript-eslint/no-misused-promises`](./no-misused-promises.md) | Avoid using Promises in places not designed to handle them | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-namespace`](./no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :white_check_mark: | | | +| [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./no-non-null-asserted-nullish-coalescing.md) | Disallows using a non-null assertion in the left operand of the nullish coalescing operator | :lock: | | | +| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./no-non-null-asserted-optional-chain.md) | Disallows using a non-null assertion after an optional chain expression | :white_check_mark: | | | +| [`@typescript-eslint/no-non-null-assertion`](./no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :white_check_mark: | | | +| [`@typescript-eslint/no-parameter-properties`](./no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | | +| [`@typescript-eslint/no-redundant-type-constituents`](./no-redundant-type-constituents.md) | Disallow members of unions and intersections that do nothing or override type information | | | :thought_balloon: | +| [`@typescript-eslint/no-require-imports`](./no-require-imports.md) | Disallows invocation of `require()` | | | | +| [`@typescript-eslint/no-this-alias`](./no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | +| [`@typescript-eslint/no-type-alias`](./no-type-alias.md) | Disallow the use of type aliases | | | | +| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./no-unnecessary-boolean-literal-compare.md) | Flags unnecessary equality comparisons against boolean literals | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-condition`](./no-unnecessary-condition.md) | Prevents conditionals where the type is always truthy or always falsy | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-qualifier`](./no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-arguments`](./no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-assertion`](./no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-constraint`](./no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-unsafe-argument`](./no-unsafe-argument.md) | Disallows calling a function with an any type value | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-assignment`](./no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-call`](./no-unsafe-call.md) | Disallows calling an any type value | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-member-access`](./no-unsafe-member-access.md) | Disallows member access on any typed variables | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-return`](./no-unsafe-return.md) | Disallows returning any from a function | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-useless-empty-export`](./no-useless-empty-export.md) | Disallow empty exports that don't change anything in a module file | | :wrench: | | +| [`@typescript-eslint/no-var-requires`](./no-var-requires.md) | Disallows the use of require statements except in import statements | :white_check_mark: | | | +| [`@typescript-eslint/non-nullable-type-assertion-style`](./non-nullable-type-assertion-style.md) | Prefers a non-null assertion over explicit type cast when possible | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-as-const`](./prefer-as-const.md) | Prefer usage of `as const` over literal type | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-enum-initializers`](./prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | +| [`@typescript-eslint/prefer-for-of`](./prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | :lock: | | | +| [`@typescript-eslint/prefer-function-type`](./prefer-function-type.md) | Use function types instead of interfaces with call signatures | :lock: | :wrench: | | +| [`@typescript-eslint/prefer-includes`](./prefer-includes.md) | Enforce `includes` method over `indexOf` method | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-literal-enum-member`](./prefer-literal-enum-member.md) | Require that all enum members be literal values to prevent unintended enum member name shadow issues | :lock: | | | +| [`@typescript-eslint/prefer-namespace-keyword`](./prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-nullish-coalescing`](./prefer-nullish-coalescing.md) | Enforce the usage of the nullish coalescing operator instead of logical chaining | :lock: | | :thought_balloon: | +| [`@typescript-eslint/prefer-optional-chain`](./prefer-optional-chain.md) | Prefer using concise optional chain expressions instead of chained logical ands | :lock: | | | +| [`@typescript-eslint/prefer-readonly`](./prefer-readonly.md) | Requires that private members are marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-readonly-parameter-types`](./prefer-readonly-parameter-types.md) | Requires that function parameters are typed as readonly to prevent accidental mutation of inputs | | | :thought_balloon: | +| [`@typescript-eslint/prefer-reduce-type-parameter`](./prefer-reduce-type-parameter.md) | Prefer using type parameter when calling `Array#reduce` instead of casting | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-regexp-exec`](./prefer-regexp-exec.md) | Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-return-this-type`](./prefer-return-this-type.md) | Enforce that `this` is used when only `this` type is returned | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-string-starts-ends-with`](./prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-ts-expect-error`](./prefer-ts-expect-error.md) | Recommends using `@ts-expect-error` over `@ts-ignore` | :lock: | :wrench: | | +| [`@typescript-eslint/promise-function-async`](./promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/require-array-sort-compare`](./require-array-sort-compare.md) | Requires `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | +| [`@typescript-eslint/restrict-plus-operands`](./restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/restrict-template-expressions`](./restrict-template-expressions.md) | Enforce template literal expressions to be of string type | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/sort-type-union-intersection-members`](./sort-type-union-intersection-members.md) | Enforces that members of a type union/intersection are sorted alphabetically | | :wrench: | | +| [`@typescript-eslint/strict-boolean-expressions`](./strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/switch-exhaustiveness-check`](./switch-exhaustiveness-check.md) | Exhaustiveness checking in switch with union type | | | :thought_balloon: | +| [`@typescript-eslint/triple-slash-reference`](./triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :white_check_mark: | | | +| [`@typescript-eslint/type-annotation-spacing`](./type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | +| [`@typescript-eslint/typedef`](./typedef.md) | Requires type annotations to exist | | | | +| [`@typescript-eslint/unbound-method`](./unbound-method.md) | Enforces unbound methods are called with their expected scope | :white_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/unified-signatures`](./unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | :lock: | | | diff --git a/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.md b/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.md index 2146d603980..39ef39162cc 100644 --- a/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.md +++ b/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.md @@ -46,6 +46,8 @@ This rule is not configurable. ## Attributes -- [ ] ✅ Recommended +- Configs: + - [ ] ✅ Recommended + - [x] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts b/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts index 3ede60b9fc3..dcd0f6be36f 100644 --- a/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts +++ b/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts @@ -7,7 +7,7 @@ export default util.createRule({ type: 'problem', docs: { description: 'Disallow duplicate enum member values', - recommended: false, + recommended: 'strict', }, hasSuggestions: true, messages: { From 9f9921cd1de92dd69ca815f4f02638e45189a7eb Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 15 May 2022 19:19:38 -0400 Subject: [PATCH 18/20] docs: method-signature-style period, more in configs.ts --- packages/eslint-plugin/README.md | 2 +- packages/eslint-plugin/docs/rules/README.md | 2 +- packages/eslint-plugin/src/configs/strict.ts | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index d5288c3b8e1..983e41e1d33 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -114,7 +114,7 @@ Pro Tip: For larger codebases you may want to consider splitting our linting int | [`@typescript-eslint/explicit-module-boundary-types`](./docs/rules/explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | | [`@typescript-eslint/member-delimiter-style`](./docs/rules/member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | | [`@typescript-eslint/member-ordering`](./docs/rules/member-ordering.md) | Require a consistent member declaration order | | | | -| [`@typescript-eslint/method-signature-style`](./docs/rules/method-signature-style.md) | Enforces using a particular method signature syntax. | | :wrench: | | +| [`@typescript-eslint/method-signature-style`](./docs/rules/method-signature-style.md) | Enforces using a particular method signature syntax | | :wrench: | | | [`@typescript-eslint/naming-convention`](./docs/rules/naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | | [`@typescript-eslint/no-base-to-string`](./docs/rules/no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | :lock: | | :thought_balloon: | | [`@typescript-eslint/no-confusing-non-null-assertion`](./docs/rules/no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | :lock: | :wrench: | | diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md index 6dced58b861..1387a8cb368 100644 --- a/packages/eslint-plugin/docs/rules/README.md +++ b/packages/eslint-plugin/docs/rules/README.md @@ -34,7 +34,7 @@ See [Presets](/docs/linting/presets) for how to enable recommended rules using p | [`@typescript-eslint/explicit-module-boundary-types`](./explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | | [`@typescript-eslint/member-delimiter-style`](./member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | | [`@typescript-eslint/member-ordering`](./member-ordering.md) | Require a consistent member declaration order | | | | -| [`@typescript-eslint/method-signature-style`](./method-signature-style.md) | Enforces using a particular method signature syntax. | | :wrench: | | +| [`@typescript-eslint/method-signature-style`](./method-signature-style.md) | Enforces using a particular method signature syntax | | :wrench: | | | [`@typescript-eslint/naming-convention`](./naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | | [`@typescript-eslint/no-base-to-string`](./no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | :lock: | | :thought_balloon: | | [`@typescript-eslint/no-confusing-non-null-assertion`](./no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | :lock: | :wrench: | | diff --git a/packages/eslint-plugin/src/configs/strict.ts b/packages/eslint-plugin/src/configs/strict.ts index edd544b5656..2d73c5ba104 100644 --- a/packages/eslint-plugin/src/configs/strict.ts +++ b/packages/eslint-plugin/src/configs/strict.ts @@ -20,6 +20,7 @@ export = { '@typescript-eslint/dot-notation': 'warn', '@typescript-eslint/no-base-to-string': 'warn', '@typescript-eslint/no-confusing-non-null-assertion': 'warn', + '@typescript-eslint/no-duplicate-enum-values': 'warn', '@typescript-eslint/no-dynamic-delete': 'warn', '@typescript-eslint/no-extraneous-class': 'warn', '@typescript-eslint/no-invalid-void-type': 'warn', @@ -33,6 +34,7 @@ export = { 'no-useless-constructor': 'off', '@typescript-eslint/no-useless-constructor': 'warn', '@typescript-eslint/non-nullable-type-assertion-style': 'warn', + '@typescript-eslint/parameter-properties': 'warn', '@typescript-eslint/prefer-for-of': 'warn', '@typescript-eslint/prefer-function-type': 'warn', '@typescript-eslint/prefer-includes': 'warn', From aa469d2a49d5558f8619dd52530f82976d3fa1b7 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 15 May 2022 19:20:32 -0400 Subject: [PATCH 19/20] docs: method-signature-style period, more in configs.ts; fix readmes --- packages/eslint-plugin/README.md | 2 +- packages/eslint-plugin/docs/rules/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 983e41e1d33..362d1c82df3 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -146,7 +146,7 @@ Pro Tip: For larger codebases you may want to consider splitting our linting int | [`@typescript-eslint/no-unnecessary-qualifier`](./docs/rules/no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | | [`@typescript-eslint/no-unnecessary-type-arguments`](./docs/rules/no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | :lock: | :wrench: | :thought_balloon: | | [`@typescript-eslint/no-unnecessary-type-assertion`](./docs/rules/no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-constraint`](./docs/rules/no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-unnecessary-type-constraint`](./docs/rules/no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | | | | [`@typescript-eslint/no-unsafe-argument`](./docs/rules/no-unsafe-argument.md) | Disallows calling a function with an any type value | :white_check_mark: | | :thought_balloon: | | [`@typescript-eslint/no-unsafe-assignment`](./docs/rules/no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :white_check_mark: | | :thought_balloon: | | [`@typescript-eslint/no-unsafe-call`](./docs/rules/no-unsafe-call.md) | Disallows calling an any type value | :white_check_mark: | | :thought_balloon: | diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md index 1387a8cb368..053af2e4e57 100644 --- a/packages/eslint-plugin/docs/rules/README.md +++ b/packages/eslint-plugin/docs/rules/README.md @@ -66,7 +66,7 @@ See [Presets](/docs/linting/presets) for how to enable recommended rules using p | [`@typescript-eslint/no-unnecessary-qualifier`](./no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | | [`@typescript-eslint/no-unnecessary-type-arguments`](./no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | :lock: | :wrench: | :thought_balloon: | | [`@typescript-eslint/no-unnecessary-type-assertion`](./no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-constraint`](./no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | :wrench: | | +| [`@typescript-eslint/no-unnecessary-type-constraint`](./no-unnecessary-type-constraint.md) | Disallows unnecessary constraints on generic types | :white_check_mark: | | | | [`@typescript-eslint/no-unsafe-argument`](./no-unsafe-argument.md) | Disallows calling a function with an any type value | :white_check_mark: | | :thought_balloon: | | [`@typescript-eslint/no-unsafe-assignment`](./no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :white_check_mark: | | :thought_balloon: | | [`@typescript-eslint/no-unsafe-call`](./no-unsafe-call.md) | Disallows calling an any type value | :white_check_mark: | | :thought_balloon: | From be77517805c4beabcfbdb0d9cfd356bfa40e377a Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 15 May 2022 19:36:08 -0400 Subject: [PATCH 20/20] chore: passing configs.test.ts, docs.test.ts locally --- packages/eslint-plugin/README.md | 2 +- packages/eslint-plugin/docs/rules/README.md | 1 + .../docs/rules/no-duplicate-enum-values.md | 11 +++++++++++ .../eslint-plugin/docs/rules/parameter-properties.md | 4 +++- packages/eslint-plugin/src/configs/strict.ts | 1 - 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 362d1c82df3..87137b1d6e5 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -136,7 +136,6 @@ Pro Tip: For larger codebases you may want to consider splitting our linting int | [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./docs/rules/no-non-null-asserted-nullish-coalescing.md) | Disallows using a non-null assertion in the left operand of the nullish coalescing operator | :lock: | | | | [`@typescript-eslint/no-non-null-asserted-optional-chain`](./docs/rules/no-non-null-asserted-optional-chain.md) | Disallows using a non-null assertion after an optional chain expression | :white_check_mark: | | | | [`@typescript-eslint/no-non-null-assertion`](./docs/rules/no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :white_check_mark: | | | -| [`@typescript-eslint/no-parameter-properties`](./docs/rules/no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | | | [`@typescript-eslint/no-redundant-type-constituents`](./docs/rules/no-redundant-type-constituents.md) | Disallow members of unions and intersections that do nothing or override type information | | | :thought_balloon: | | [`@typescript-eslint/no-require-imports`](./docs/rules/no-require-imports.md) | Disallows invocation of `require()` | | | | | [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | @@ -155,6 +154,7 @@ Pro Tip: For larger codebases you may want to consider splitting our linting int | [`@typescript-eslint/no-useless-empty-export`](./docs/rules/no-useless-empty-export.md) | Disallow empty exports that don't change anything in a module file | | :wrench: | | | [`@typescript-eslint/no-var-requires`](./docs/rules/no-var-requires.md) | Disallows the use of require statements except in import statements | :white_check_mark: | | | | [`@typescript-eslint/non-nullable-type-assertion-style`](./docs/rules/non-nullable-type-assertion-style.md) | Prefers a non-null assertion over explicit type cast when possible | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/parameter-properties`](./docs/rules/parameter-properties.md) | Require or disallow the use of parameter properties in class constructors | | | | | [`@typescript-eslint/prefer-as-const`](./docs/rules/prefer-as-const.md) | Prefer usage of `as const` over literal type | :white_check_mark: | :wrench: | | | [`@typescript-eslint/prefer-enum-initializers`](./docs/rules/prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | | [`@typescript-eslint/prefer-for-of`](./docs/rules/prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | :lock: | | | diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md index 053af2e4e57..74d0a71ecf1 100644 --- a/packages/eslint-plugin/docs/rules/README.md +++ b/packages/eslint-plugin/docs/rules/README.md @@ -75,6 +75,7 @@ See [Presets](/docs/linting/presets) for how to enable recommended rules using p | [`@typescript-eslint/no-useless-empty-export`](./no-useless-empty-export.md) | Disallow empty exports that don't change anything in a module file | | :wrench: | | | [`@typescript-eslint/no-var-requires`](./no-var-requires.md) | Disallows the use of require statements except in import statements | :white_check_mark: | | | | [`@typescript-eslint/non-nullable-type-assertion-style`](./non-nullable-type-assertion-style.md) | Prefers a non-null assertion over explicit type cast when possible | :lock: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/parameter-properties`](./parameter-properties.md) | Require or disallow the use of parameter properties in class constructors | | | | | [`@typescript-eslint/prefer-as-const`](./prefer-as-const.md) | Prefer usage of `as const` over literal type | :white_check_mark: | :wrench: | | | [`@typescript-eslint/prefer-enum-initializers`](./prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | | [`@typescript-eslint/prefer-for-of`](./prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | :lock: | | | diff --git a/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.md b/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.md index 39ef39162cc..c2fa1db4eec 100644 --- a/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.md +++ b/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.md @@ -42,6 +42,17 @@ enum E { } ``` +## Options + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/no-duplicate-enum-values": "warn" + } +} +``` + This rule is not configurable. ## Attributes diff --git a/packages/eslint-plugin/docs/rules/parameter-properties.md b/packages/eslint-plugin/docs/rules/parameter-properties.md index 7a86a114902..773216e6cd0 100644 --- a/packages/eslint-plugin/docs/rules/parameter-properties.md +++ b/packages/eslint-plugin/docs/rules/parameter-properties.md @@ -489,6 +489,8 @@ If you don't care about the using parameter properties in constructors, then you ## Attributes -- [ ] ✅ Recommended +- Configs: + - [ ] ✅ Recommended + - [ ] 🔒 Strict - [ ] 🔧 Fixable - [ ] 💭 Requires type information diff --git a/packages/eslint-plugin/src/configs/strict.ts b/packages/eslint-plugin/src/configs/strict.ts index 2d73c5ba104..ca71a982613 100644 --- a/packages/eslint-plugin/src/configs/strict.ts +++ b/packages/eslint-plugin/src/configs/strict.ts @@ -34,7 +34,6 @@ export = { 'no-useless-constructor': 'off', '@typescript-eslint/no-useless-constructor': 'warn', '@typescript-eslint/non-nullable-type-assertion-style': 'warn', - '@typescript-eslint/parameter-properties': 'warn', '@typescript-eslint/prefer-for-of': 'warn', '@typescript-eslint/prefer-function-type': 'warn', '@typescript-eslint/prefer-includes': 'warn',