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

chore: use eslint-fix-utils for element and property removals #750

Merged
merged 6 commits into from
Jan 23, 2025

Conversation

JoshuaKGoldberg
Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg commented Jan 19, 2025

PR Checklist

Overview

Uses the exported APIs added in JoshuaKGoldberg/eslint-fix-utils@6bf5c33.

@michaelfaith I'd love to get your input on this: how does the API feel to you? If you think they should be changed drastically -here and/or in the other repo- I'm definitely up for iterating on them. 🙂

The build failures can be ignored, they're some problem in eslint-fix-utils that I haven't dug into yet. Blocked on: JoshuaKGoldberg/eslint-fix-utils#7[email protected] should work now.

💖

Copy link

codecov bot commented Jan 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.82%. Comparing base (e57765b) to head (6af7b1e).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #750      +/-   ##
==========================================
- Coverage   97.88%   97.82%   -0.06%     
==========================================
  Files          19       19              
  Lines        1180     1148      -32     
  Branches      142      140       -2     
==========================================
- Hits         1155     1123      -32     
  Misses         25       25              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JoshuaKGoldberg JoshuaKGoldberg changed the title chore: use eslint-fix-utils for element and property removals chore: use eslint-fix-utils for element and property removals Jan 19, 2025
@michaelfaith
Copy link
Collaborator

It definitely saved a fair amount of code in the cast of no-redundant-files, but it didn't really do anything to help us in unique-dependencies. It prevented us from taking advantage of the fact that you can assume the redundant dependency will not be the last element, and thus will always have a comma token after. So it ends up being a wash, in terms of value for that one.

As far as the api surface itself, it seems reasonable from the usage side.

@JoshuaKGoldberg
Copy link
Owner Author

Cool thanks! I'll go ahead and push this all through then. Agreed it's a little unfortunate to lose some of the nice optimizations in unique-dependencies. IME the cost of a few token lookups is never really relevant, so I don't mind too much.

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review January 21, 2025 13:29
@JoshuaKGoldberg JoshuaKGoldberg added the status: blocked Waiting for something else to be resolved label Jan 21, 2025
@JoshuaKGoldberg JoshuaKGoldberg removed the status: blocked Waiting for something else to be resolved label Jan 23, 2025
@JoshuaKGoldberg JoshuaKGoldberg requested review from michaelfaith and removed request for michaelfaith January 23, 2025 14:35
Copy link
Collaborator

@michaelfaith michaelfaith left a comment

Choose a reason for hiding this comment

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

Looks good. Nice to see the cleanup it allowed for.

yield fixer.remove(tokenFromCurrentLine);
}
},
fix:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice to be able also use this on the new rule too!

@JoshuaKGoldberg JoshuaKGoldberg merged commit 6a02598 into main Jan 23, 2025
14 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the eslint-fix-utils branch January 23, 2025 19:11
Copy link

🎉 This is included in version v0.21.1 🎉

The release is available on:

Cheers! 📦🚀

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

Successfully merging this pull request may close these issues.

🛠 Tooling: Extract element/property removal to a shared package
2 participants