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

feat: Add vue/no-multiple-objects-in-class rule #1218

Merged

Conversation

tyankatsu0105
Copy link
Contributor

@tyankatsu0105 tyankatsu0105 commented Jun 23, 2020

close #1093
I'm not sure of the rule name, so any better suggestions are welcome.

This PR adds vue/no-multiple-objects-in-class rule.

@tyankatsu0105 tyankatsu0105 marked this pull request as draft June 23, 2020 04:34
@tyankatsu0105 tyankatsu0105 changed the title feat: Add vue/no-multiple-object-in-class feat: Add vue/no-multiple-objects-in-class Jun 23, 2020
@tyankatsu0105 tyankatsu0105 marked this pull request as ready for review June 23, 2020 12:54
@tyankatsu0105 tyankatsu0105 changed the title feat: Add vue/no-multiple-objects-in-class feat: Add vue/no-multiple-objects-in-class rule Jun 23, 2020
Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

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

Thank you for this PR!
Almost looks good to me, but I have only one request.

lib/rules/no-multiple-objects-in-class.js Outdated Show resolved Hide resolved
valid: [
`<template><div :class="[{'foo': isFoo}]" /></template>`,
`<template><div :class="[{'foo': isFoo, 'bar': isBar}]" /></template>`,
`<template><div v-foo:class="[{'foo': isFoo}, {'bar': isBar}]" /></template>`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This rule don't take into other thanv-bind:class consideration.

Copy link
Member

@ota-meshi ota-meshi 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 to me! Thank you!

@ota-meshi ota-meshi merged commit e70eee6 into vuejs:master Jun 26, 2020
@tyankatsu0105 tyankatsu0105 deleted the add-rule/no-multiple-object-in-class branch June 26, 2020 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule Proposal: single object in class array
2 participants