Bug: [prefer-readonly] prefer-readonly should not consider accessors #8299
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.3.3&fileType=.tsx&code=FAYwNghgzlAEBiB7RsDexawA4CcCWAbhAC4CmsEIIpMiOFVsAvLAMwDcwGD1t9AxJRDNYAFk4BfIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Y6RAM0Wls4CGAEwD2TeIXRRe0EdEjgwAXxBKgA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
Repro Code
ESLint Config
tsconfig
Expected Result
Accessors should be ignored by
prefer-readonly
as they cannot be marked asreadonly
.Actual Result
A broken fix is done that adds
readonly
to the accessors:Additional Info
I will make a PR for this.
The text was updated successfully, but these errors were encountered: