# 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>
Now loading...
<script> /* ✓ GOOD */ export default { model: { event: 'update' } } </script>
Now loading...
<script> /* ✓ GOOD */ export default { model: { prop: 'list', event: 'update' } } </script>
Now loading...
<script> /* ✗ BAD */ export default { model: { prop: 'list', events: 'update' } } </script>
Now loading...
<script> /* ✗ BAD */ export default { model: { props: 'list', events: 'update' } } </script>
Now loading...
<script> /* ✗ BAD */ export default { model: { name: 'checked', props: 'list', event: 'update' } } </script>
Now loading...

# 🚀 Version

This rule was introduced in eslint-plugin-vue v9.0.0

# 🔍 Implementation