musea/require-component
Require component attribute in <art> block.
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
warning |
None | No | None |
Applies to: Musea .art.vue art, variant, and style blocks.
Bad
The art block supplies a title but does not identify the component being previewed.
<art title="Button">
<variant name="primary" />
</art>
Good
defineArt supplies ./Button.vue as the component for the art block.
<script setup>
defineArt("./Button.vue", { title: "Button" });
</script>
<art>
<variant name="primary" />
</art>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"musea/require-component": "warn"
}
},
});
Then run vp run lint.