Skip to content
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

Open
markshust opened this issue Jun 29, 2016 · 4 comments
Open

More intuitive react component naming convention #198

markshust opened this issue Jun 29, 2016 · 4 comments

Comments

@markshust
Copy link

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.

@fermuch
Copy link

fermuch commented Jun 30, 2016

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.

@markshust
Copy link
Author

See https://talk.mantrajs.com/t/file-naming-convention/116 -- looks like this was/is going to happen at some point.

@markshust
Copy link
Author

I agree with that post -- snake case should be replaced with the name of the default export.

@macrozone
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants