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 S = 10;
// reported correctly
const a = 'a' as const;
const b = 3 as 3;
const c = 10 as S;
class T {
// should be reported?
readonly a = 'a' as const
readonly b = 3 as 3
readonly c = 10 as S
}
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/no-unnecessary-type-assertion": "error",
},
};
tsconfig
Expected Result
I expected these to be reported, similarly to the const
declarations.
Actual Result
The various readonly
declarations haven't been reported.
Additional Info
No response