musea/no-empty-variant
Disallow empty <variant> blocks
Default severity: warning
Presets: none
Automatic fix: None; review the suggested change
Applies to: Musea .art.vue art, variant, and style blocks
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": {
"musea/no-empty-variant": "warn"
}
},
},
});
vp run lint
Bad
The named primary variant is empty, so it provides no preview content.
<art title="Button" component="./Button.vue">
<variant name="primary" />
</art>
Good
The variant renders a primary Button with its Save content.
<art title="Button" component="./Button.vue">
<variant name="primary">
<Button tone="primary">Save</Button>
</variant>
</art>
Good avoids this rule's finding under the configuration above; other rules may still report diagnostics.