Vize

musea/require-component

Require component attribute in <art> block

Bad · Good

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/require-component": "warn"
      }
    },
  },
});
vp run lint

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>

Good avoids this rule's finding under the configuration above; other rules may still report diagnostics.

Implementation · All rules