Search code examples
vuex

Should Vuex Stores use snake_case or camelCase for their names?


As the stores are files, I’m inclined to make them snake_case.js so they’d become snake_case in Vue.

However, snake case seems not to be used much in Vue, so should instead the files be camelCase.js so they can be refered to as camelCase.

I appreciate that Stack Overflow is not really for opinions, so I am seeking a guide or reference that notes the best way to do this.


Solution

  • In the official Vue.js style guide, they say

    "Within JavaScript, camelCase is more natural. Within HTML, kebab-case is."