DEV Community

Discussion on: JavaScript: File Naming Conventions

Collapse
 
tneullas profile image
Timotée Neullas

I am used to a module organised with a MVC approach.
Often people use Vue/Model/Controller folders, I much prefer organisation with module-a/module-b/module-c and inside module-a-model, module-a-vue etc. I prefer that because for large project it was awfull to have a huge list of Controller/M/V. Also you often have to work on a specific module so you have everything in one place.
For naming convention I used to do UpperPascal as it suits what most people use for naming Class. But in my company we use only kebab/spinal case mainly because of windows bad case sensitivity. I really got used to it.
For utils we tend to have a different folder.
Last but not least, you can automatise creating new module using some tools like plopjs. It's super easy to use and it gives you consistency.

Collapse
 
codewithluke profile image
Luke Babich

I see so you take the approach of grouping by module. I have definitely worked with this approach, you tend to get that sort of structure with something like Angular.

I would imagine that you keep similar functionalities at some commons layer?

Also PopJS looks really cool never used it!