Skip to content

fix(oxfmt): Re-export all nested types#20636

Merged
graphite-app[bot] merged 1 commit intomainfrom
03-23-fix_oxfmt_re-export_all_nested_types
Mar 23, 2026
Merged

fix(oxfmt): Re-export all nested types#20636
graphite-app[bot] merged 1 commit intomainfrom
03-23-fix_oxfmt_re-export_all_nested_types

Conversation

@leaysgur
Copy link
Copy Markdown
Member

Fixes #20493, #20598, closes #20494

Copy link
Copy Markdown
Member Author

leaysgur commented Mar 23, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of 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.

@github-actions github-actions bot added A-cli Area - CLI A-formatter Area - Formatter C-bug Category - Bug labels Mar 23, 2026
@leaysgur leaysgur force-pushed the 03-23-fix_oxfmt_re-export_all_nested_types branch from 833b112 to bf8c22f Compare March 23, 2026 01:28
@leaysgur leaysgur added the 0-merge Merge with Graphite Merge Queue label Mar 23, 2026
@leaysgur leaysgur linked an issue Mar 23, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Member Author

leaysgur commented Mar 23, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the 03-23-fix_oxfmt_re-export_all_nested_types branch from bf8c22f to 828b56a Compare March 23, 2026 01:31
@graphite-app graphite-app bot merged commit 828b56a into main Mar 23, 2026
24 checks passed
@graphite-app graphite-app bot deleted the 03-23-fix_oxfmt_re-export_all_nested_types branch March 23, 2026 01:34
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 23, 2026
Dunqing added a commit that referenced this pull request Mar 23, 2026
…) (#20643)

I've found 6 more cases where prettier and oxfmt disagree on the
trailing comment - and with this PR/fix, our own code base is now also
formatted 100% the same

```
if (
  await fetchEntryByCompositeKey(source, primaryToken, previewTextValue, groupToken, rangeStartValue, rangeEndValue) // prettier-ignore
) {
}

function sectionsDemo() {
  const data = {
    primarySection: { id: 'primarySection', name: 'Primary Section', href: '/primary-section', icon: PrimarySectionIcon }, // prettier-ignore
  };
}

const conditionalTest =
  fetchEntryByCompositeKey(source, primaryToken, previewTextValue, groupToken, rangeStartValue, rangeEndValue) // prettier-ignore
    ? leftValue
    : rightValue;

const conditionalConsequent = condition
  ? fetchEntryByCompositeKey(source, primaryToken, previewTextValue, groupToken, rangeStartValue, rangeEndValue) // prettier-ignore
  : rightValue;

type UnionCase =
  | {a:1,b:2,c:3,d:4,e:5} // prettier-ignore
  | Other;

interface signatureLineCase {
  value: SomeVeryLongTypeName<FirstParam, SecondParam, ThirdParam, FourthParam> // prettier-ignore
  method(): SomeVeryLongTypeName<FirstParam, SecondParam, ThirdParam, FourthParam> // prettier-ignore
}
```


Playground link:


https://playground.oxc.rs/?t=formatter&options=%7B%22run%22%3A%7B%22lint%22%3Atrue%2C%22formatter%22%3Atrue%2C%22transform%22%3Afalse%2C%22isolatedDeclarations%22%3Afalse%2C%22whitespace%22%3Afalse%2C%22mangle%22%3Afalse%2C%22compress%22%3Afalse%2C%22scope%22%3Atrue%2C%22symbol%22%3Atrue%2C%22cfg%22%3Afalse%7D%2C%22parser%22%3A%7B%22extension%22%3A%22tsx%22%2C%22allowReturnOutsideFunction%22%3Atrue%2C%22preserveParens%22%3Atrue%2C%22allowV8Intrinsics%22%3Atrue%2C%22semanticErrors%22%3Atrue%7D%2C%22linter%22%3A%7B%7D%2C%22formatter%22%3A%7B%22useTabs%22%3Afalse%2C%22tabWidth%22%3A2%2C%22endOfLine%22%3A%22lf%22%2C%22printWidth%22%3A80%2C%22singleQuote%22%3Afalse%2C%22jsxSingleQuote%22%3Afalse%2C%22quoteProps%22%3A%22as-needed%22%2C%22trailingComma%22%3A%22all%22%2C%22semi%22%3Atrue%2C%22arrowParens%22%3A%22always%22%2C%22bracketSpacing%22%3Atrue%2C%22bracketSameLine%22%3Afalse%2C%22objectWrap%22%3A%22preserve%22%2C%22singleAttributePerLine%22%3Afalse%7D%2C%22transformer%22%3A%7B%22target%22%3A%22es2015%22%2C%22useDefineForClassFields%22%3Atrue%2C%22experimentalDecorators%22%3Atrue%2C%22emitDecoratorMetadata%22%3Atrue%7D%2C%22isolatedDeclarations%22%3A%7B%22stripInternal%22%3Afalse%7D%2C%22codegen%22%3A%7B%22normal%22%3Atrue%2C%22jsdoc%22%3Atrue%2C%22annotation%22%3Atrue%2C%22legal%22%3Atrue%7D%2C%22compress%22%3A%7B%7D%2C%22mangle%22%3A%7B%22topLevel%22%3Atrue%2C%22keepNames%22%3Afalse%7D%2C%22controlFlow%22%3A%7B%22verbose%22%3Afalse%7D%2C%22inject%22%3A%7B%22inject%22%3A%7B%7D%7D%2C%22define%22%3A%7B%22define%22%3A%7B%7D%7D%7D&code=if+%28%0A++await+fetchEntryByCompositeKey%28source%2C+primaryToken%2C+previewTextValue%2C+groupToken%2C+rangeStartValue%2C+rangeEndValue%29+%2F%2F+prettier-ignore%0A%29+%7B%0A%7D%0A%0Afunction+sectionsDemo%28%29+%7B%0A++const+data+%3D+%7B%0A++++primarySection%3A+%7B+id%3A+%27primarySection%27%2C+name%3A+%27Primary+Section%27%2C+href%3A+%27%2Fprimary-section%27%2C+icon%3A+PrimarySectionIcon+%7D%2C+%2F%2F+prettier-ignore%0A++%7D%3B%0A%7D%0A%0Aconst+conditionalTest+%3D%0A++fetchEntryByCompositeKey%28source%2C+primaryToken%2C+previewTextValue%2C+groupToken%2C+rangeStartValue%2C+rangeEndValue%29+%2F%2F+prettier-ignore%0A++++%3F+leftValue%0A++++%3A+rightValue%3B%0A%0Aconst+conditionalConsequent+%3D+condition%0A++%3F+fetchEntryByCompositeKey%28source%2C+primaryToken%2C+previewTextValue%2C+groupToken%2C+rangeStartValue%2C+rangeEndValue%29+%2F%2F+prettier-ignore%0A++%3A+rightValue%3B%0A%0Atype+UnionCase+%3D%0A++%7C+%7Ba%3A1%2Cb%3A2%2Cc%3A3%2Cd%3A4%2Ce%3A5%7D+%2F%2F+prettier-ignore%0A++%7C+Other%3B%0A%0Ainterface+signatureLineCase+%7B%0A++value%3A+SomeVeryLongTypeName%3CFirstParam%2C+SecondParam%2C+ThirdParam%2C+FourthParam%3E+%2F%2F+prettier-ignore%0A++method%28%29%3A+SomeVeryLongTypeName%3CFirstParam%2C+SecondParam%2C+ThirdParam%2C+FourthParam%3E+%2F%2F+prettier-ignore%0A%7D&formatterPanels=output%2Cprettier

---------

Co-authored-by: Dunqing <dengqing0821@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-formatter Area - Formatter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oxfmt: TS4082 "private name" errors Oxfmt Missing type exports cause TS4058 when re-exporting defineConfig

1 participant