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
exportconstmarker="marker"asconst;exportinterfaceData{marker:typeofmarker;value:string;}functioncreateData():Data{constbase={marker:marker};return{ ...base,value:""};}
ESLint Config
module.exports={"rules":{"@typescript-eslint/no-unnecessary-type-assertion":"error"}}
tsconfig
{}
Expected Result
The first line of this code should not report an error for theas const
assertion, since this assertion is necessary - removing it is a TypeScript compilation error (seeTypeScript playground).
Actual Result
Starting in typescript-eslint@7.3 (presumably#8558), the first line of this code reports a @typescript-eslint/no-unnecessary-type-assertion error.
Additional Info
No response