Skip to content

Breaking: Update fixer-return and prefer-replace-text rules to also apply to suggestion fixer functions #194

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Conversation

bmish
Copy link
Member

@bmish bmish commented Sep 26, 2021

These rules should apply to both autofix and suggestion fixer functions.

Updating these two rules together since they share the same logic.

Fixes #193
Fixes #190

Part of v4 release (#120).

@bmish bmish force-pushed the fixer-return-prefer-replace-text-suggestions branch from df39419 to 4d53d0f Compare September 26, 2021 16:41
contextIdentifiers.has(parent.parent.parent.parent.parent.parent.callee.object) &&
parent.parent.parent.parent.parent.parent.callee.property.name === 'report' &&
this.getReportInfo(parent.parent.parent.parent.parent.parent.arguments).suggest === parent.parent.parent;
},
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a few tests for it, in tests/lib/utils.js?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added tests.

@bmish bmish force-pushed the fixer-return-prefer-replace-text-suggestions branch 2 times, most recently from 2c08674 to 25de00f Compare September 27, 2021 04:15
@bmish bmish force-pushed the fixer-return-prefer-replace-text-suggestions branch from 25de00f to 13f7d61 Compare September 27, 2021 04:23
Copy link
Contributor

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! 💯

@aladdin-add aladdin-add merged commit 29d6e6b into eslint-community:master Sep 27, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
2 participants