Vue · VUE0041
Review computed() getters with no reactive dependencies
Flags computed() getters that return a literal.
vue/reactivity/no-constant-computedsrc/rule-packs/vue/rules/vue/no-constant-computed.ts Upstream docs 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.
Recommended fix
Keep computed() when consumers require a readonly ComputedRef or .value access. Use a plain const only when no ref contract is required.
Useful links
Example
Use a constant when consumers accept a plain value
Before
const heading = computed(() => 'Upcoming events')
After
const heading = 'Upcoming events'