vue/no-unused-setup-bindings
Disallow unread script setup bindings.
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
warning |
happy-path, nuxt, ecosystem, opinionated |
No | None |
Applies to: Vue SFC templates and blocks, with script context where the rule requires it.
Bad
The script setup message binding is never read by the template.
<script setup>const message = "Hello";</script>
<template><p>Welcome</p></template>
Good
The paragraph interpolates message, using the declared binding.
<script setup>const message = "Hello";</script>
<template><p>{{ message }}</p></template>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"vue/no-unused-setup-bindings": "warn"
}
},
});
Then run vp run lint.