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
Fix false positives for "always" option in declaration-empty-line-before #4635
Comments
I just noticed #4574. Maybe this bug should be added to the list? |
@larrifax Thanks for the clear report, using the template and for creating a reproducible demo. The issue is either with:
If it's the former, please consider contributing a fix to stylelint itself. There are steps on how to fix a bug in a rule in the Developer guide. If it's the latter, please consider contributing to the parser.
Done. |
I've done a bit of research, and it seems like the problem is that stylelint/lib/utils/isFirstNested.js Lines 12 to 13 in 343e40d
In this specific case, From the discussion you had on #4003, I understand that you:
The suggested fix at that time was to introduce some kind of @jeddy3 Do you have comments as to how to proceed further? It seems like a decision needs to be made by someone with a more thorough understanding of the codebase and the vision of stylelint than me on this one. |
@larrifax Many thanks for digging deeper. I suggest we change
The built-in rules support standard CSS because of the speed of change in the world of CSS-like language extensions and, especially in, CSS-in-JS styling frameworks. From the docs:
I think the PostCSS syntaxes should transform the source into an AST that will closely resemble the final CSS. I think that approach would make the built-in rules useful to the most number of people. We're trying to rally community support for maintaining |
Closing as stylistic rules are frozen. The community is welcome to migrate the rule to a plugin and fix this bug. |
There are false positives for
declaration-empty-line-before
when adding simple styles usingstyled-components
with stylelints built-in support for css-in-js. See example & demo below for a reproduction.Might be related to #4003.
declaration-empty-line-before
13.1.0
CLI with
stylelint src/**/*.{ts,tsx}
. The same issue can be observed on the demo page.Yes, it's related to css-in-js (styled-components).
No warnings to be flagged.
The following errors were flagged:
The text was updated successfully, but these errors were encountered: