From dd81343b09dada17b6504900edfea15a8564f8a5 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 11 May 2024 22:56:08 -0700 Subject: [PATCH 1/5] feat(eslint-plugin): apply initial config changes for v8 --- .../src/configs/recommended-type-checked-only.ts | 7 +++++++ .../eslint-plugin/src/configs/recommended-type-checked.ts | 8 ++++++++ packages/eslint-plugin/src/configs/recommended.ts | 1 + .../eslint-plugin/src/configs/strict-type-checked-only.ts | 2 +- packages/eslint-plugin/src/configs/strict-type-checked.ts | 3 ++- packages/eslint-plugin/src/configs/strict.ts | 1 + .../src/configs/stylistic-type-checked-only.ts | 3 +++ .../eslint-plugin/src/configs/stylistic-type-checked.ts | 6 +++++- packages/eslint-plugin/src/configs/stylistic.ts | 3 ++- packages/eslint-plugin/src/rules/no-array-delete.ts | 2 +- packages/eslint-plugin/src/rules/no-unsafe-unary-minus.ts | 1 + packages/eslint-plugin/src/rules/no-unused-expressions.ts | 1 + .../src/rules/no-useless-template-literals.ts | 2 +- packages/eslint-plugin/src/rules/only-throw-error.ts | 2 +- packages/eslint-plugin/src/rules/prefer-find.ts | 1 + packages/eslint-plugin/src/rules/prefer-includes.ts | 2 +- .../eslint-plugin/src/rules/prefer-namespace-keyword.ts | 2 +- .../src/rules/prefer-promise-reject-errors.ts | 2 +- packages/eslint-plugin/src/rules/prefer-regexp-exec.ts | 1 + .../src/configs/recommended-type-checked-only.ts | 7 +++++++ .../src/configs/recommended-type-checked.ts | 8 ++++++++ packages/typescript-eslint/src/configs/recommended.ts | 1 + .../src/configs/strict-type-checked-only.ts | 2 +- .../typescript-eslint/src/configs/strict-type-checked.ts | 3 ++- packages/typescript-eslint/src/configs/strict.ts | 1 + .../src/configs/stylistic-type-checked-only.ts | 3 +++ .../src/configs/stylistic-type-checked.ts | 6 +++++- packages/typescript-eslint/src/configs/stylistic.ts | 3 ++- 28 files changed, 70 insertions(+), 14 deletions(-) diff --git a/packages/eslint-plugin/src/configs/recommended-type-checked-only.ts b/packages/eslint-plugin/src/configs/recommended-type-checked-only.ts index 13a1f5fb4271..237ae21553ff 100644 --- a/packages/eslint-plugin/src/configs/recommended-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/recommended-type-checked-only.ts @@ -11,6 +11,7 @@ export = { extends: ['./configs/base', './configs/eslint-recommended'], rules: { '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/no-array-delete': 'error', '@typescript-eslint/no-base-to-string': 'error', '@typescript-eslint/no-duplicate-type-constituents': 'error', '@typescript-eslint/no-floating-promises': 'error', @@ -26,6 +27,12 @@ export = { '@typescript-eslint/no-unsafe-enum-comparison': 'error', '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', + '@typescript-eslint/no-useless-template-literals': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', 'require-await': 'off', '@typescript-eslint/require-await': 'error', '@typescript-eslint/restrict-plus-operands': 'error', diff --git a/packages/eslint-plugin/src/configs/recommended-type-checked.ts b/packages/eslint-plugin/src/configs/recommended-type-checked.ts index 858eb6555090..867f90c06b7d 100644 --- a/packages/eslint-plugin/src/configs/recommended-type-checked.ts +++ b/packages/eslint-plugin/src/configs/recommended-type-checked.ts @@ -15,6 +15,7 @@ export = { '@typescript-eslint/ban-types': 'error', 'no-array-constructor': 'off', '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-array-delete': 'error', '@typescript-eslint/no-base-to-string': 'error', '@typescript-eslint/no-duplicate-enum-values': 'error', '@typescript-eslint/no-duplicate-type-constituents': 'error', @@ -40,10 +41,17 @@ export = { '@typescript-eslint/no-unsafe-enum-comparison': 'error', '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', + '@typescript-eslint/no-useless-template-literals': 'error', '@typescript-eslint/no-var-requires': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', 'require-await': 'off', '@typescript-eslint/require-await': 'error', '@typescript-eslint/restrict-plus-operands': 'error', diff --git a/packages/eslint-plugin/src/configs/recommended.ts b/packages/eslint-plugin/src/configs/recommended.ts index c93e38eabb2f..a66c303fc656 100644 --- a/packages/eslint-plugin/src/configs/recommended.ts +++ b/packages/eslint-plugin/src/configs/recommended.ts @@ -28,6 +28,7 @@ export = { '@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', '@typescript-eslint/triple-slash-reference': 'error', }, } satisfies ClassicConfig.Config; diff --git a/packages/eslint-plugin/src/configs/strict-type-checked-only.ts b/packages/eslint-plugin/src/configs/strict-type-checked-only.ts index 12709933dfb7..c9afa90bd5d7 100644 --- a/packages/eslint-plugin/src/configs/strict-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/strict-type-checked-only.ts @@ -33,10 +33,10 @@ export = { '@typescript-eslint/no-unsafe-enum-comparison': 'error', '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', '@typescript-eslint/no-useless-template-literals': 'error', 'no-throw-literal': 'off', '@typescript-eslint/only-throw-error': 'error', - '@typescript-eslint/prefer-includes': 'error', 'prefer-promise-reject-errors': 'off', '@typescript-eslint/prefer-promise-reject-errors': 'error', '@typescript-eslint/prefer-reduce-type-parameter': 'error', diff --git a/packages/eslint-plugin/src/configs/strict-type-checked.ts b/packages/eslint-plugin/src/configs/strict-type-checked.ts index 91fd8b1589df..32f831ec79be 100644 --- a/packages/eslint-plugin/src/configs/strict-type-checked.ts +++ b/packages/eslint-plugin/src/configs/strict-type-checked.ts @@ -55,6 +55,7 @@ export = { '@typescript-eslint/no-unsafe-enum-comparison': 'error', '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', 'no-useless-constructor': 'off', @@ -64,8 +65,8 @@ export = { 'no-throw-literal': 'off', '@typescript-eslint/only-throw-error': 'error', '@typescript-eslint/prefer-as-const': 'error', - '@typescript-eslint/prefer-includes': 'error', '@typescript-eslint/prefer-literal-enum-member': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', 'prefer-promise-reject-errors': 'off', '@typescript-eslint/prefer-promise-reject-errors': 'error', '@typescript-eslint/prefer-reduce-type-parameter': 'error', diff --git a/packages/eslint-plugin/src/configs/strict.ts b/packages/eslint-plugin/src/configs/strict.ts index ae000f72d3f5..3ad1a340a8bd 100644 --- a/packages/eslint-plugin/src/configs/strict.ts +++ b/packages/eslint-plugin/src/configs/strict.ts @@ -39,6 +39,7 @@ export = { '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/prefer-as-const': 'error', '@typescript-eslint/prefer-literal-enum-member': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', '@typescript-eslint/prefer-ts-expect-error': 'error', '@typescript-eslint/triple-slash-reference': 'error', '@typescript-eslint/unified-signatures': 'error', diff --git a/packages/eslint-plugin/src/configs/stylistic-type-checked-only.ts b/packages/eslint-plugin/src/configs/stylistic-type-checked-only.ts index d9026c1db57e..03428e419be5 100644 --- a/packages/eslint-plugin/src/configs/stylistic-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/stylistic-type-checked-only.ts @@ -13,8 +13,11 @@ export = { 'dot-notation': 'off', '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/non-nullable-type-assertion-style': 'error', + '@typescript-eslint/prefer-find': 'error', + '@typescript-eslint/prefer-includes': 'error', '@typescript-eslint/prefer-nullish-coalescing': 'error', '@typescript-eslint/prefer-optional-chain': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', '@typescript-eslint/prefer-string-starts-ends-with': 'error', }, } satisfies ClassicConfig.Config; diff --git a/packages/eslint-plugin/src/configs/stylistic-type-checked.ts b/packages/eslint-plugin/src/configs/stylistic-type-checked.ts index 3766c7f5695c..a0124142310f 100644 --- a/packages/eslint-plugin/src/configs/stylistic-type-checked.ts +++ b/packages/eslint-plugin/src/configs/stylistic-type-checked.ts @@ -24,12 +24,16 @@ export = { 'no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'error', '@typescript-eslint/no-inferrable-types': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', '@typescript-eslint/non-nullable-type-assertion-style': 'error', + '@typescript-eslint/prefer-find': 'error', '@typescript-eslint/prefer-for-of': 'error', '@typescript-eslint/prefer-function-type': 'error', - '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/prefer-includes': 'error', '@typescript-eslint/prefer-nullish-coalescing': 'error', '@typescript-eslint/prefer-optional-chain': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', '@typescript-eslint/prefer-string-starts-ends-with': 'error', }, } satisfies ClassicConfig.Config; diff --git a/packages/eslint-plugin/src/configs/stylistic.ts b/packages/eslint-plugin/src/configs/stylistic.ts index d9ac6faf9d9c..54653c3ba84a 100644 --- a/packages/eslint-plugin/src/configs/stylistic.ts +++ b/packages/eslint-plugin/src/configs/stylistic.ts @@ -22,8 +22,9 @@ export = { 'no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'error', '@typescript-eslint/no-inferrable-types': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', '@typescript-eslint/prefer-for-of': 'error', '@typescript-eslint/prefer-function-type': 'error', - '@typescript-eslint/prefer-namespace-keyword': 'error', }, } satisfies ClassicConfig.Config; diff --git a/packages/eslint-plugin/src/rules/no-array-delete.ts b/packages/eslint-plugin/src/rules/no-array-delete.ts index d9900a1df10f..9b6230ebf821 100644 --- a/packages/eslint-plugin/src/rules/no-array-delete.ts +++ b/packages/eslint-plugin/src/rules/no-array-delete.ts @@ -17,7 +17,7 @@ export default createRule<[], MessageId>({ type: 'problem', docs: { description: 'Disallow using the `delete` operator on array values', - recommended: 'strict', + recommended: 'recommended', requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/no-unsafe-unary-minus.ts b/packages/eslint-plugin/src/rules/no-unsafe-unary-minus.ts index 66488e37124a..a61572515437 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-unary-minus.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-unary-minus.ts @@ -12,6 +12,7 @@ export default util.createRule({ type: 'problem', docs: { description: 'Require unary negation to take a number', + recommended: 'recommended', requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/no-unused-expressions.ts b/packages/eslint-plugin/src/rules/no-unused-expressions.ts index 83c2ddd6c527..ed2a8c805c0c 100644 --- a/packages/eslint-plugin/src/rules/no-unused-expressions.ts +++ b/packages/eslint-plugin/src/rules/no-unused-expressions.ts @@ -19,6 +19,7 @@ export default createRule({ docs: { description: 'Disallow unused expressions', extendsBaseRule: true, + recommended: 'stylistic', }, hasSuggestions: baseRule.meta.hasSuggestions, schema: baseRule.meta.schema, diff --git a/packages/eslint-plugin/src/rules/no-useless-template-literals.ts b/packages/eslint-plugin/src/rules/no-useless-template-literals.ts index 4610d406465a..9547d5812353 100644 --- a/packages/eslint-plugin/src/rules/no-useless-template-literals.ts +++ b/packages/eslint-plugin/src/rules/no-useless-template-literals.ts @@ -20,7 +20,7 @@ export default createRule<[], MessageId>({ type: 'suggestion', docs: { description: 'Disallow unnecessary template literals', - recommended: 'strict', + recommended: 'recommended', requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/only-throw-error.ts b/packages/eslint-plugin/src/rules/only-throw-error.ts index 62ce268fc700..45a6dac0942d 100644 --- a/packages/eslint-plugin/src/rules/only-throw-error.ts +++ b/packages/eslint-plugin/src/rules/only-throw-error.ts @@ -25,7 +25,7 @@ export default createRule({ type: 'problem', docs: { description: 'Disallow throwing non-`Error` values as exceptions', - recommended: 'strict', + recommended: 'recommended', extendsBaseRule: 'no-throw-literal', requiresTypeChecking: true, }, diff --git a/packages/eslint-plugin/src/rules/prefer-find.ts b/packages/eslint-plugin/src/rules/prefer-find.ts index 4461ec21da0a..b3234fe8daa3 100644 --- a/packages/eslint-plugin/src/rules/prefer-find.ts +++ b/packages/eslint-plugin/src/rules/prefer-find.ts @@ -18,6 +18,7 @@ export default createRule({ docs: { description: 'Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result', + recommended: 'stylistic', requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-includes.ts b/packages/eslint-plugin/src/rules/prefer-includes.ts index ffd58daf8be0..0354d84bbeed 100644 --- a/packages/eslint-plugin/src/rules/prefer-includes.ts +++ b/packages/eslint-plugin/src/rules/prefer-includes.ts @@ -19,7 +19,7 @@ export default createRule({ type: 'suggestion', docs: { description: 'Enforce `includes` method over `indexOf` method', - recommended: 'strict', + recommended: 'stylistic', requiresTypeChecking: true, }, fixable: 'code', diff --git a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts index 576d896c972d..774c65e53771 100644 --- a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts +++ b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts @@ -9,7 +9,7 @@ export default createRule({ docs: { description: 'Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules', - recommended: 'stylistic', + recommended: 'recommended', }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-promise-reject-errors.ts b/packages/eslint-plugin/src/rules/prefer-promise-reject-errors.ts index 3803b1298b4a..ef15fe918c17 100644 --- a/packages/eslint-plugin/src/rules/prefer-promise-reject-errors.ts +++ b/packages/eslint-plugin/src/rules/prefer-promise-reject-errors.ts @@ -26,7 +26,7 @@ export default createRule({ type: 'suggestion', docs: { description: 'Require using Error objects as Promise rejection reasons', - recommended: 'strict', + recommended: 'recommended', extendsBaseRule: true, requiresTypeChecking: true, }, diff --git a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts index 1b8109f87a5b..e917aa16d481 100644 --- a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts +++ b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts @@ -29,6 +29,7 @@ export default createRule({ docs: { description: 'Enforce `RegExp#exec` over `String#match` if no global flag is provided', + recommended: 'stylistic', requiresTypeChecking: true, }, messages: { diff --git a/packages/typescript-eslint/src/configs/recommended-type-checked-only.ts b/packages/typescript-eslint/src/configs/recommended-type-checked-only.ts index 1d7e8fc5b669..c152d7b1c7e5 100644 --- a/packages/typescript-eslint/src/configs/recommended-type-checked-only.ts +++ b/packages/typescript-eslint/src/configs/recommended-type-checked-only.ts @@ -20,6 +20,7 @@ export default ( name: 'typescript-eslint/recommended-type-checked-only', rules: { '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/no-array-delete': 'error', '@typescript-eslint/no-base-to-string': 'error', '@typescript-eslint/no-duplicate-type-constituents': 'error', '@typescript-eslint/no-floating-promises': 'error', @@ -35,6 +36,12 @@ export default ( '@typescript-eslint/no-unsafe-enum-comparison': 'error', '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', + '@typescript-eslint/no-useless-template-literals': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', 'require-await': 'off', '@typescript-eslint/require-await': 'error', '@typescript-eslint/restrict-plus-operands': 'error', diff --git a/packages/typescript-eslint/src/configs/recommended-type-checked.ts b/packages/typescript-eslint/src/configs/recommended-type-checked.ts index 2d954c705819..377a5ac83600 100644 --- a/packages/typescript-eslint/src/configs/recommended-type-checked.ts +++ b/packages/typescript-eslint/src/configs/recommended-type-checked.ts @@ -24,6 +24,7 @@ export default ( '@typescript-eslint/ban-types': 'error', 'no-array-constructor': 'off', '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-array-delete': 'error', '@typescript-eslint/no-base-to-string': 'error', '@typescript-eslint/no-duplicate-enum-values': 'error', '@typescript-eslint/no-duplicate-type-constituents': 'error', @@ -49,10 +50,17 @@ export default ( '@typescript-eslint/no-unsafe-enum-comparison': 'error', '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', + '@typescript-eslint/no-useless-template-literals': 'error', '@typescript-eslint/no-var-requires': 'error', + 'no-throw-literal': 'off', + '@typescript-eslint/only-throw-error': 'error', '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + 'prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'error', 'require-await': 'off', '@typescript-eslint/require-await': 'error', '@typescript-eslint/restrict-plus-operands': 'error', diff --git a/packages/typescript-eslint/src/configs/recommended.ts b/packages/typescript-eslint/src/configs/recommended.ts index 7df78599ea91..ef78846d16f5 100644 --- a/packages/typescript-eslint/src/configs/recommended.ts +++ b/packages/typescript-eslint/src/configs/recommended.ts @@ -37,6 +37,7 @@ export default ( '@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', '@typescript-eslint/triple-slash-reference': 'error', }, }, diff --git a/packages/typescript-eslint/src/configs/strict-type-checked-only.ts b/packages/typescript-eslint/src/configs/strict-type-checked-only.ts index f17b5280ca49..d725cdb4b85f 100644 --- a/packages/typescript-eslint/src/configs/strict-type-checked-only.ts +++ b/packages/typescript-eslint/src/configs/strict-type-checked-only.ts @@ -42,10 +42,10 @@ export default ( '@typescript-eslint/no-unsafe-enum-comparison': 'error', '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', '@typescript-eslint/no-useless-template-literals': 'error', 'no-throw-literal': 'off', '@typescript-eslint/only-throw-error': 'error', - '@typescript-eslint/prefer-includes': 'error', 'prefer-promise-reject-errors': 'off', '@typescript-eslint/prefer-promise-reject-errors': 'error', '@typescript-eslint/prefer-reduce-type-parameter': 'error', diff --git a/packages/typescript-eslint/src/configs/strict-type-checked.ts b/packages/typescript-eslint/src/configs/strict-type-checked.ts index 1542bf528504..16c7b6cd7aa6 100644 --- a/packages/typescript-eslint/src/configs/strict-type-checked.ts +++ b/packages/typescript-eslint/src/configs/strict-type-checked.ts @@ -64,6 +64,7 @@ export default ( '@typescript-eslint/no-unsafe-enum-comparison': 'error', '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/no-unsafe-unary-minus': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', 'no-useless-constructor': 'off', @@ -73,8 +74,8 @@ export default ( 'no-throw-literal': 'off', '@typescript-eslint/only-throw-error': 'error', '@typescript-eslint/prefer-as-const': 'error', - '@typescript-eslint/prefer-includes': 'error', '@typescript-eslint/prefer-literal-enum-member': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', 'prefer-promise-reject-errors': 'off', '@typescript-eslint/prefer-promise-reject-errors': 'error', '@typescript-eslint/prefer-reduce-type-parameter': 'error', diff --git a/packages/typescript-eslint/src/configs/strict.ts b/packages/typescript-eslint/src/configs/strict.ts index 680813d7d64f..b3fe1673e62b 100644 --- a/packages/typescript-eslint/src/configs/strict.ts +++ b/packages/typescript-eslint/src/configs/strict.ts @@ -48,6 +48,7 @@ export default ( '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/prefer-as-const': 'error', '@typescript-eslint/prefer-literal-enum-member': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', '@typescript-eslint/prefer-ts-expect-error': 'error', '@typescript-eslint/triple-slash-reference': 'error', '@typescript-eslint/unified-signatures': 'error', diff --git a/packages/typescript-eslint/src/configs/stylistic-type-checked-only.ts b/packages/typescript-eslint/src/configs/stylistic-type-checked-only.ts index 2cd41eba5178..39354a3cc759 100644 --- a/packages/typescript-eslint/src/configs/stylistic-type-checked-only.ts +++ b/packages/typescript-eslint/src/configs/stylistic-type-checked-only.ts @@ -22,8 +22,11 @@ export default ( 'dot-notation': 'off', '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/non-nullable-type-assertion-style': 'error', + '@typescript-eslint/prefer-find': 'error', + '@typescript-eslint/prefer-includes': 'error', '@typescript-eslint/prefer-nullish-coalescing': 'error', '@typescript-eslint/prefer-optional-chain': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', '@typescript-eslint/prefer-string-starts-ends-with': 'error', }, }, diff --git a/packages/typescript-eslint/src/configs/stylistic-type-checked.ts b/packages/typescript-eslint/src/configs/stylistic-type-checked.ts index 63ef5a71d0f4..d1b739c9cf20 100644 --- a/packages/typescript-eslint/src/configs/stylistic-type-checked.ts +++ b/packages/typescript-eslint/src/configs/stylistic-type-checked.ts @@ -33,12 +33,16 @@ export default ( 'no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'error', '@typescript-eslint/no-inferrable-types': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', '@typescript-eslint/non-nullable-type-assertion-style': 'error', + '@typescript-eslint/prefer-find': 'error', '@typescript-eslint/prefer-for-of': 'error', '@typescript-eslint/prefer-function-type': 'error', - '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/prefer-includes': 'error', '@typescript-eslint/prefer-nullish-coalescing': 'error', '@typescript-eslint/prefer-optional-chain': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', '@typescript-eslint/prefer-string-starts-ends-with': 'error', }, }, diff --git a/packages/typescript-eslint/src/configs/stylistic.ts b/packages/typescript-eslint/src/configs/stylistic.ts index 6e12fe9de23a..c2e86ce09ee4 100644 --- a/packages/typescript-eslint/src/configs/stylistic.ts +++ b/packages/typescript-eslint/src/configs/stylistic.ts @@ -31,9 +31,10 @@ export default ( 'no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'error', '@typescript-eslint/no-inferrable-types': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', '@typescript-eslint/prefer-for-of': 'error', '@typescript-eslint/prefer-function-type': 'error', - '@typescript-eslint/prefer-namespace-keyword': 'error', }, }, ]; From aa5525f0dfd15265ebd4a364dcc5aca12bfc676d Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 12 May 2024 16:49:13 -0700 Subject: [PATCH 2/5] Fixed introduced lint complaints --- .../src/rules/strict-boolean-expressions.ts | 6 ++--- .../src/rules/unified-signatures.ts | 4 ++- .../tests/lib/convert.test.ts | 26 +++++++++---------- .../tests/lib/persistentParse.test.ts | 4 ++- packages/website-eslint/build.ts | 2 +- .../insertions/insertSpecialCaseOptions.ts | 8 +++--- 6 files changed, 27 insertions(+), 23 deletions(-) diff --git a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts index 01e15d3d88c5..a158dfff2ba0 100644 --- a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts +++ b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts @@ -848,9 +848,9 @@ export default createRule({ // If incoming type is boolean, there will be two type objects with // intrinsicName set "true" and "false" each because of ts-api-utils.unionTypeParts() if (booleans.length === 1) { - tsutils.isTrueLiteralType(booleans[0]) - ? variantTypes.add('truthy boolean') - : variantTypes.add('boolean'); + variantTypes.add( + tsutils.isTrueLiteralType(booleans[0]) ? 'truthy boolean' : 'boolean', + ); } else if (booleans.length === 2) { variantTypes.add('boolean'); } diff --git a/packages/eslint-plugin/src/rules/unified-signatures.ts b/packages/eslint-plugin/src/rules/unified-signatures.ts index c8fa2f85f7df..9a6705576ed4 100644 --- a/packages/eslint-plugin/src/rules/unified-signatures.ts +++ b/packages/eslint-plugin/src/rules/unified-signatures.ts @@ -499,7 +499,9 @@ export default createRule({ parent: ScopeNode, typeParameters?: TSESTree.TSTypeParameterDeclaration, ): void { - currentScope && scopes.push(currentScope); + if (currentScope) { + scopes.push(currentScope); + } currentScope = { overloads: new Map(), parent, diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index 640a3d9946ab..713d58f2806a 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -29,7 +29,7 @@ describe('convert', () => { function fakeUnknownKind(node: ts.Node): void { ts.forEachChild(node, fakeUnknownKind); // @ts-expect-error -- intentionally writing to a readonly field - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation, @typescript-eslint/no-unused-expressions node.kind = ts.SyntaxKind.UnparsedPrologue; } @@ -327,7 +327,7 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation, @typescript-eslint/no-unused-expressions esCallExpression.typeParameters; expect(emitWarning).toHaveBeenCalledWith( @@ -344,10 +344,10 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - /* eslint-disable deprecation/deprecation */ + /* eslint-disable deprecation/deprecation, @typescript-eslint/no-unused-expressions */ esCallExpression.typeParameters; esCallExpression.typeParameters; - /* eslint-enable deprecation/deprecation */ + /* eslint-enable deprecation/deprecation, @typescript-eslint/no-unused-expressions */ expect(emitWarning).toHaveBeenCalledTimes(1); }); @@ -360,7 +360,7 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: true, }); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation, @typescript-eslint/no-unused-expressions esCallExpression.typeParameters; expect(emitWarning).not.toHaveBeenCalled(); @@ -375,10 +375,10 @@ describe('convert', () => { it('allows writing to the deprecated aliased property as a new enumerable value', () => { const esCallExpression = getEsCallExpression(); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation, @typescript-eslint/no-unused-expressions esCallExpression.typeParameters = undefined; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation, @typescript-eslint/no-unused-expressions expect(esCallExpression.typeParameters).toBeUndefined(); expect(Object.keys(esCallExpression)).toContain('typeParameters'); }); @@ -391,7 +391,7 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation, @typescript-eslint/no-unused-expressions tsMappedType.typeParameter; expect(emitWarning).toHaveBeenCalledWith( @@ -408,10 +408,10 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - /* eslint-disable deprecation/deprecation */ + /* eslint-disable deprecation/deprecation, @typescript-eslint/no-unused-expressions */ tsMappedType.typeParameter; tsMappedType.typeParameter; - /* eslint-enable deprecation/deprecation */ + /* eslint-enable deprecation/deprecation, @typescript-eslint/no-unused-expressions */ expect(emitWarning).toHaveBeenCalledTimes(1); }); @@ -424,7 +424,7 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: true, }); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation, @typescript-eslint/no-unused-expressions tsMappedType.typeParameter; expect(emitWarning).not.toHaveBeenCalled(); @@ -439,10 +439,10 @@ describe('convert', () => { it('allows writing to the deprecated getter property as a new enumerable value', () => { const tsMappedType = getTsMappedType(); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation, @typescript-eslint/no-unused-expressions tsMappedType.typeParameter = undefined!; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation, @typescript-eslint/no-unused-expressions expect(tsMappedType.typeParameter).toBeUndefined(); expect(Object.keys(tsMappedType)).toContain('typeParameter'); }); diff --git a/packages/typescript-estree/tests/lib/persistentParse.test.ts b/packages/typescript-estree/tests/lib/persistentParse.test.ts index 105ba34d5560..7f5fd1f57da5 100644 --- a/packages/typescript-estree/tests/lib/persistentParse.test.ts +++ b/packages/typescript-estree/tests/lib/persistentParse.test.ts @@ -65,7 +65,9 @@ function setup(tsconfig: Record, writeBar = true): string { fs.mkdirSync(path.join(tmpDir.name, 'src')); fs.mkdirSync(path.join(tmpDir.name, 'src', 'baz')); writeFile(tmpDir.name, 'foo'); - writeBar && writeFile(tmpDir.name, 'bar'); + if (writeBar) { + writeFile(tmpDir.name, 'bar'); + } return tmpDir.name; } diff --git a/packages/website-eslint/build.ts b/packages/website-eslint/build.ts index ef316770155e..412ba07d65e0 100644 --- a/packages/website-eslint/build.ts +++ b/packages/website-eslint/build.ts @@ -135,7 +135,7 @@ async function buildPackage(name: string, file: string): Promise { ); const anyAlias = /^(@typescript-eslint\/[a-z-]+)\/([a-z-]+)$/; build.onResolve({ filter: anyAlias }, args => { - const parts = args.path.match(anyAlias); + const parts = anyAlias.exec(args.path); if (parts) { return createResolve(parts[1], `${parts[2]}/index.ts`); } diff --git a/packages/website/plugins/generated-rule-docs/insertions/insertSpecialCaseOptions.ts b/packages/website/plugins/generated-rule-docs/insertions/insertSpecialCaseOptions.ts index a5fb087e8776..3617d78711a3 100644 --- a/packages/website/plugins/generated-rule-docs/insertions/insertSpecialCaseOptions.ts +++ b/packages/website/plugins/generated-rule-docs/insertions/insertSpecialCaseOptions.ts @@ -22,12 +22,12 @@ export function insertSpecialCaseOptions(page: RuleDocsPage): void { throw new Error('Could not find default injection site in ban-types'); } - const defaultOptions = fs - .readFileSync( + const defaultOptions = /^const defaultTypes.+?^\};$/msu.exec( + fs.readFileSync( path.join(eslintPluginDirectory, 'src/rules/ban-types.ts'), 'utf8', - ) - .match(/^const defaultTypes.+?^\};$/msu)?.[0]; + ), + )?.[0]; if (!defaultOptions) { throw new Error('Could not find default options for ban-types'); From 5896b27e09b5ced1fec45d1a09c6f01e6778a02f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 27 May 2024 08:50:38 -0400 Subject: [PATCH 3/5] regenerate configs --- packages/eslint-plugin/src/configs/recommended-type-checked.ts | 2 ++ packages/eslint-plugin/src/configs/recommended.ts | 2 ++ packages/eslint-plugin/src/configs/strict-type-checked.ts | 2 ++ packages/eslint-plugin/src/configs/strict.ts | 2 ++ packages/eslint-plugin/src/configs/stylistic-type-checked.ts | 2 -- packages/eslint-plugin/src/configs/stylistic.ts | 2 -- .../typescript-eslint/src/configs/recommended-type-checked.ts | 2 ++ packages/typescript-eslint/src/configs/recommended.ts | 2 ++ packages/typescript-eslint/src/configs/strict-type-checked.ts | 2 ++ packages/typescript-eslint/src/configs/strict.ts | 2 ++ .../typescript-eslint/src/configs/stylistic-type-checked.ts | 2 -- packages/typescript-eslint/src/configs/stylistic.ts | 2 -- 12 files changed, 16 insertions(+), 8 deletions(-) diff --git a/packages/eslint-plugin/src/configs/recommended-type-checked.ts b/packages/eslint-plugin/src/configs/recommended-type-checked.ts index 867f90c06b7d..38b441ae6e2b 100644 --- a/packages/eslint-plugin/src/configs/recommended-type-checked.ts +++ b/packages/eslint-plugin/src/configs/recommended-type-checked.ts @@ -42,6 +42,8 @@ export = { '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/no-useless-template-literals': 'error', diff --git a/packages/eslint-plugin/src/configs/recommended.ts b/packages/eslint-plugin/src/configs/recommended.ts index a66c303fc656..2861c565f560 100644 --- a/packages/eslint-plugin/src/configs/recommended.ts +++ b/packages/eslint-plugin/src/configs/recommended.ts @@ -24,6 +24,8 @@ export = { '@typescript-eslint/no-this-alias': 'error', '@typescript-eslint/no-unnecessary-type-constraint': 'error', '@typescript-eslint/no-unsafe-declaration-merging': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/no-var-requires': 'error', diff --git a/packages/eslint-plugin/src/configs/strict-type-checked.ts b/packages/eslint-plugin/src/configs/strict-type-checked.ts index 32f831ec79be..7058d02e5bd3 100644 --- a/packages/eslint-plugin/src/configs/strict-type-checked.ts +++ b/packages/eslint-plugin/src/configs/strict-type-checked.ts @@ -56,6 +56,8 @@ export = { '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', 'no-useless-constructor': 'off', diff --git a/packages/eslint-plugin/src/configs/strict.ts b/packages/eslint-plugin/src/configs/strict.ts index 3ad1a340a8bd..e5a2ffc1e4b3 100644 --- a/packages/eslint-plugin/src/configs/strict.ts +++ b/packages/eslint-plugin/src/configs/strict.ts @@ -32,6 +32,8 @@ export = { '@typescript-eslint/no-this-alias': 'error', '@typescript-eslint/no-unnecessary-type-constraint': 'error', '@typescript-eslint/no-unsafe-declaration-merging': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', 'no-useless-constructor': 'off', diff --git a/packages/eslint-plugin/src/configs/stylistic-type-checked.ts b/packages/eslint-plugin/src/configs/stylistic-type-checked.ts index a0124142310f..f2512877aebe 100644 --- a/packages/eslint-plugin/src/configs/stylistic-type-checked.ts +++ b/packages/eslint-plugin/src/configs/stylistic-type-checked.ts @@ -24,8 +24,6 @@ export = { 'no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'error', '@typescript-eslint/no-inferrable-types': 'error', - 'no-unused-expressions': 'off', - '@typescript-eslint/no-unused-expressions': 'error', '@typescript-eslint/non-nullable-type-assertion-style': 'error', '@typescript-eslint/prefer-find': 'error', '@typescript-eslint/prefer-for-of': 'error', diff --git a/packages/eslint-plugin/src/configs/stylistic.ts b/packages/eslint-plugin/src/configs/stylistic.ts index 54653c3ba84a..02705c56c034 100644 --- a/packages/eslint-plugin/src/configs/stylistic.ts +++ b/packages/eslint-plugin/src/configs/stylistic.ts @@ -22,8 +22,6 @@ export = { 'no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'error', '@typescript-eslint/no-inferrable-types': 'error', - 'no-unused-expressions': 'off', - '@typescript-eslint/no-unused-expressions': 'error', '@typescript-eslint/prefer-for-of': 'error', '@typescript-eslint/prefer-function-type': 'error', }, diff --git a/packages/typescript-eslint/src/configs/recommended-type-checked.ts b/packages/typescript-eslint/src/configs/recommended-type-checked.ts index 377a5ac83600..50487c38d6e4 100644 --- a/packages/typescript-eslint/src/configs/recommended-type-checked.ts +++ b/packages/typescript-eslint/src/configs/recommended-type-checked.ts @@ -51,6 +51,8 @@ export default ( '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/no-useless-template-literals': 'error', diff --git a/packages/typescript-eslint/src/configs/recommended.ts b/packages/typescript-eslint/src/configs/recommended.ts index ef78846d16f5..e5542c3e2511 100644 --- a/packages/typescript-eslint/src/configs/recommended.ts +++ b/packages/typescript-eslint/src/configs/recommended.ts @@ -33,6 +33,8 @@ export default ( '@typescript-eslint/no-this-alias': 'error', '@typescript-eslint/no-unnecessary-type-constraint': 'error', '@typescript-eslint/no-unsafe-declaration-merging': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/no-var-requires': 'error', diff --git a/packages/typescript-eslint/src/configs/strict-type-checked.ts b/packages/typescript-eslint/src/configs/strict-type-checked.ts index 16c7b6cd7aa6..d5f15ee56f4a 100644 --- a/packages/typescript-eslint/src/configs/strict-type-checked.ts +++ b/packages/typescript-eslint/src/configs/strict-type-checked.ts @@ -65,6 +65,8 @@ export default ( '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', '@typescript-eslint/no-unsafe-unary-minus': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', 'no-useless-constructor': 'off', diff --git a/packages/typescript-eslint/src/configs/strict.ts b/packages/typescript-eslint/src/configs/strict.ts index b3fe1673e62b..f6456995d90e 100644 --- a/packages/typescript-eslint/src/configs/strict.ts +++ b/packages/typescript-eslint/src/configs/strict.ts @@ -41,6 +41,8 @@ export default ( '@typescript-eslint/no-this-alias': 'error', '@typescript-eslint/no-unnecessary-type-constraint': 'error', '@typescript-eslint/no-unsafe-declaration-merging': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', 'no-useless-constructor': 'off', diff --git a/packages/typescript-eslint/src/configs/stylistic-type-checked.ts b/packages/typescript-eslint/src/configs/stylistic-type-checked.ts index d1b739c9cf20..f1c1efaf2e10 100644 --- a/packages/typescript-eslint/src/configs/stylistic-type-checked.ts +++ b/packages/typescript-eslint/src/configs/stylistic-type-checked.ts @@ -33,8 +33,6 @@ export default ( 'no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'error', '@typescript-eslint/no-inferrable-types': 'error', - 'no-unused-expressions': 'off', - '@typescript-eslint/no-unused-expressions': 'error', '@typescript-eslint/non-nullable-type-assertion-style': 'error', '@typescript-eslint/prefer-find': 'error', '@typescript-eslint/prefer-for-of': 'error', diff --git a/packages/typescript-eslint/src/configs/stylistic.ts b/packages/typescript-eslint/src/configs/stylistic.ts index c2e86ce09ee4..cd165bf5bdac 100644 --- a/packages/typescript-eslint/src/configs/stylistic.ts +++ b/packages/typescript-eslint/src/configs/stylistic.ts @@ -31,8 +31,6 @@ export default ( 'no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'error', '@typescript-eslint/no-inferrable-types': 'error', - 'no-unused-expressions': 'off', - '@typescript-eslint/no-unused-expressions': 'error', '@typescript-eslint/prefer-for-of': 'error', '@typescript-eslint/prefer-function-type': 'error', }, From 18b0f94d441fc860a2df784ae276fe3b0127a5fd Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 27 May 2024 08:51:01 -0400 Subject: [PATCH 4/5] A few lint fixes --- packages/typescript-estree/tests/lib/convert.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index 89d3e195a401..e7ecc9de5956 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -336,10 +336,10 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - /* eslint-disable deprecation/deprecation */ + /* eslint-disable deprecation/deprecation, @typescript-eslint/no-unused-expressions */ esTsEnumDeclaration.members; esTsEnumDeclaration.members; - /* eslint-enable deprecation/deprecation */ + /* eslint-enable deprecation/deprecation, @typescript-eslint/no-unused-expressions */ expect(emitWarning).toHaveBeenCalledTimes(1); }); @@ -400,10 +400,10 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - /* eslint-disable deprecation/deprecation */ + /* eslint-disable deprecation/deprecation, @typescript-eslint/no-unused-expressions */ tsMappedType.typeParameter; tsMappedType.typeParameter; - /* eslint-enable deprecation/deprecation */ + /* eslint-enable deprecation/deprecation, @typescript-eslint/no-unused-expressions */ expect(emitWarning).toHaveBeenCalledTimes(1); }); From f118815de07a2c225448ed32685470e14605901a Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 27 May 2024 11:36:05 -0400 Subject: [PATCH 5/5] ci: fix no-throw-literal link in v8 beta post --- .../blog/2024-05-27-announcing-typescript-eslint-v8-beta.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/blog/2024-05-27-announcing-typescript-eslint-v8-beta.mdx b/packages/website/blog/2024-05-27-announcing-typescript-eslint-v8-beta.mdx index 385f13fec573..75d715389270 100644 --- a/packages/website/blog/2024-05-27-announcing-typescript-eslint-v8-beta.mdx +++ b/packages/website/blog/2024-05-27-announcing-typescript-eslint-v8-beta.mdx @@ -176,7 +176,7 @@ Several rules are changed in significant enough ways to be considered breaking c - ⏳ [chore(eslint-plugin): deprecate no-var-requires in favor of no-require-imports](https://github.com/typescript-eslint/typescript-eslint/pull/8334) - If you have [`@typescript-eslint/no-var-requires`](/rules/no-var-requires) manually enabled, remove that, and instead either use a [recommended config](/users/configs) or manually enable [`@typescript-eslint/no-require-imports`](/rules/no-require-imports) - [feat(eslint-plugin): remove deprecated no-throw-literal rule](https://github.com/typescript-eslint/typescript-eslint/issues/9083) - - If you have [`@typescript-eslint/no-throw-literal`](/rules/no-throw-literal) manually enabled, remove that, and instead either use a [recommended config](/users/configs) or manually enable [`@typescript-eslint/only-throw-error`](/rules/only-throw-error) + - If you have [`@typescript-eslint/no-throw-literal`](https://typescript-eslint.io/rules/no-throw-literal) manually enabled, remove that, and instead either use a [recommended config](/users/configs) or manually enable [`@typescript-eslint/only-throw-error`](/rules/only-throw-error) - ⏳ [fix(eslint-plugin): [no-useless-template-literals] rename to no-useless-template-expression](https://github.com/typescript-eslint/typescript-eslint/pull/8821) - Find-and-replace text from `no-useless-template-literals` to `no-useless-template-expression` - [feat(eslint-plugin): deprecate no-loss-of-precision extension rule](https://github.com/typescript-eslint/typescript-eslint/pull/8832) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy