# vue/component-definition-name-casing

enforce specific casing for component definition name

  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

Define a style for component definition name casing for consistency purposes.

# 📖 Rule Details

This rule aims to warn the component definition names other than the configured casing.

# 🔧 Options

Default casing is set to PascalCase.

{
  "vue/component-definition-name-casing": ["error", "PascalCase" | "kebab-case"]
}
  • "PascalCase" (default) ... enforce component definition names to pascal case.
  • "kebab-case" ... enforce component definition names to kebab case.

# `"PascalCase" (default)

<script> export default { /* ✓ GOOD */ name: 'MyComponent' } </script>
Now loading...
<script> export default { /* ✗ BAD */ name: 'my-component' } </script>
Now loading...
/* ✓ GOOD */ Vue.component('MyComponent', { }) /* ✗ BAD */ Vue.component('my-component', { })
Now loading...

# `"kebab-case"

<script> export default { /* ✓ GOOD */ name: 'my-component' } </script>
Now loading...
<script> export default { /* ✗ BAD */ name: 'MyComponent' } </script>
Now loading...
/* ✓ GOOD */ Vue.component('my-component', { }) /* ✗ BAD */ Vue.component('MyComponent', { })
Now loading...

# 📚 Further reading

# 🔍 Implementation

Last Updated: 12/26/2019, 9:01:53 AM