eslint-plugin-vue
eslint-plugin-vue copied to clipboard
Enforce a getter and or a setter at computed properties
Please describe what the rule should do:
Enforce a getter
and or a setter
at computed properties to coerce correct usage and make the target clear.
What category should the rule belong to?
- [ ] Enforces code style
- [x] Warns about a potential error
- [ ] Suggests an alternate way of doing something
- [ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
<script>
export default {
computed: {
// Warning: Use getter instead
fullName () {
return this.firstName + ' ' + this.lastName
}
}
}
</script>
Additional context Maybe: "vue/require-get-set-in-computed".