Open enzy opened 6 years ago
I dont have a strong opinion here. What about @JirkaVebr @Onset and @Cactucs ?
export default class MyCustomComponent { ... }
Should the file be myCustomComponent.js
or MyCustomComponent.js
?
Well, it should hold that className === fileName
, and since the class name has to start with an uppercase letter (I don't presume anyone proposes to violate that convention), I'd say the current naming in next
is superior and desirable.
Filenames should start with the lower case letter for convenience and cross platforms compatibility. It also separates class names and file names so you can read and search&replace better. node.js packages are all in lowercase letters. We don't name folder names in uppercase also. All other files starts with lowercase.
for convenience
?!?
cross platform compatibility
Are we targeting platforms that don't support uppercase characters in filenames? Or what are you referring to?
separates class names and file names so you can read and search&replace better
What does that have to do with anything? Ill-advised refactoring methods are not a criterion here.
node.js packages are all in lowercase letters
Excellent observation; however, that is not what we are naming here. In fact, actual sources don't have to adhere to the same convention.
We don't name folder names in uppercase also. All other files starts with lowercase.
These are both false analogies that have nothing to do with the question discussed. Neither is relevant to the convention that if a file contains a single class, the file is named the same.
we use
camelCase
everywhere else + npm modules are named also in lowercase