# san/data-name-casing

enforce data names always use "camel-case"

  • ⚙️ This rule is included in all of "plugin:san/essential", "plugin:san/strongly-recommended" and "plugin:san/recommended".

# 📖 Rule Details

computeddataTypesinitData properties name must be camel-case , it will not work when the property name is snakeCase、kebabCase or PascalCase.

<script> export default { /* ✓ GOOD */ dataTypes: { datatypeText: DataTypes.string }, computed: { aText() { return this.data.get('text') + 'a'; } }, initData() { return { text: 'text' } }, /* ✗ BAD */ dataTypes: { 'datatype-text': DataTypes.string }, computed: { /* PascalCase */ 'AText'() { return this.data.get('text_bad') + 'a'; }, /* snakeCase */ 'b_text'() { return this.data.get('text_bad') + 'b'; }, /* kebabCase */ 'c-text'() { return this.data.get('text_bad') + 'c'; } }, initData() { return { text_bad: 'text' } }, } </script>
Now loading...

# 🔍 Implementation

Last Updated: 10/26/2021, 7:23:11 AM