-
-
Notifications
You must be signed in to change notification settings - Fork 722
feat(napi/parser): preserveParens option for raw transfer
#13855
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
feat(napi/parser): preserveParens option for raw transfer
#13855
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. |
CodSpeed Instrumentation Performance ReportMerging #13855 will not alter performanceComparing Summary
Footnotes |
ec45f78 to
b478cc2
Compare
38e0b2e to
42b1000
Compare
b478cc2 to
469dafa
Compare
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 adds a preserveParens option to raw transfer deserialize functions to control whether ParenthesizedExpression nodes are included in the generated AST. This change prepares the codebase for use in oxlint where the option is needed to align with ESLint and TS-ESLint behavior.
- Adds
preserveParensparameter to deserialize functions in the raw transfer generator - Updates deserialize function calls to pass
trueforpreserveParensto maintain current behavior - Implements custom converter for
ParenthesizedExpressionthat conditionally creates nodes based on thepreserveParensflag
Reviewed Changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tasks/ast_tools/src/generators/raw_transfer.rs | Adds preserveParens parameter to generated deserialize function template |
| napi/parser/raw-transfer/eager.mjs | Updates deserialize calls to pass preserveParens: true with explanatory comments |
| napi/parser/bench.bench.mjs | Updates benchmark deserialize call to include new preserveParens parameter |
| crates/oxc_ast/src/serialize/js.rs | Implements custom ParenthesizedExpressionConverter with conditional node creation |
| crates/oxc_ast/src/ast/js.rs | Configures ParenthesizedExpression to use the new converter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Merge activity
|
Partial fix for #13851. Add a `preserveParens` argument to raw transfer `deserialize` functions. This is not useful in `oxc-parser`, but these generated files will be duplicated in `oxlint`, where this option is required to remove `ParenthesizedExpression`s from AST, to align with ESLint and TS-ESLint.
469dafa to
d042710
Compare
d042710 to
e1a1b6b
Compare
Partial fix for #13851. Add a `preserveParens` argument to raw transfer `deserialize` functions. This is not useful in `oxc-parser`, but these generated files will be duplicated in `oxlint`, where this option is required to remove `ParenthesizedExpression`s from AST, to align with ESLint and TS-ESLint.
e1a1b6b to
24a21b3
Compare
…renthesizedType` (#13964) Partial fix for #13851. Raw transfer `preserveParens` option remove `TSParenthesizedType`s from AST, same as #13855 removed `ParenthesizedExpression`s. This is not used in `oxc-parser`, but the raw transfer `preserveParens` option is required in `oxlint` JS plugins, to align with TS-ESLint, which has no `TSParenthesizedType`s in its AST.

Partial fix for #13851.
Add a
preserveParensargument to raw transferdeserializefunctions. This is not useful inoxc-parser, but these generated files will be duplicated inoxlint, where this option is required to removeParenthesizedExpressions from AST, to align with ESLint and TS-ESLint.