Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Repro
{"rules": {"@typescript-eslint/prefer-readonly":2 }}// your repro code caseclassX{private_isValid?=true;getisValid():boolean{returnthis._isValid;}constructor(data?:{}){if(!data){this._isValid=false;}}}
Expected Result
No report
Actual Result
@typescript-eslint/prefer-readonlyMember'_isValid' is never reassigned; mark it as`readonly`
Versions
| package | version |
|---|---|
@typescript-eslint/eslint-plugin | 2.3.3 |
@typescript-eslint/parser | 2.3.3 |
TypeScript | 3.6.3 |
ESLint | 6.5.1 |
node | 12.11.1 |
yarn | 1.19.0 |