From 41b8aba65e71de95d0bc7a9f9f2990675705d41d Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 2 Dec 2025 13:03:09 -0330 Subject: [PATCH 1/2] feat: Disable `@typescript-eslint/no-unnecessary-type-arguments` This rule ended up getting in our way more than helping. Type arguments can sometimes be useful to include even when they're not strictly needed, so that the reader doesn't have to dig into the type definition to discover the default value. Closes #413 --- packages/typescript/rules-snapshot.json | 2 +- packages/typescript/src/index.mjs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/typescript/rules-snapshot.json b/packages/typescript/rules-snapshot.json index 6a3d5a9..f81cc06 100644 --- a/packages/typescript/rules-snapshot.json +++ b/packages/typescript/rules-snapshot.json @@ -91,7 +91,7 @@ "@typescript-eslint/no-this-alias": "error", "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error", "@typescript-eslint/no-unnecessary-qualifier": "error", - "@typescript-eslint/no-unnecessary-type-arguments": "error", + "@typescript-eslint/no-unnecessary-type-arguments": "off", "@typescript-eslint/no-unnecessary-type-assertion": "error", "@typescript-eslint/no-unnecessary-type-constraint": "error", "@typescript-eslint/no-unsafe-argument": "off", diff --git a/packages/typescript/src/index.mjs b/packages/typescript/src/index.mjs index 3903bd0..afa1e94 100644 --- a/packages/typescript/src/index.mjs +++ b/packages/typescript/src/index.mjs @@ -78,6 +78,9 @@ const config = createConfig({ '@typescript-eslint/no-unsafe-enum-comparison': 'off', '@typescript-eslint/require-await': 'off', + // Disabled because unnecessary type arguments are sometimes helpful for readability + '@typescript-eslint/no-unnecessary-type-arguments': 'off', + // Our rules that require type information '@typescript-eslint/consistent-type-exports': 'error', '@typescript-eslint/naming-convention': [ @@ -152,7 +155,6 @@ const config = createConfig({ '@typescript-eslint/no-meaningless-void-operator': 'error', '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', '@typescript-eslint/no-unnecessary-qualifier': 'error', - '@typescript-eslint/no-unnecessary-type-arguments': 'error', '@typescript-eslint/prefer-enum-initializers': 'error', '@typescript-eslint/prefer-includes': 'error', '@typescript-eslint/prefer-nullish-coalescing': 'error', From 7a6bc7abd056674cfa61af4cc27d62f42f0226dc Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 2 Dec 2025 13:06:40 -0330 Subject: [PATCH 2/2] Update changelog --- packages/typescript/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/typescript/CHANGELOG.md b/packages/typescript/CHANGELOG.md index e342a6e..eea7356 100644 --- a/packages/typescript/CHANGELOG.md +++ b/packages/typescript/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** Update `typescript-eslint` peer dependency to have a minimum version of v8.39.0 ([#423](https://github.com/MetaMask/eslint-config/pull/423)) - This version has a matching supported `typescript` range, and includes some bug fixes for problems we ran into. +- Disable `@typescript-eslint/no-unnecessary-type-arguments` ([#426](https://github.com/MetaMask/eslint-config/pull/426)) + - We decided that "unnecessary" type arguments make types easier to read sometimes, so we should allow them. ## [14.1.0]