Skip to content

no-mutating-props seems too strict #1314

Closed
@leosdad

Description

@leosdad

What rule do you want to change?

no-mutating-props

Does this change cause the rule to produce more or fewer warnings?

Fewer

How will the change be implemented? (New option, new default behavior, etc.)?

A new option would suffice, but maybe the default behavior should also be changed as well.

Please provide some example code that this change will affect:

<script>
props: {
  localData: { type: Object, required: true },
},
created()
{
  if(!this.localData.screens) {
    this.localData.screens = {};
  }
}
</script>

What does the rule currently do for this code?

It flags it as an error, and I have to disable it globally or locally.

What will the rule do after it's changed?

This should be allowed because the property is an object. I'm not mutating this.localData itself, but another object inside it.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions