Skip to content

Rule Proposal: single object in class array #1093

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
1 of 4 tasks
privatenumber opened this issue Apr 4, 2020 · 1 comment · Fixed by #1218
Closed
1 of 4 tasks

Rule Proposal: single object in class array #1093

privatenumber opened this issue Apr 4, 2020 · 1 comment · Fixed by #1218

Comments

@privatenumber
Copy link
Contributor

privatenumber commented Apr 4, 2020

Please describe what the rule should do:

The rule should enforce that only one object is used in an array of classes

What category should the rule belong to?

  • Enforces code style
  • Warns about a potential error
  • Suggests an alternate way of doing something
  • Other (please specify:)

Provide 2-3 code examples that this rule should warn about:

<template>
	<div :class="[{ a: true }, { b: true }, 'c']" />
</template>

Can be fixed to:

<template>
	<div :class="[{ a: true, b: true }, 'c']" />
</template>

Can open a PR if proposal is approved.

@ota-meshi
Copy link
Member

Thank you for proposing the rule.

I like that rule you proposed.

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.

2 participants