fix(estree): Ensure the same key order for AssignmentPattern#10953
Merged
overlookmotel merged 1 commit intomainfrom May 12, 2025
Merged
fix(estree): Ensure the same key order for AssignmentPattern#10953overlookmotel merged 1 commit intomainfrom
AssignmentPattern#10953overlookmotel merged 1 commit intomainfrom
Conversation
Contributor
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. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR standardizes the key ordering in various AST node serializers to ensure consistency across the codebase.
- Reorders fields in BindingRestElement, FormalParametersRest, ArrowFunctionExpressionBody, and AssignmentTargetPropertyIdentifierValue to align with the expected key order.
- Addresses minor field order discrepancies in TypeScript-specific serialization sections.
Comments suppressed due to low confidence (4)
crates/oxc_ast/src/serialize.rs:613
- [nitpick] The field order is updated here to place 'decorators' before 'optional' for BindingRestElement. Please verify that this ordering is consistent with the established AST node schema.
decorators: [],
crates/oxc_ast/src/serialize.rs:653
- [nitpick] The reordering of 'optional' and 'typeAnnotation' fields in FormalParametersRest now aligns with other nodes. Ensure that this change is reflected in the corresponding documentation or tests.
state.serialize_ts_field("optional", &rest.argument.optional);
crates/oxc_ast/src/serialize.rs:885
- [nitpick] In ArrowFunctionExpressionBody, swapping the order of 'optional' and 'typeAnnotation' matches the desired key order. Confirm that this update does not affect any downstream consumers.
optional: false,
crates/oxc_ast/src/serialize.rs:906
- [nitpick] For AssignmentTargetPropertyIdentifierValue, the new ordering between 'optional' and 'typeAnnotation' improves uniformity. It is recommended to double-check that this ordering change is aligned with the overall AST serialization standards.
state.serialize_ts_field("optional", &False(()));
CodSpeed Instrumentation Performance ReportMerging #10953 will not alter performanceComparing Summary
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #9705
With this PR, all AST nodes now have a consistent key order for each node type.
(Checked by https://github.com/leaysgur/oxc_estree_ts-ast-diff-viewer/blob/main/scripts/verify-key-order-oxc.js)
Except for:
Literal:regexandbigintkeysTSModuleDeclaration:bodykey is missing whendeclare module "jq";