-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More intuitive react component naming convention #198
Comments
I feel completely lost when I see pascal-cased files, but that's just my opinion. I don't think there's really a "reason" for the current naming convention, but it's great to know all your files and community provided files will respect that rule. I don't see a real reason for letting people use both naming conventions, nor I see why we should use the Pascal naming. |
See https://talk.mantrajs.com/t/file-naming-convention/116 -- looks like this was/is going to happen at some point. |
I agree with that post -- snake case should be replaced with the name of the default export. |
Mantra-cli creates snake_case_files, but I would like to add an option for PascalCase. I used now snake_case for a while as filenames and I still hate them. It makes you slower when writing paths manually or using copy-paste for variable names a lot. Apart from that i see no benefits in snake_case_files. But as for mantra, I would not enforce either. |
I know it's been fairly settled on using all lowercase naming conventions, with an underscore to separate words per https://kadirahq.github.io/mantra/#sec-Source-File-Names
I think this is ok for regular files. However, I've used both formats, and this format (PascalCase) feels far more intuitive, specifically for react components:
https://github.com/airbnb/javascript/tree/master/react#naming
I'd like to know others thoughts on this, and why.
The text was updated successfully, but these errors were encountered: