Skip to content

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

Closed
@chetan

Description

@chetan

Checklist

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

Tell us about your environment

  • ESLint version: 8.57.0
  • eslint-plugin-vue version: 9.25.0
  • Vue version: 3.4.24
  • Node version: v20.12.1
  • Operating System: macOS 14 (Sonoma)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reproNeed a repository that can reproduce the problem, or a link to DEMO.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions