fix: resolve #464 — Removing TSPropertySignature node adds commas to the type declaration#699
Conversation
…mmas to the type declaration Fixes facebook#464 Signed-off-by: ed-thuando <231172918+ed-thuando@users.noreply.github.com>
…mmas to the type declaration Fixes facebook#464 Signed-off-by: ed-thuando <231172918+ed-thuando@users.noreply.github.com>
|
@ed-thuando is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
|
|
Hi @ed-thuando! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Summary
fix: resolve #464 — Removing TSPropertySignature node adds commas to the type declaration
Problem
Severity:
Medium| File:src/core.jsNeed to examine how the printer handles TypeScript TSTypeLiteral members. When TSPropertySignature nodes are removed, the separator handling appears to be incorrect - both the trailing separator of the removed node and the leading separator of the next node are being printed.
Solution
Look at printer configuration in src/core.js. The issue is likely that TypeScript type members (TSTypeLiteral.properties) need the same separator handling fix that Flow's ObjectTypeProperty has. Check how the printer's trailingSeparator and leadingSeparator options are configured for TSPropertySignature nodes.
Changes
src/core.js(modified)parser/ts.js(modified)Testing
Generated by ContribAI v6.0.0