eslint-plugin-package-json icon indicating copy to clipboard operation
eslint-plugin-package-json copied to clipboard

feat(sort-collections): support nested properties

Open andreww2012 opened this issue 6 months ago • 4 comments

PR Checklist

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.

andreww2012 avatar May 17 '25 10:05 andreww2012

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.

codecov[bot] avatar May 17 '25 19:05 codecov[bot]

@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).

screenshot of failed build

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.

michaelfaith avatar May 17 '25 20:05 michaelfaith

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.

andreww2012 avatar May 18 '25 07:05 andreww2012

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

JoshuaKGoldberg avatar May 19 '25 16:05 JoshuaKGoldberg

The workflow permissions are still borked for some reason. I have no visibility to this, since it's in the repo settings.

screenshot

michaelfaith avatar Jun 15 '25 01:06 michaelfaith

😩 what an annoying issue. I'll go ahead and merge #1051 now so we can at least get better reporting of the complaints.

JoshuaKGoldberg avatar Jun 16 '25 12:06 JoshuaKGoldberg

@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! 💙

JoshuaKGoldberg avatar Jun 16 '25 17:06 JoshuaKGoldberg

@JoshuaKGoldberg

I've put up a pull request to add @andreww2012! :tada:

allcontributors[bot] avatar Jun 16 '25 17:06 allcontributors[bot]

:tada: This is included in version v0.40.0 :tada:

The release is available on:

Cheers! 📦🚀

github-actions[bot] avatar Jun 16 '25 18:06 github-actions[bot]