Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Remove hardcoded transform from float to cssFloat #172

Merged

Conversation

rbong
Copy link

@rbong rbong commented Jun 5, 2021

Which issue, if any, is this issue related to?

Fixes stylelint/stylelint#4490

Please let me know if I should open an issue in this repository, it's marked as an upstream issue there but I could not find a corresponding ticket.

Is there anything in the PR that needs further explanation?

The offending code has been around since the second commit and it's not explained, so I can only assume that it's to attempt to catch uses of the reserved Javascript keyword "float" and automatically transform them to "cssFloat", however given that it's currently causing issues that can break code on --fix it should be removed.

Misuse of the keyword can be caught by Javascript code analysis tools.

The test case this removes appears to be a roundabout way of sort of testing the following transformation (by removing the raw value for "cssFloat"). This case has been removed since it's testing for behaviour that, according to this issue, we don't want:

import glm from 'glamorous';
const Component1 = glm.a({
	-float: "left",
	+cssFloat: "left",
});

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
@kowsen
Copy link

kowsen commented Sep 28, 2021

Is there a reason this can't be merged? This issue is blocking me from adding stylelint to my team's codebase and it looks like it's ready to go.

@jeddy3
Copy link
Member

jeddy3 commented Oct 10, 2021

Is there a reason this can't be merged?

Not anymore. It hasn't been merged yet as:

  • it was unknown if this package would be compatible with the next version of Stylelint (which uses PostCSS@8)
  • the package is in need of more maintainers

It now seems the package will be compatible with the next version of Stylelint. Please consider volunteering as a maintainer, if you use this package.

(See the end of https://github.com/stylelint/postcss-css-in-js/issues/225.)

@hudochenkov hudochenkov merged commit b4b5414 into stylelint:master May 3, 2022
@hudochenkov
Copy link
Member

  • Removed: hardcoded transform from float to cssFloat in objects (#172)

@hudochenkov
Copy link
Member

Released in 0.38.0.

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

Successfully merging this pull request may close these issues.

Fix autofix erroneous changes for float property
4 participants