eslint-plugin-vue
eslint-plugin-vue copied to clipboard
Fix no-ref-as-operand and allow lint when ref as right operator
fix #2271
Thanks for this PR. However, I think that this PR change has caused false positives in the following usages.
<script setup lang="ts">
import { ref, Ref } from 'vue'
const refValue1: Ref<number> = ref(0)
const maybeRefValue: Ref<number> | null = getMaybeRef()
const refValue2 = maybeRefValue || refValue1
console.log(refValue2.value)
</script>
I think we should keep track of how the result of the expression is used. Also, I think the ternary operator could be improved if it would be possible to track the usage of the result of the expression.