A Vue ref is used in arithmetic or a comparison without .value, so the ref object is used instead of its value
What it finds
ref(0) returns an object that holds the value in .value. Outside templates, where Vue unwraps refs, count + 1 adds to the object and gives a string, and count > 0 compares an object. count.value is the number.
Reported are names initialized with ref, shallowRef or computed from Vue that are an operand of an arithmetic or relational operator, or of ++ or --.
From the rule's source, ref_used_without_value.rs.
import { ref } from "vue";const count = ref(0);export const next = count + 1;tx0 reports: count is a ref; its value is .valueexport const fine = count.value + 1; Turn it on, off or suppress it
The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:
[rules]
"tx0/ts:ref-used-without-value" = "off"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/ts:ref-used-without-value] reason="..."tx0 explain tx0/ts:ref-used-without-value shows the same in the terminal. Found a false positive? Report it.