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
Run the fixer and you'll notice the issue
Repro Code
enum A {
B = 1,
'C-2' = 2,
[`D-3`] = 3,
[`E-
4`] = 4,
}
declare const a: A
switch (a) {
case A.B: { throw new Error('Not implemented yet: A.B case') }
}
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/switch-exhaustiveness-check": ["error"],
},
};
tsconfig
No response
Expected Result
Probably this?
switch (a) {
case A.B: { throw new Error('Not implemented yet: A.B case') }
case A['C-2']: { throw new Error('Not implemented yet: A[\'C-2\'] case') }
case A['D-3']: { throw new Error('Not implemented yet: A[\'D-3\'] case') }
case A[`E-
4`]: { throw new Error('Not implemented yet: A[`E-
4`] case') }
}
Actual Result
switch (a) {
case A.B: { throw new Error('Not implemented yet: A.B case') }
case A['C-2']: { throw new Error('Not implemented yet: A['C-2'] case') }
case A['D-3']: { throw new Error('Not implemented yet: A['D-3'] case') }
case A['E-
4']: { throw new Error('Not implemented yet: A['E-
4'] case') }
}
Additional Info
No response