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 unexpected output in Node.js API lint result when any rule contains disableFix: true #6543

Merged
merged 3 commits into from Dec 28, 2022

Conversation

adrianjost
Copy link
Contributor

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

Closes #6542
and by that should also fix stylelint/vscode-stylelint#369

Is there anything in the PR that needs further explanation?

Issue: The API did not return the fixed css in output if any rule contained ruleDisableFix.

I have removed the ruleDisableFix code, because it did not affect the code fixing itself and I assume was wrongly used to change the content format of output. I have adjusted some tests to adapt to the changed behavior and extended the test conditions to check that the returned code has the correct fixes applied.

Issue was introduced in #5460

…ue` stylelint#6542

fixes stylelint#6542 and bv that should also fix stylelint/vscode-stylelint#369

Issue: The API did not return the fixed css in `output` if any rule contained `ruleDisableFix`.

I have removed the `ruleDisableFix` code, because it did not affect the code fixing itself and was assumingly wrongly used to change the content format of `output`.
I have adjusted some tests to adapt to the changed behaviour and extended the test conditions to check that the returned code has the correct fixes applied.

Issue was introduced in stylelint#5460
@changeset-bot
Copy link

changeset-bot bot commented Dec 23, 2022

🦋 Changeset detected

Latest commit: b670fe4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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 for creating the PR! I've left refactoring suggestions to improve readability a bit, but it looks good to me.

lib/__tests__/standalone-fix.test.js Outdated Show resolved Hide resolved
lib/__tests__/standalone-fix.test.js Outdated Show resolved Hide resolved
lib/__tests__/standalone-fix.test.js Outdated Show resolved Hide resolved
@ybiquitous ybiquitous changed the title Fix Unexpected Node API output when any rule contains disableFix: true #6542 Fix unexpected output in Node.js API lint result when any rule contains disableFix: true Dec 28, 2022
@ybiquitous ybiquitous mentioned this pull request Dec 28, 2022
6 tasks
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

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

@adrianjost Thank you for contributing!

LGTM.

@jeddy3 jeddy3 merged commit b165c0b into stylelint:main Dec 28, 2022
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.

Unexpected Node API output when any rule contains disableFix: true [Bug]: Fix feature does not work
3 participants