Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I haveread the FAQ and my problem is not listed.
Repro
// ESLint says: 'num' is never reassigned. Use 'const' instead.letnum=data?.anum!=1// same thing happens with +=, -=, etc
{"rules": {"prefer-const":"error" }}
// your repro code caseletxp=data?.xp;/* bunch of unrelated code ... */xp!=123;
Expected Result
Nothing, sincenum
is being reassigned
Actual Result
ESLint says'xp' is never reassigned. Use 'const' instead.
Additional Info
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin | 4.6.0 |
@typescript-eslint/parser | 4.6.0 |
TypeScript | 4.1.2 |
ESLint | 7.14.0 |
node | 14.14.0 |