# vue/valid-model-definition
require valid keys in model option
- ⚙️ This rule is included in all of
"plugin:vue/essential"
,"plugin:vue/strongly-recommended"
and"plugin:vue/recommended"
.
# 📖 Rule Details
This rule is aimed at preventing invalid keys in model option.
<script>
/* ✓ GOOD */
export default {
model: {
prop: 'list',
}
}
</script>
<script>
/* ✓ GOOD */
export default {
model: {
event: 'update'
}
}
</script>
<script>
/* ✓ GOOD */
export default {
model: {
prop: 'list',
event: 'update'
}
}
</script>
<script>
/* ✗ BAD */
export default {
model: {
prop: 'list',
events: 'update'
}
}
</script>
<script>
/* ✗ BAD */
export default {
model: {
props: 'list',
events: 'update'
}
}
</script>
<script>
/* ✗ BAD */
export default {
model: {
name: 'checked',
props: 'list',
event: 'update'
}
}
</script>
# 🚀 Version
This rule was introduced in eslint-plugin-vue v9.0.0