New rule request: Restrict assignments to certain properties of certain objects #6920
Labels
archived due to age
This issue has been archived; please open a new issue for any further discussion
When the rules will warn. Include a description as well as sample code.
This is a supplemental rule to
no-restricted-globals
. Instead of checking for the reassignment of a global, this would check for reassignment of properties for a global. For example, if a library has been exported to a particular global such as_
, this rule flags reassignments to any property of_
.Example of violation:
Whether the rule prevents an error or is stylistic.
This can prevent errors that can arise from assignments to globals that will affect other parts of the code.
Why the rule should be in the core instead of creating a custom rule.
No strong reason, except that it seems unfortunate to be able to lint against global reassignments (e.g.,
_ = something
) but not to lint against reassignments of properties.Are you willing to create the rule yourself?
Yes! (Unless someone volunteers to do it faster than I will.)
The text was updated successfully, but these errors were encountered: