eslint-plugin-package-json
eslint-plugin-package-json copied to clipboard
feat(sort-collections): support nested properties
PR Checklist
- [x] Addresses an existing open issue: fixes #1093
- [x] That issue was marked as
status: accepting prs - [x] Steps in CONTRIBUTING.md were taken
Overview
Hello! This PR adds the ability for sort-collections rule to accept a nested property using a dot notation. This can be useful for nested properties ordering, such as pnpm.patchedDependencies.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.68%. Comparing base (
fa2e195) to head (eef3c84). Report is 4 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #1048 +/- ##
=======================================
Coverage 99.68% 99.68%
=======================================
Files 22 22
Lines 1564 1588 +24
Branches 205 213 +8
=======================================
+ Hits 1559 1583 +24
Misses 5 5
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@JoshuaKGoldberg It looks like the compliance portion of the build is still failing when I "allows" the workflow to run. It says resource not accessible by integration. (it also incorrectly flagged the pr title, though that could be because it's not able to get the information).
Edit: I guess this is related to this https://github.com/mtfoley/pr-compliance-action/issues/368 and https://github.com/JoshuaKGoldberg/create-typescript-app/issues/457. So, something with the workflow permissions isn't working right.
Thank you for the review! I've decided to add quite a few new collections to sort by default, all of which expect keys being package names.
Added a couple of new tests as per your request and to cover the case of sorting a collection of the 3rd level.
workflow permissions
Yeah, in theory the compliance bot workflow could be fixed to work. But also I've switched a bunch of repos over to https://github.com/JoshuaKGoldberg/OctoGuide that has this issue about forks fixed (and redundant reporting just in case). Filed: https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1050
The workflow permissions are still borked for some reason. I have no visibility to this, since it's in the repo settings.
😩 what an annoying issue. I'll go ahead and merge #1051 now so we can at least get better reporting of the complaints.
@all-contributors please add @andreww2012 for code.
🤖 Beep boop! This comment was added automatically by all-contributors-auto-action. Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed. ...and of course, thank you for contributing! 💙