eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

Enforce a getter and or a setter at computed properties

Open ndabAP opened this issue 5 years ago • 0 comments

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".

ndabAP avatar Jun 24 '19 12:06 ndabAP