- ⚙️ This rule is included in all of
"plugin:vue/essential"
,"plugin:vue/strongly-recommended"
and"plugin:vue/recommended"
.
This rule prevents to use reserved names to avoid conflicts and unexpected behavior.
👎 Examples of incorrect code for this rule:
export default {
props: {
$el: String
},
computed: {
$on: {
get () {}
}
},
data: {
_foo: null
},
methods: {
$nextTick () {}
}
}
This rule has an object option:
"reserved"
: [] (default) array of additional restricted attributes inside groups
.
"groups"
: [] (default) array of additional group names to search for duplicates in.
"vue/no-reserved-keys": [2, {
reserved: ['foo', 'foo2'],
groups: ['firebase']
}]
👎 Examples of incorrect code for this configuration
export default {
computed: {
foo () {}
},
firebase: {
foo2 () {}
}
}