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

vue/no-side-effects-in-computed-properties does not work with vue-demi

Open jesusgn90 opened this issue 3 years ago • 0 comments

Checklist

  • [x] I have tried restarting my IDE and the issue persists.
  • [x] I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: v7.26.0
  • eslint-plugin-vue version: ^7.9.0
  • Node version: v14.15.4
  • Operating System: ubuntu 20.04 LTS

Please show your full configuration:

// PRIVATE CONFIG BUT USING plugin:vue/recommended

What did you do?

<script lang="ts">
import { computed, defineComponent, ref } from 'vue-demi'

export default defineComponent({
  ...
  setup () {
    const foo = ref(0)
    const bar = computed(() => {
      foo.value = 1 // SIDE EFFECT
      return true
    })
  }
})
</script>

What did you expect to happen?

Fire vue/no-side-effects-in-computed-properties rule as it's marked as error and after debugging it a bit seems like not parsing computed fields as computed nodes.

image

jesusgn90 avatar May 19 '21 09:05 jesusgn90