Skip to content

Rule proposal: v-if-else-key #255

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
michalsnik opened this issue Nov 26, 2017 · 1 comment · Fixed by #2280
Closed

Rule proposal: v-if-else-key #255

michalsnik opened this issue Nov 26, 2017 · 1 comment · Fixed by #2280

Comments

@michalsnik
Copy link
Member

Style guide:
https://vuejs.org/v2/style-guide/#v-if-v-if-else-v-else-without-key-use-with-caution

Description:
This rule would enforce to add key property on elements with v-if and v-else directives if they're both of the same type.

@chrisvfritz
Copy link
Contributor

This is very much related to our discussion here. The same requirements regarding key with v-for exist for v-if, so maybe these should even be in the same rule, perhaps called require-key-on-stateful-enumerated-elements?

@mysticatea mysticatea removed their assignment Nov 23, 2018
doug-wade added a commit to doug-wade/eslint-plugin-vue that referenced this issue Apr 13, 2022
@FloEdelmann FloEdelmann linked a pull request Apr 13, 2022 that will close this issue
doug-wade added a commit to doug-wade/eslint-plugin-vue that referenced this issue Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants