vue/no-mutating-props
eslint-plugin-vue
No autofixRecommended
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-mutating-props": "error",
},
},
]; props.value = 'test'
}
}
</script><template>
<div>
<input v-model="value.id" @click="openModal">
</div>
</template>
<script>
export default {
props: {
value: {
type: Object,
required: true
}
},
methods: {
openModal() {
this.value.visible = true
}
}
}
</script>Examples from the ESLint documentation.
vue/no-mutating-props
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-mutating-props": "error",
},
},
];Oxlint does not have this rule.
nursery/noVueMutatingProps
nursery · since 2.6.4
{
"linter": {
"rules": {
"nursery": {
"noVueMutatingProps": "error"
}
}
}
}Disallow use of value wrapped by ref() (Composition API) as an operand
Disallow duplicate conditions in v-if / v-else-if chains
Disallow using deprecated number (keycode) modifiers (in Vue.js 3.0.0+)