vue/no-reserved-keys

disallow overwriting reserved keys

  • ⚙️ This rule is included in all of "plugin:vue/essential", "plugin:vue/strongly-recommended" and "plugin:vue/recommended".

📖 Rule Details

This rule prevents to use reserved names to avoid conflicts and unexpected behavior.

<script> /* ✗ BAD */ export default { props: { $el: String }, computed: { $on: { get () {} } }, data: { _foo: null }, methods: { $nextTick () {} } } </script>
Now loading...

🔧 Options

{
  "vue/no-reserved-keys": ["error", {
    "reserved": [],
    "groups": []
  }]
}
  • reserved (string[]) ... Array of additional restricted attributes inside groups. Default is empty.
  • groups (string[]) ... Array of additional group names to search for duplicates in. Default is empty.

"reserved": ["foo", "foo2"], "groups": ["firebase"]

<script> /* ✗ BAD */ export default { computed: { foo () {} }, firebase: { foo2 () {} } } </script>
Now loading...

📚 Further reading

🔍 Implementation

Last Updated: 12/30/2018, 3:44:02 AM