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

Rule Proposition: Props Casing #92

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

Rule Proposition: Props Casing #92

filipalacerda opened this issue Jul 18, 2017 · 4 comments

Comments

@filipalacerda
Copy link
Contributor

Per feedback in #77 (comment):

Rule proposition:

Props Casing

Define a style for the props casing in templates

We (at GitLab) often see inconsistency in the way we provide props through templates:

<component myProp="prop"></component>

or

<component my-prop="prop"></component>

Configuration

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

camelCase
<component myProp="prop"></component>
kebab-case
<component my-prop="prop"></component>
PascalCase
<component MyProp="prop"></component>

cc @armano2

@armano2
Copy link
Collaborator

armano2 commented Jul 18, 2017

@filipalacerda i think better name for this rule is html-attributes-casing

@filipalacerda
Copy link
Contributor Author

@armano2 they can be vue props tho 🤔

@armano2
Copy link
Collaborator

armano2 commented Jul 19, 2017

yes but we don't know if they are props or regular attributes and even if they are props they are still attributes

@mysticatea
Copy link
Member

mysticatea commented Jul 19, 2017

Thank you for the proposal!

Sounds good to me, but I have some notes.

  • This rule should apply to only HTML context; should not apply to SVG/MathML context because XML is case-sensitive.
  • I'm not sure the three options are proper. Because we are using all small letters in the attributes of HTML in practice. E.g. onclick, contenteditable, etc...
  • There are the - character which we cannot remove: HTML data-* attributes.

armano2 added a commit to armano2/eslint-plugin-vue that referenced this issue Aug 2, 2017
filipalacerda pushed a commit to filipalacerda/eslint-plugin-vue that referenced this issue Aug 5, 2017
* master:
  Add rule `vue/require-valid-default-prop`. (vuejs#119)
  3.10.0
  Update readme to 3.10.0
  Chore: remove package-lock.json (vuejs#128)
  Fix: parserService must exist always (fixes vuejs#125) (vuejs#127)
  Add rule `require-render-return`. (vuejs#114)
  3.9.0
  Update package-lock
  Update: options for `no-duplicate-attributes` (fixes vuejs#112)(vuejs#113)
  New: add rule `attribute-hyphenation`. (fixes vuejs#92)(vuejs#95)
  Add namespace check of svg & mathML instead of tag names (vuejs#120)
  ⚠️ Add support for deprecated state in update-rules ⚠️ (vuejs#121)
  Add rules: `no-dupe-keys` and `no-reserved-keys`. (vuejs#88)
  Chore: Improve tests for name-property-casing & improve documentation (vuejs#115)
  New: add `require-prop-types` rule (fixes vuejs#19)(vuejs#85)
  Update: upgrade vue-eslint-parser (fixes vuejs#36, fixes vuejs#56, fixes vuejs#96) (vuejs#116)
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

3 participants