New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove or add redundant readonly
property modifier
#7915
Comments
readonly
property modifierreadonly
property modifier
While I see the value of removing the redundant |
Sure, but I have to look at the class definition to see that. I have to jump to a different line of code while reading a file. That being said, I can totally live with a fixer that is not configurable and that is only able to remove redundant |
You don't mark methods as |
But I could.
It isn't. |
Feature request
In
readonly
classes, I can still flag individual properties asreadonly
, for example:In this context, the
readonly
modifiers on the properties are 100% redundant. However, in codebases where readonly and mutatable properties are mixed, these redundant modifiers can still provide explicitness to the reader.Proposal
I'd like to propose a fixer that normalizes
readonly
property modifiers on read-only classes. That fixer should come with a boolean setting to let me choose between:readonly
to all properties of areadonly
class. This is essential the code snippet above.readonly
from all properties of areadonly
class. This setting wold be my preferred default. Running the fixer with that setting on the code above would yield the following result:Related work
final
keywords.The text was updated successfully, but these errors were encountered: