Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
Repro Code
leta:Uint8Array<ArrayBufferLike>=newUint8Array();voida;
ESLint Config
{"rules":{"@typescript-eslint/consistent-generic-constructors":"error"}}
tsconfig
{"compilerOptions": {"lib": ["es2023"],"module":"es2022","strictNullChecks":true,"target":"es2023" }}
Expected Result
Either don't report the error, or don't generate invalid code upon fix.
Actual Result
Rule reports error:
The generic type arguments should be specified as part of the constructor type arguments. 1:5 - 1:54
If I tapFix, the code becomes:
leta=newUint8Array<ArrayBufferLike>();voida;
And then TypeScript reports error:
2554: Expected 1-3 arguments, but got 0. 1:9 - 1:42
Additional Info
If I enable two rules consistent-generic-constructors and no-unnecessary-type-arguments,playground, both rules would report errors.
The outcome depends on the order of fix.
- If consistent-generic-constructors is fixed first, the above problem occurs.
- If no-unnecessary-type-arguments is fixed first, the resulting code is well-formed.