Skip to content

vue/no-ref-as-operand to support ref from composable #2519

Open
@kong-troop

Description

@kong-troop

Please describe what the rule should do:

Current vue/no-ref-as-operand rule only support the local ref. If a ref is being returned from a composable and being use with operand (eg: returnedRef++) , it didnt throw any warning as expected.

What category should the rule belong to?

[ ] Enforces code style (layout)
[x] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)

Provide 2-3 code examples that this rule should warn about:

const ok = ref(true)
const msg = ok ? 'yes' : 'no' // this throws warning as expected

// ---- //

const ok = useOk() // returned as Ref<boolean>
const msg = ok ? 'yes' : 'no' // No warning was shown

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions