Skip to content

Latest commit

 

History

History
89 lines (66 loc) · 2.12 KB

name-property-casing.md

File metadata and controls

89 lines (66 loc) · 2.12 KB
pageClass sidebarDepth title description
rule-details
0
vue/name-property-casing
enforce specific casing for the name property in Vue components

vue/name-property-casing

enforce specific casing for the name property in Vue components

📖 Rule Details

This rule aims at enforcing the style for the name property casing for consistency purposes.

<script>
  /* ✓ GOOD */
  export default {
    name: 'MyComponent'
  }
</script>
<script>
  /* ✗ BAD */
  export default {
    name: 'my-component'
  }
</script>

🔧 Options

{
  "vue/name-property-casing": ["error", "PascalCase" | "kebab-case"]
}
  • "PascalCase" (default) ... Enforce the name property to Pascal case.
  • "kebab-case" ... Enforce the name property to kebab case.

"kebab-case"

<script>
  /* ✓ GOOD */
  export default {
    name: 'my-component'
  }
</script>
<script>
  /* ✗ BAD */
  export default {
    name: 'MyComponent'
  }
</script>

📚 Further reading

🔍 Implementation