Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update: improve warnings about key on template elements #45

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

Merged
michalsnik merged 3 commits into master from issue43
Jun 30, 2017
Merged

Conversation

Copy link
Member

@mysticatea mysticatea commented Jun 22, 2017

Fixes #43.

This PR does 2 things.

  1. Fixes no-invalid-v-for and require-v-for-key rules to check whether child elements of <template> elements have v-bind:key attribute. [semver-minor]
  2. Add new no-template-key rule to disallow key attribute on <template> elements. I think that no-template-key rule should be recommended, however I set recommended: false for now because semver policy of ESLint needs a major version to update the recommended config. [semver-minor]

emrekaranfil reacted with thumbs up emoji

This rule reports the `<template>` elements which have `key` attribute.

👎 Examples of **incorrect** code for this rule:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think GitHub emoji code (e.g. :tada:) is maintainaceble(read/write) than emoji binary code. 👀

Copy link
Member

@michalsnik michalsnik Jun 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @kazupon, I did so while importing elint-plugin-vue-trial too

Copy link
Member Author

@mysticatea mysticatea Jun 22, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my custom, I don't use the notation since it doesn't work outside of GitHub (i.g. document generators, editor previews, etc...). Should I use it?

Copy link
Member Author

I solved merge conflicts.

Copy link
Member

@michalsnik michalsnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @mysticatea However I don't quite get why the key on template is considered harmful, could you please explain this a little bit? Reason behind this in rule's documentation would also be helpful for others I think.

Copy link
Contributor

armano2 commented Jun 29, 2017

thats why: #43
<template> cannot be keyed. Place the key on real elements instead.

michalsnik and GeekStocks reacted with thumbs up emoji

@michalsnik michalsnik merged commit 866d057 into master Jun 30, 2017
@michalsnik michalsnik deleted the issue43 branch June 30, 2017 08:36
armano2 pushed a commit to armano2/eslint-plugin-vue that referenced this pull request Jul 13, 2017
* Update: add check for `key` attribute of child of templates (refs vuejs#43)
* New: no-template-key (fixes vuejs#43)
* replace emoji by github notation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@kazupon kazupon kazupon left review comments

+1 more reviewer

@michalsnik michalsnik michalsnik approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /