restrictedAssignment to '{{object}}.{{property}}' is not permitted.small-rules/no-restricted-property-assignmentDisallow assignment to restricted object properties.
Sometimes you just need to ban writes to a global’s property. this.foo = bar is fine, but globalThis.foo = bar or _G.__DEV__? Maybe not.
This blocks assignment and update expressions – x.prop = y, x.prop++ – to matched objects. Reads are
fine, only writes get flagged. The object has to be a direct identifier like _G; container._G.__DEV__
won’t match because the rule only looks at the root name.
Computed keys are checked by default, so _G["__DEV__"] = true gets caught. Set checkComputed to false
to skip those. Glob patterns work for both the object and property names, so you can ban a whole family at
once. allowFiles exempts files by name or glob when you genuinely need the write somewhere.
restrictedAssignment to '{{object}}.{{property}}' is not permitted.restrictedCustom{{message}}This rule accepts one options object after the severity.
_G.__DEV__ = true;_G.__PROD__ = true;