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

Prop name casing setting for attribute completion #1136

Open
3 tasks done
rickyruiz opened this issue Mar 5, 2019 · 9 comments
Open
3 tasks done

Prop name casing setting for attribute completion #1136

rickyruiz opened this issue Mar 5, 2019 · 9 comments

Comments

@rickyruiz
Copy link

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: Win 10
  • Vetur version: 0.16.2
  • VS Code version: 1.31.1

Problem

Vue's styleguide for strongly recommended prop name casing establishes the following:

Prop names should always use camelCase during declaration, but kebab-case in templates and JSX.

Could there be an option to set this in settings? Just like we do for PascalCase tag casing with "vetur.completion.tagCasing": "initial".

Something like:

"vetur.completion.attrCasing": "kebab-case"

Reproducible Case

Set a prop using camelCase:

image

Attribute completion is in camelCase instead of kebab-case.

image

@octref
Copy link
Member

octref commented Mar 6, 2019

Isn't "vetur.completion.tagCasing": "kebab" what you are asking?

@rickyruiz
Copy link
Author

rickyruiz commented Mar 6, 2019

"vetur.completion.tagCasing": "kebab" will complete the <azure-map> tag in kebab-case, but I'm referring to the attribute exampleProp. Could we have an option to suggest example-prop instead of its camelCase version?

I'd like to use the tag completion in PascalCase ("vetur.completion.tagCasing": "initial"), but the attribute completion in kebab-case.

ie.

<AzureMap 
  :example-prop="foo"
/>

This is something that can be fixed on save with eslint. Maybe leaving it to eslint is okay?

vetur-attribute-completion

@octref
Copy link
Member

octref commented Mar 21, 2019

I see, thanks for the report.

@aryraditya
Copy link

is there any progress for this ?

@GGLionCross
Copy link

+1

3 similar comments
@mishannn
Copy link

+1

@noxware
Copy link

noxware commented Nov 1, 2021

+1

@Citriik
Copy link

Citriik commented Nov 3, 2021

+1

@yoyo930021
Copy link
Member

Fixed in #3015

@yoyo930021 yoyo930021 linked a pull request Nov 3, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants