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: handle multiple imports with no-manual-cleanup #835

Merged
merged 2 commits into from Nov 9, 2023

Conversation

maisano
Copy link
Contributor

@maisano maisano commented Oct 25, 2023

Checks

Changes

Crawl all the import references when sniffing out no-manual-cleanup violations.

Context

There is currently a bug with no-manual-cleanup where we only ever check the first import of any testing-library package. While duplicative imports of the same package is very likely uncommon, there are many packages within the testing-library ecosystem that will trip up the package detection and break this rule when we only look at the first.

@maisano-patreon
Copy link

👋 Curious if I can get some eyes this, cc @Belco90

@Belco90 Belco90 self-requested a review October 27, 2023 14:17
@Belco90 Belco90 added the bug Something isn't working label Oct 27, 2023
@Belco90
Copy link
Member

Belco90 commented Oct 27, 2023

I'll try to review this next week.

@maisano-patreon
Copy link

Hi hi – bumping this again! Should be a very quick review. The PR just accounts for when someone might have multiple testing library imports (which is common in my company's codebase).

Copy link
Member

@Belco90 Belco90 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 for taking care of this!

@Belco90 Belco90 enabled auto-merge (squash) November 9, 2023 08:28
@Belco90 Belco90 merged commit cb84da2 into testing-library:main Nov 9, 2023
28 checks passed
Copy link

github-actions bot commented Nov 9, 2023

🎉 This PR is included in version 6.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Belco90
Copy link
Member

Belco90 commented Nov 9, 2023

@all-contributors please add @maisano for code and test

Copy link
Contributor

@Belco90

I've put up a pull request to add @maisano! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants