vuejs / eslint-plugin-vue

Official ESLint plugin for Vue.js
https://eslint.vuejs.org/
MIT License
4.38k stars 649 forks source link

`vue/no-ref-as-operand` not catching `computed` refs #2454

Open chetan opened 1 month ago

chetan commented 1 month ago

Checklist

Tell us about your environment

What did you do?

    const count = ref(0)
    const ok = ref(true)

    const notok = computed(() => !ok.value)
    if (notok || !ok) {
      console.log("not ok!!")
    }

What did you expect to happen?

notok should be flagged as a problem in the condition above.

What actually happened?

Only !ok is flagged.

It's happening in my local env but I am able to reproduce in the web docs:

Screenshot 2024-04-22 at 11 38 42 AM

Repository to reproduce this issue

can provide more info on my local configs if needed.