Create-react-app: all file names lowercase - use hyphens instead of camelcase

Created on 12 Feb 2020  ยท  3Comments  ยท  Source: facebook/create-react-app

Strange mixture of camelcase and hyphenated files when I used:

npx create-react-app . --typescript

Screenshot from 2020-02-12 11-15-19

I would recommend only lowercase filenames - the technical reason is that macos is case insensitive and linux is not. so macos fs won't see file renamings easily when using git etc. people that know will know what I am talking about

proposal needs triage

Most helpful comment

This is something that's been nagging away in the back of my mind for quite a while, I'm not completely sure where the convention arose from.

The lowercase filename convention is far more friendly towards non-Linux systems!

All 3 comments

This is something that's been nagging away in the back of my mind for quite a while, I'm not completely sure where the convention arose from.

The lowercase filename convention is far more friendly towards non-Linux systems!

The Pascal case is extremely common for component file names in the react ecosystem. That way your import matches the module:

import Button from โ€./Button"

The other outlier is the .d.ts file, which could be renamed arguably.

@ianschmitz that may be so, but have to stop digging the pit at some point. Mixture of upper and lower case filenames is bad for technical reasons mentioned above. Basically any system that is not type-checked - I always use lower case names only.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alleroux picture alleroux  ยท  3Comments

fson picture fson  ยท  3Comments

onelson picture onelson  ยท  3Comments

alleroux picture alleroux  ยท  3Comments

barcher picture barcher  ยท  3Comments