Vize

musea/unique-variant-names

Require unique variant names

Bad · Good

Default severity: error
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/unique-variant-names": "error"
      }
    },
  },
});
vp run lint

Bad

Two variants in the same art block both use the primary name.

<art title="Button" component="./Button.vue">
  <variant name="primary" />
  <variant name="primary" />
</art>

Good

The variants have distinct primary and secondary names.

<art title="Button" component="./Button.vue">
  <variant name="primary" />
  <variant name="secondary" />
</art>

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

Implementation · All rules