Vize

script/no-ref-as-operand

Require ref-bound variables to be accessed via .value when used as an operand.

Default severity Presets Automatic fix Options
error essential, happy-path, ecosystem, nuxt, opinionated No None

Applies to: JS/TS scripts in Vue SFCs; examples show the relevant Options API or script setup form.

Bad

count + 1 uses the ref object itself as the arithmetic operand instead of the number it wraps.

<script setup lang="ts">
import { ref } from "vue";
const count = ref(0);
const next = count + 1;
</script>

Good

count.value + 1 reads the wrapped number before adding one; script arithmetic requires this explicit ref access.

<script setup lang="ts">
import { ref } from "vue";
const count = ref(0);
const next = count.value + 1;
</script>

Configuration (Vite+)

import { defineConfig } from "@vizejs/vite-plugin/vite-plus";

export default defineConfig({}).withVue({
  linter: {
    "preset": "incremental",
    "rules": {
      "script/no-ref-as-operand": "error"
    }
  },
});

Then run vp run lint.