script/no-duplicate-attr-inheritance
Flag a component that applies its fallthrough attributes twice
Default severity: warning
Presets: happy-path, ecosystem, nuxt, opinionated
Automatic fix: None; review the suggested change
Applies to: JS/TS scripts in Vue SFCs; examples show the relevant Options API or script setup form
Options: No rule-specific options. Severity and preset selection are configurable.
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({
lint: {
vize: {
"preset": "incremental",
"rules": {
"script/no-duplicate-attr-inheritance": "warn"
}
},
},
});
vp run lint
Bad
The explicit inheritAttrs: true values restate Vue’s default. This rule reports that redundant literal even when no root $attrs spread is shown.
<script lang="ts">
defineOptions({ inheritAttrs: true })
export default { inheritAttrs: true }
</script>
Good
inheritAttrs: false expresses a real opt-out, while the empty options object leaves default inheritance implicit. Neither restates the redundant true value.
<script lang="ts">
defineOptions({ inheritAttrs: false }) // intentional opt-out
export default {} // default inheritance, unstated
</script>
Good avoids this rule's finding under the configuration above; other rules may still report diagnostics.