vue/no-empty-pattern
Disallow empty destructuring patterns in template expressions.
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
warning |
None | No | None |
Applies to: Vue SFC templates and blocks, with script context where the rule requires it.
Bad
The callback destructures an empty object pattern.
<template>
<p>{{ items.map(({}) => 1) }}</p>
</template>
Good
The callback names the property it consumes.
<template>
<p>{{ items.map(({ id }) => id) }}</p>
</template>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"vue/no-empty-pattern": "warn"
}
},
});
Then run vp run lint.