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

What rule should be used to fix multiple whitespaces inside a class attribute in Vue components? #406

Closed
stefanobartoletti opened this issue Feb 20, 2024 · 4 comments

Comments

@stefanobartoletti
Copy link

I'm using your config as a base for mine, and I'd like to lint and fix multiple whitespace that may be present inside a class attribute in Vue components (and unneeded ending or starting spaces as well)

Basically this:

<!-- Good -->
<div class="flex gap-4">

<!-- Bad -->
<div class=" flex  gap-4 ">

I tried to check all available rules, but I'm not finding what I'm looking for.

The closest one seems to be vue/no-multi-spaces, but it only lints spaces between each attribute and not inside them.

Is it possible somehow? Thanks!

@antfu
Copy link
Owner

antfu commented Feb 22, 2024

I don't know - maybe you can write one your own. Honestly this repo is not the right place to ask for new rules. If you end up found/made one, I am open to discuss whether to bring it to this config. Thanks.

@antfu antfu closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2024
@stefanobartoletti
Copy link
Author

Thanks for your reply! I was not asking for a new rule to be written from scratch,just if there was something already available that I might have missed in your config, since it already packs several plugins.

I will look around for something then, thank you.

@thenbe
Copy link
Contributor

thenbe commented Feb 23, 2024

eslint-plugin-unocss has a rule (no-excessive-whitespaces) that accomplishes this.

eslint-plugin-tailwindcss has an open issue for it.

@hallucinogenizer
Copy link

hallucinogenizer commented Mar 21, 2024

eslint-plugin-unocss has a rule (no-excessive-whitespaces) that accomplishes this.

eslint-plugin-tailwindcss has an open issue for it.


eslint-plugin-unocss's README says:

Not ready for production use yet

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

No branches or pull requests

4 participants