useVueValidVMemo (JavaScript)
Summary
Section titled “Summary”- Rule available since:
v2.6.4 - Diagnostic Category:
lint/nursery/useVueValidVMemo - This rule doesn’t have a fix.
- The default severity of this rule is error.
- This rule belongs to the following domains:
- Sources:
- Same as
vue/valid-v-memo
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "useVueValidVMemo": "error" } } }}Description
Section titled “Description”Enforce valid v-memo Vue directives.
v-memo takes an array of values. Vue skips updating the element and its
children until one of those values changes.
This rule reports a v-memo value that can never be an array, such as an
object, a string, a number, or a function. When the value is a condition,
like a ? b : c, each possible result is checked.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<template> <div v-memo="{ x }"></div></template>
<template> <div v-memo="selected ? [item.id] : item.id + 1"></div></template>
<template> <div v-memo="[valueA, valueB]"></div> <div v-memo="dependencies"></div></template>Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.