[consistent-indexed-object-style] Readonly modifier is ignored #2797
Labels
bug
Something isn't working
has pr
there is a PR raised to close this
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Repro
tsconfig.json:
Expected Result
ESLint reports no error. An index signature with
readonly
modifier cannot be converted to aRecord
type since the properties ofRecord
type are not readonly.Actual Result
ESLint reports an error.
And fixing this error by
eslint --fix
makes the TypeScript compilation fail because now it is valid to assign a new value tovals.foo
.Diff made by
eslint --fix
:Versions
@typescript-eslint/eslint-plugin
4.8.1
@typescript-eslint/parser
4.8.1
TypeScript
4.1.2
ESLint
7.14.0
node
10.15.3
The text was updated successfully, but these errors were encountered: