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

@jeddy3 jeddy3 Apr 21, 2021

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.

Loading

Copy link
Member

@ybiquitous ybiquitous Apr 23, 2021

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... 🤔 )

Loading

Copy link
Member

@ybiquitous ybiquitous left a comment

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

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

Loading

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

@ybiquitous ybiquitous Apr 23, 2021

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... 🤔 )

Loading

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

@jeddy3 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.

Loading

@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

Thank you. LGTM! 👏🏼

Loading

Copy link
Member

@m-allanson m-allanson left a comment

👍

Loading

@jeddy3 jeddy3 merged commit 813e89e into master Apr 24, 2021
13 checks passed
Loading
@jeddy3 jeddy3 deleted the issue-5255 branch Apr 24, 2021
@jeddy3
Copy link
Member Author

@jeddy3 jeddy3 commented Apr 24, 2021

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

Loading

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

Successfully merging this pull request may close these issues.

3 participants