-
-
Notifications
You must be signed in to change notification settings - Fork 715
refactor(formatter/sort-imports): Pass options to is_ignored() #15181
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
refactor(formatter/sort-imports): Pass options to is_ignored() #15181
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.
Pull Request Overview
This PR refactors the import sorting logic to make it more extensible and clear. It renames the is_side_effect_import() method to is_ignored() to better represent imports that should be excluded from sorting (not just side-effect imports), and inverts the conditional logic for better readability.
- Renamed
is_side_effect_import()tois_ignored()to reflect broader ignore scenarios - Inverted the conditional logic in
sort_imports()for clearer separation of fixed vs sortable imports - Updated comments to clarify that "fixed" indices include any imports that should be ignored, not just side-effect imports
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #15181 will not alter performanceComparing Summary
Footnotes
|
Merge activity
|
33401c7 to
2db415b
Compare
2db415b to
7c571b6
Compare
7c571b6 to
85fb8e8
Compare
## [0.10.0] - 2025-11-04 ### 🚀 Features - 505252c formatter: Wrap parenthesis for AssignmentExpression that is a key of `PropertyDefinition` (#15243) (Dunqing) - 880b259 formatter: Align import-like formatting the same as Prettier (#15238) (Dunqing) - b77f254 oxfmt,formatter: Support `embeddedLanguageFormatting` option (#15216) (leaysgur) - 898d6fe oxfmt: Add embedded language formatting with Prettier integration (#14820) (Boshen) - e77a48e formatter: Detect code removal feature (#15059) (leaysgur) ### 🐛 Bug Fixes - daacf85 oxfmt: Release build fails (#15262) (Dunqing) - f5d0348 oxfmt: Sync `dependencies` with `npm/oxfmt` and `apps/oxfmt` (#15261) (leaysgur) - 46793d7 formatter: Correct printing comments for `LabeledStatement` (#15260) (Dunqing) - 831ae99 formatter: Multiple comments in `LogicalExpression` and `TSIntersectionType` (#15253) (Dunqing) - 5fa9b1e formatter: Should not indent `BinaryLikeExpression` when it is an argument of `Boolean` (#15250) (Dunqing) - 99e520f formatter: Handle chain expression for `JSXExpressionContainer` (#15242) (Dunqing) - a600bf5 formatter: Correct printing comments for `TaggedTemplateExpression` (#15241) (Dunqing) - a7289e7 formatter: Handle member chain for the call's parent is a chain expression (#15237) (Dunqing) ### 🚜 Refactor - 36ae721 formatter: Simplify the use of `indent` with `soft_line_break_or_space` (#15254) (Dunqing) - cdd8e2f formatter/sort-imports: Split sort_imports modules (#15189) (leaysgur) - 27b4f36 diagnostic: Remove `path` from sender (#15130) (camc314) - 85fb8e8 formatter/sort-imports: Pass options to is_ignored() (#15181) (leaysgur) ### 🧪 Testing - 9d5b34b formatter/sort-imports: Refactor sort_imports tests (#15188) (leaysgur) Co-authored-by: leaysgur <[email protected]>

A pure refactor.