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

Add a lint for unnecessary @at-root #601

Open
nex3 opened this issue May 7, 2022 · 0 comments
Open

Add a lint for unnecessary @at-root #601

nex3 opened this issue May 7, 2022 · 0 comments

Comments

@nex3
Copy link
Contributor

nex3 commented May 7, 2022

I've seen a number of cases where authors will write styles like @at-root .foo & or even @keyframes { @at-root from { ... } }, where the @at-root rule is totally unnecessary (in the first case because the selector includes & outside of any interpolation, so Sass already knows not to implicitly add a leading &; in the second case because @keyframes is always bubbled up to the root anyway). It would be useful to have a lint that advises against doing this and suggests deleting the @at-root as a fix. Ideally it would work with both the inline selector format and the nested format.

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

No branches or pull requests

1 participant