Closed
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 have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
type Foo = { bar: number; }
const x = () => <Foo>{ bar: 5 };
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/consistent-type-assertions": ["error", {
"assertionStyle": "as",
}],
},
};
tsconfig
No response
Expected Result
I expected the following autofix.
type Foo = { bar: number; }
const x = () => ({ bar: 5 } as Foo);
Actual Result
The following autofix breaks TypeScript syntax.
type Foo = { bar: number; }
const x = () => { bar: 5 } as Foo;
Additional Info
Ref: #6641