Vize

script/component-options-name-casing

Enforce PascalCase for the component name option

Bad · Good

Default severity: error
Presets: none
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/component-options-name-casing": "error"
      }
    },
  },
});
vp run lint

Bad

The component option name: 'my-component' is kebab-case, whereas this rule requires a literal component name in PascalCase.

<script lang="ts">
export default {
name: 'my-component' // kebab-case
}
</script>

Good

MyComponent begins with an uppercase letter and contains only alphanumeric characters, satisfying the name check.

<script lang="ts">
export default {
name: 'MyComponent'
}
</script>

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

Implementation · All rules