Skip to content

Rule Proposition: name property casing #93

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

Closed
filipalacerda opened this issue Jul 18, 2017 · 9 comments
Closed

Rule Proposition: name property casing #93

filipalacerda opened this issue Jul 18, 2017 · 9 comments

Comments

@filipalacerda
Copy link
Contributor

Per feedback in #77 (comment):

Rule proposition:

name property casing

Define a style for the name property casing for consistency purposes:

Configuration

'vue/name-casing': ['camelCase'|'kebab-case'|'PascalCase']

camelCase
{
  name: 'myComponent'
}
kebab-case
{
  name: 'my-component'
}
PascalCase
{
  name: 'MyComponent'
}

cc @armano2

@armano2
Copy link
Contributor

armano2 commented Jul 18, 2017

@filipalacerda pull request #94 with rule added, can you please look into

https://github.com/armano2/eslint-plugin-vue/blob/patch-14-name-casing/docs/rules/name-casing.md
is that enough?

@filipalacerda
Copy link
Contributor Author

@armano2 the readme LGTM 🚀

@mysticatea
Copy link
Member

Thank you for the proposal!

Sounds good to me. I prefer PascalCase by default and the default should be declared in documents.

I think the rule name name-casing is too general. It should be specialized for the component name.

Maybe component-name-casing?
But it might mislead to the rule which is for use-side (e.g. <template><MyComponent /></template>).

Hmm...
I'm not sure proper name...

@armano2
Copy link
Contributor

armano2 commented Jul 20, 2017

@mysticatea what do you think about no-invalid-component-name-casing?

@mysticatea
Copy link
Member

@armano2 I have learned that we should avoid double negation, while I have written core rules.

How about name-property-casing?

@mysticatea
Copy link
Member

mysticatea commented Jul 20, 2017

Aha, I have already used many double negation 😂

@armano2
Copy link
Contributor

armano2 commented Jul 20, 2017

@mysticatea name-property-casing seem good
there is not going to be confusion about template <=> script

@armano2
Copy link
Contributor

armano2 commented Jul 22, 2017

@mysticatea #94 is merged i thik we can close this ticket

@michalsnik
Copy link
Member

Released in v3.8.0 🚀 Thanks!

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

No branches or pull requests

4 participants