Vue · VUE0041

Review computed() getters with no reactive dependencies

Flags computed() getters that return a literal.
VUE0041vite-doctor/vuereactivitywarnSuggestion

Run this rule

pnpm vite-doctor . --framework vue --rules vue/reactivity/no-constant-computed

Why it matters

A synchronous computed() getter that returns a literal reads no reactive source and never recomputes. Its readonly ComputedRef wrapper can still be required by exported composables, explicit types, or callers using .value.

Keep computed() when consumers require a readonly ComputedRef or .value access. Use a plain const only when no ref contract is required.

Example

Use a constant when consumers accept a plain value

Before

const heading = computed(() => 'Upcoming events')

After

const heading = 'Upcoming events'
Copyright © 2026