[@typescript-eslint/no-unnecessary-type-assertion] False positives for "as const" assertions with template literals #8737
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.4.2&fileType=.tsx&code=KYDwDg9gTgLgBAYwgOwM7zFCAjANsAWwClUUAVATzGAFUoBLABSmADN6Q4BeOAcgAsYMMKgBcAenHAoWKKgB0-CAWABaJMmTAEMeUgLjecAIapEKdAG4AsACgN6ONNkAhU7Qbc4AAwAkAb0wcfGJSZEpqOiYWdhAAXw0YYGQYVGkAN3oEYFRvEzMHGBtbO1BIWDgYKmA4ZmDCEhQvACVtaAATAB50BmQAcwAaOABXZABrZAgAd2QAPjgAMjh-OzhK6tEfAKrqCFY4ILwGsIiPaLYOOICe%2Bn648WuYXr6472K44tLwaHhCuAA1Yy4ejtYwwegoACiMmgmzqR1CTR4K1sax2wE2fn8zmgbjSUXu6SBILBEOQqhxUG8AzsHzsQA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1tiacTJTIAhtEK0ipWkOTJE0fJQ5N0UOdA7RI4MAF8QOoA&tsconfig=N4KAvkA&tokens=false
Repro Code
ESLint Config
tsconfig
Expected Result
The
as const
is kept.Actual Result
The
as const
is marked as unnecessary.Additional Info
See comment here.
The text was updated successfully, but these errors were encountered: