From 2a426883ab5c5e9f626bd21fe6b240f8280e3e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Wed, 8 Nov 2023 09:13:11 +0000 Subject: [PATCH 01/26] chore: re-enable consistent-indexed-object-style and 'fix' violation (#7864) Co-authored-by: Joshua Chen --- .eslintrc.js | 1 - packages/utils/src/json-schema.ts | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index ac2e363f4e13..d852a75216f9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -53,7 +53,6 @@ module.exports = { 'deprecation/deprecation': 'error', // TODO(#7338): Investigate enabling these soon ✨ - '@typescript-eslint/consistent-indexed-object-style': 'off', '@typescript-eslint/no-unnecessary-condition': 'off', '@typescript-eslint/no-dynamic-delete': 'off', '@typescript-eslint/prefer-nullish-coalescing': 'off', diff --git a/packages/utils/src/json-schema.ts b/packages/utils/src/json-schema.ts index a3b2e5fdeceb..73ab2f3ddc89 100644 --- a/packages/utils/src/json-schema.ts +++ b/packages/utils/src/json-schema.ts @@ -33,6 +33,8 @@ export type JSONSchema4TypeExtended = | JSONSchema4Object; // Workaround for infinite type recursion +// Also, https://github.com/typescript-eslint/typescript-eslint/issues/7863 +// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style export interface JSONSchema4Object { [key: string]: JSONSchema4TypeExtended; } From eb736bbfc22554694400e6a4f97051d845d32e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Wed, 8 Nov 2023 10:01:52 +0000 Subject: [PATCH 02/26] chore: fix integration tests for ESLint formatting deprecations (#7891) --- ...nded-does-not-require-program.test.ts.snap | 11 +++++++++- .../tests/__snapshots__/vue-sfc.test.ts.snap | 21 ++++++++++++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap index 83a2f0129c90..2b9032643f39 100644 --- a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap @@ -24,7 +24,16 @@ exports[`recommended-does-not-require-program should lint successfully 1`] = ` "output": "const foo: unknown = true; ", "suppressedMessages": [], - "usedDeprecatedRules": [], + "usedDeprecatedRules": [ + { + "replacedBy": [], + "ruleId": "no-extra-semi", + }, + { + "replacedBy": [], + "ruleId": "no-mixed-spaces-and-tabs", + }, + ], "warningCount": 0, }, ] diff --git a/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap b/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap index 54ab2732a857..e0fdc6549efd 100644 --- a/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap @@ -58,7 +58,12 @@ export default Vue.extend({ ", "suppressedMessages": [], - "usedDeprecatedRules": [], + "usedDeprecatedRules": [ + { + "replacedBy": [], + "ruleId": "semi-spacing", + }, + ], "warningCount": 0, }, { @@ -93,7 +98,12 @@ export default class Utility { ", "suppressedMessages": [], - "usedDeprecatedRules": [], + "usedDeprecatedRules": [ + { + "replacedBy": [], + "ruleId": "semi-spacing", + }, + ], "warningCount": 0, }, { @@ -145,7 +155,12 @@ export default Vue.extend({ ", "suppressedMessages": [], - "usedDeprecatedRules": [], + "usedDeprecatedRules": [ + { + "replacedBy": [], + "ruleId": "semi-spacing", + }, + ], "warningCount": 0, }, ] From be2777c5338669836d786f9a7806f499fd566dcd Mon Sep 17 00:00:00 2001 From: Risto Keravuori Date: Thu, 9 Nov 2023 20:33:58 -0800 Subject: [PATCH 03/26] fix(eslint-plugin): [explicit-function-return-type] support JSX attributes in `allowTypedFunctionExpressions` (#7553) --- .../rules/explicit-function-return-type.md | 4 + .../src/util/explicitReturnTypeUtils.ts | 77 ++++++---- .../explicit-function-return-type.test.ts | 137 ++++++++++++++++++ 3 files changed, 190 insertions(+), 28 deletions(-) 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 3332f1d77ef0..6aa1e6213145 100644 --- a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md +++ b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md @@ -172,6 +172,10 @@ functionWithObjectArg({ return 1; }, }); + +const Comp: FC = () => { + return