Skip to content

Disable no-unnecessary-type-arguments lint rule#1390

Merged
sindresorhus merged 2 commits intomainfrom
fix/disable-no-unnecessary-type-arguments-lint-rule
Mar 24, 2026
Merged

Disable no-unnecessary-type-arguments lint rule#1390
sindresorhus merged 2 commits intomainfrom
fix/disable-no-unnecessary-type-arguments-lint-rule

Conversation

@som-sm
Copy link
Copy Markdown
Collaborator

@som-sm som-sm commented Mar 24, 2026

Because of certain recent changes in the @typescript-eslint/no-unnecessary-type-arguments rule, our test files now have multiple errors (see run).

image

This PR disables this rule.

  • We don’t want this rule in our test files, as we need explicit type arguments there.

  • It also feels unnecessary in source files. And, there appears to be some bug as well, for example:

    type Test<T, U = unknown> = [T, U];
    type T1<T extends unknown[]> = Test<string, T[number]>;
    //                                          ~~~~~~~~~
    // This is the default value for this type parameter, so it can be omitted. (@typescript-eslint/no-unnecessary-type-arguments)

    In this case, Test<string> is not equivalent to Test<string, T[number]>, but the rule reports an error, which it shouldn't.

@som-sm som-sm requested a review from sindresorhus March 24, 2026 08:01
Repository owner deleted a comment from claude bot Mar 24, 2026
@som-sm
Copy link
Copy Markdown
Collaborator Author

som-sm commented Mar 24, 2026

TS v6 also got released yesterday, because of which npm install typescript@latest now has peer dependency issues (see run):

npm error Could not resolve dependency:
npm error peer typescript@">=4.8.4 <6.0.0" from @typescript-eslint/parser@8.57.2
npm error node_modules/@typescript-eslint/parser

Should we temporarily add the --legacy-peer-deps flag while installing (refer 2969233)?

Repository owner deleted a comment from claude bot Mar 24, 2026
@sindresorhus sindresorhus merged commit b0b92ae into main Mar 24, 2026
8 checks passed
@sindresorhus sindresorhus deleted the fix/disable-no-unnecessary-type-arguments-lint-rule branch March 24, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants