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

Fix trailing zeroes being removed by autofix in length-zero-no-unit #5256

Merged
merged 2 commits into from Apr 24, 2021

Conversation

jeddy3
Copy link
Member

@jeddy3 jeddy3 commented Apr 21, 2021

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

Closes #5255

Is there anything in the PR that needs further explanation?

It makes use of patterns found in our more recent rules.

@@ -318,7 +326,7 @@ testRule({
},
{
code: 'a { top: 0.000px; }',
fixed: 'a { top: 0; }',
fixed: 'a { top: 0.000; }',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have been outside the scope of this rule in favour of number-no-trailing-zeros.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. 👍🏼

So, this change may be a bug fix, not a refactoring?
(maybe, this PR title is confusing... 🤔 )

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. This PR can make the code very clearer and readable! 👏🏼

I've left the comments, but this change is totally so good! 😄

lib/rules/length-zero-no-unit/index.js Outdated Show resolved Hide resolved
lib/rules/length-zero-no-unit/index.js Outdated Show resolved Hide resolved
@@ -318,7 +326,7 @@ testRule({
},
{
code: 'a { top: 0.000px; }',
fixed: 'a { top: 0; }',
fixed: 'a { top: 0.000; }',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. 👍🏼

So, this change may be a bug fix, not a refactoring?
(maybe, this PR title is confusing... 🤔 )

lib/utils/setAtRuleParams.js Show resolved Hide resolved
lib/rules/length-zero-no-unit/index.js Outdated Show resolved Hide resolved
lib/rules/length-zero-no-unit/index.js Show resolved Hide resolved
@jeddy3
Copy link
Member Author

jeddy3 commented Apr 23, 2021

@ybiquitous Thanks for the review! Good catches and suggestions.

So, this change may be a bug fix, not a refactoring?

Yes, it started out as a refactor but fixed a bug. I'll change the title, and as such, the changelog entry.

@jeddy3 jeddy3 changed the title Refactor length-zero-no-unit to remove styleSearch Fix trailing zeroes being removed by autofix in length-zero-no-unit Apr 23, 2021
Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. LGTM! 👏🏼

Copy link
Member

@m-allanson m-allanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jeddy3 jeddy3 merged commit 813e89e into master Apr 24, 2021
@jeddy3 jeddy3 deleted the issue-5255 branch April 24, 2021 08:18
@jeddy3
Copy link
Member Author

jeddy3 commented Apr 24, 2021

  • Fixed: length-zero-no-unit autofix removing trailing zeroes (#5256).

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

Successfully merging this pull request may close these issues.

Refactor length-zero-no-unit to remove stylesearch
3 participants