Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.7.2&fileType=.ts&code=NoXQdAtghgDgFHAlAAgLwD5kB4DeyoBcyAZlADYDOApgDTIBGRplVyAvunoSedXYzxbtEQA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1tiacTJTIAhtEK0ipWkOTJE0fJQ5N0UOdA7RI4MAF8QOoA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
Repro Code
[].map(() => <{ a: false, b: false }>{ a: false, b: false })
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
"rules": {
"@typescript-eslint/no-unnecessary-type-assertion": "error"
}
}
};
tsconfig
Expected Result
No syntax error after autofix
Actual Result
After removing TSTypeAssertion, the ObjectExpression is interpreted as an arrow function with labels
[].map(() => { a: false, b: false })
Additional Info
No response
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.7.2&fileType=.ts&code=NoXQdAtghgDgFHAlAAgLwD5kB4DeyoBcyAZlADYDOApgDTIBGRplVyAvunoSedXYzxbtEQA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1tiacTJTIAhtEK0ipWkOTJE0fJQ5N0UOdA7RI4MAF8QOoA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
Repro Code
ESLint Config
tsconfig
{ "compilerOptions": { "strictNullChecks": true } }Expected Result
No syntax error after autofix
Actual Result
After removing TSTypeAssertion, the ObjectExpression is interpreted as an arrow function with labels
Additional Info
No response