-
-
Notifications
You must be signed in to change notification settings - Fork 681
Rule proposal: component-filename-casing
#248
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
Comments
I think this would be good to have, but I'm really torn on what the default should be. 😕 |
I think PascalCase is the only right default :) it would be common with the way you import components |
The only issue is that PascalCase can cause issues when renaming files on case-insensitive OSes and with Git, e.g. when renaming When setting defaults for other users though, I feel uncomfortable with an out-of-the-box config that can cause subtle issues and even be difficult to diagnose and fix if they've never encountered the problem before. I think ideally, the default would be "either convention, as long as it's consistently one or the other." Is that possible? If not, I think it might be best to either make kebab-case the default, so that users have to explicitly opt in to a potentially dangerous file naming scheme, or not include it in any config by default. |
This is a valid concern @chrisvfritz. Unfortunately we can't compare one file to another. If we use PascalCase everywhere, but would have a rule with |
If someone thinks otherwise and have strong opinion, please reopen this issue to continue discussion :) I'm going to close topics that have no conclusion after a while by default. |
@michalsnik Is there any progress or any plugins / rules you know of that can enforce |
Similar to
name-property-casing
this rule would enforce proper filename casing of vue component.https://vuejs.org/v2/style-guide/#Single-file-component-filename-casing-strongly-recommended
It should be quite easy to do in eslint. While parsing AST we can check for filename and report the root element if it's not ok.
The text was updated successfully, but these errors were encountered: