Skip to content

Make vue/no-ref-as-operand also consider computed #2114

Closed
@DanSnow

Description

@DanSnow

What rule do you want to change?
vue/no-ref-as-operand

Does this change cause the rule to produce more or fewer warnings?
more warning

How will the change be implemented? (New option, new default behavior, etc.)?
Make vue/no-ref-as-operand also consider computed

Please provide some example code that this change will affect:

const count = ref(0)
const isEven = computed(() => count.value % 2 === 0)

watchEffect(() => {
  // warning at here
  if (isEven) {
    console.log('is even')
  }
})

What does the rule currently do for this code?
no warning

What will the rule do after it's changed?
Warning about incorrect usage for computed

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions