In no-mutating-methods, the allowedObjects option currently only works on Identifier types, not MemberExpression types. This PR adds support for MemberExpression types.
The standard way of navigating to a new route in vue-router is with this.$router.push(...). Setting "allowedObjects": ["$router"] does not work as expected. There is no way to get no-mutating-methods to ignore this with the current implementation.
Additional Nodes
This is a breaking change. I can add a different option to avoid breaking, but arguably the existing option should have always functioned this way.
In
no-mutating-methods
, theallowedObjects
option currently only works onIdentifier
types, notMemberExpression
types. This PR adds support forMemberExpression
types.For example, this currently reports an error:
Use Case
The standard way of navigating to a new route in vue-router is with
this.$router.push(...)
. Setting"allowedObjects": ["$router"]
does not work as expected. There is no way to getno-mutating-methods
to ignore this with the current implementation.Additional Nodes
This is a breaking change. I can add a different option to avoid breaking, but arguably the existing option should have always functioned this way.