Add ignoreMutableCollections option to prefer-readonly-type rule #157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! I'm currently migrating the main frontend repo for my company from a tslint / eslint hybrid to pure eslint. In our old config, we were using tslint-immutable's
readonly-keyword
to enforce use ofreadonly
for our interfaces. However, we never enabled thereadonly-array
rule. Now that we're migrating to eslint-plugin-functional, we're getting a huge number of linting errors from theprefer-readonly-type
rule since it appears to be a union of these two rules from tslint-immutable. While some of these are auto-fixable, many are not and fixing them manually would be too large of an undertaking for us right now.To remedy this, I propose adding an
ignoreMutableCollections
option to this rule that allows users to disable checks against Arrays, Tuples, Maps, and Sets. This will make it much easier for users like us to migrate off of tslint and onto a more actively supported linting architecture. Happy to clarify the use case / expand on this PR as needed!