-
-
Notifications
You must be signed in to change notification settings - Fork 934
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 autofix erroneous changes for float property #4490
Comments
stylelint --fix
erroneously changes styled component float
property
Thanks for the report and for using the template. Most likely problem in |
Labeling as "help wanted" if anyone has time to fix the issue upstream in the |
We've forked the parser we use for CSS-in-JS into stylelint organisation, and we're looking for help to fix our fork to close this issue. See #4574. |
I've labelled this as "upstream" as this is an issue in one of the syntaxes stylelint uses. Please consider contributing to that syntax if you'd like the see this issue resolved fully. If you're unable to contribute to the syntax, please consider contributing a workaround to stylelint itself so that it won't attempt to autofix sources that contain |
I am having the same issue. Have to disable stylelint to make my code work... |
this is still active problem :/;
just to note, this is problem not just with styled-components; i'm facing this in jsx in general |
The value should only be transformed if the raw value was also "cssFloat". Otherwise, we should allow the user to use the "float" keyword in the cases it is actually valid, which we can't easily detect. Misuse of the keyword can be caught by Javascript code analysis tools. Fixes: stylelint/stylelint#4490
The value should only be transformed if the raw value was also "cssFloat". Otherwise, we should allow the user to use the "float" keyword in the cases it is actually valid, which we can't easily detect. Misuse of the keyword can be caught by Javascript code analysis tools. Fixes: stylelint/stylelint#4490
Any progress with @rbong's PR? |
Closing as the We'll also be deprecating our forked CSS-in-JS package, in favour of leaner custom syntaxes. Please consider writing a custom syntax specific to the CSS-in-JS library in this issue and fixing the bug there. |
The value should only be transformed if the raw value was also "cssFloat". Otherwise, we should allow the user to use the "float" keyword in the cases it is actually valid, which we can't easily detect. Misuse of the keyword can be caught by Javascript code analysis tools. Fixes: stylelint/stylelint#4490
Fix released in |
I'm using Stylelint with a typescript project that contains styled components using the
@emotion/styled
library. When runningstyelint --fix
on the codebase, instances offloat
are incorrectly changed tocssFloat
, which breaks the styling. Weirdly, no warnings are emitted, either with or without the fix flag.Not sure what rule causes this behaviour, haven't had any luck tracking it down in the docs.
Example styled component
after running the fix command it changes to:
Complete config below
12.0.0
(also occurs on 10.1.0, upgrade made no difference)CLI with
stylelint ./src --fix
Yes, styled components
No changes to be made to the file
float changed to cssFloat. No warnings are emitted, either with or without the fix flag.
The text was updated successfully, but these errors were encountered: