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

Stylelint: Disallow "union" sass selectors #25

Open
ryelle opened this issue Jan 6, 2023 · 2 comments
Open

Stylelint: Disallow "union" sass selectors #25

ryelle opened this issue Jan 6, 2023 · 2 comments
Labels
devex affects developer experience

Comments

@ryelle
Copy link
Contributor

ryelle commented Jan 6, 2023

Should we add the selector-no-union-class-name rule to disallow inline & in CSS selectors? This would prevent incomplete selectors in SCSS files, but still allow combining selectors.

For example:

.class {
    &-union { /* not allowed */ }
    &.child-class { /* this is okay */ }
}
@adamwoodnz
Copy link

I agree this can be problematic in large blocks where one can lose sight of the prefix, and there is no way to define what is the right size of block for it to be ok. Having a rule in the tooling means it's one less thing to think about when reviewing so I'm for it 👍

@iandunn
Copy link
Member

iandunn commented Jan 11, 2023

💯 , I find those a much harder to search for, and even when just reading it introduces a tiny bit of friction. I don't really see any significant benefit to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devex affects developer experience
Projects
None yet
Development

No branches or pull requests

3 participants