-
-
Notifications
You must be signed in to change notification settings - Fork 29
feat(pkg): add option packageIgnoreSort #472
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
Conversation
🦋 Changeset detectedLatest commit: 29f75b1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughA new plugin option, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Prettier
participant Plugin as prettier-plugin-pkg
User->>Prettier: Format package.json with packageIgnoreSort option
Prettier->>Plugin: Call format() with options
Plugin->>Plugin: Filter out properties in packageIgnoreSort
Plugin->>Plugin: Sort remaining properties
Plugin-->>Prettier: Return formatted result
Prettier-->>User: Output formatted package.json
Assessment against linked issues
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/pkg/src/index.tsOops! Something went wrong! :( ESLint: 9.28.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@1stg/eslint-config' imported from /eslint.config.js 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
prettier-plugin-autocorrect
prettier-plugin-pkg
prettier-plugin-sh
prettier-plugin-sql
prettier-plugin-toml
commit: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #472 +/- ##
==========================================
+ Coverage 85.41% 85.78% +0.37%
==========================================
Files 10 10
Lines 192 197 +5
Branches 52 55 +3
==========================================
+ Hits 164 169 +5
Misses 27 27
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed everything up to fb938a5 in 58 seconds. Click for details.
- Reviewed
156
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
5
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .changeset/full-frogs-join.md:5
- Draft comment:
Changeset message is clear and follows conventions. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
2. packages/pkg/src/index.ts:30
- Draft comment:
Passing 'options' into the 'object' function ensures the new packageIgnoreSort setting is carried through. This design is clear. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
3. packages/pkg/src/index.ts:65
- Draft comment:
New 'packageIgnoreSort' option is defined similarly to 'packageSortOrder'. Confirm that its default value structure (i.e. [{ value: [] }]) meets the expected type (string[]) in FormatOptions. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
4. packages/pkg/src/rules/object.ts:18
- Draft comment:
The check using 'options.packageIgnoreSort?.includes(key)' cleanly skips sorting for properties in the ignore list. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
5. packages/pkg/test/ignore-sort.spec.ts:13
- Draft comment:
The test effectively verifies that properties specified in 'packageIgnoreSort' (e.g. 'resolutions') remain unsorted. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
Workflow ID: wflow_Vs4kA2mFt2Q3p150
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
|
closes #466
Important
Add
packageIgnoreSort
option toprettier-plugin-pkg
to ignore sorting specifiedpackage.json
properties.packageIgnoreSort
option inindex.ts
to specify properties inpackage.json
to ignore during sorting.process()
inobject.ts
to skip sorting for keys inpackageIgnoreSort
.packageIgnoreSort
toFormatOptions
intypes.ts
.ignore-sort.spec.ts
to testpackageIgnoreSort
functionality with a snapshot test.This description was created by
for fb938a5. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit