Input
const App = () => {
return (
<O>
<I>
<x />
{f(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx).y} (
{label})
</I>
</O>
);
};
Config
Oxfmt output
const App = () => {
return (
<O>
<I>
<x />
{
f(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx).y
} (
{label})
</I>
</O>
);
};
Prettier output
const App = () => {
return (
<O>
<I>
<x />
{f(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx).y} (
{label})
</I>
</O>
);
};
Additional notes
The line {f(xxx...xxx).y} ( is exactly 79 characters at 8-space indent — fits within printWidth: 80. Prettier leaves it on a single line. oxfmt expands the JSX expression {f(xxx...).y} across three lines ({, content, } on separate lines), apparently treating the trailing ( literal text as part of the same group's measurement and deciding the combined sequence doesn't fit.
The <x /> self-closing element is necessary to set up the printer state that exposes the bug — it produces the hard line break preceding the trigger expression that resets the printer's "measured group fits" tracking, so the inner expression group ends up re-measuring itself and walking past the fill entry boundary into subsequent content.
Tested against oxfmt 0.47.0 and prettier 3.8.3.
Input
Config
{}Oxfmt output
Prettier output
Additional notes
The line
{f(xxx...xxx).y} (is exactly 79 characters at 8-space indent — fits withinprintWidth: 80. Prettier leaves it on a single line. oxfmt expands the JSX expression{f(xxx...).y}across three lines ({, content,}on separate lines), apparently treating the trailing(literal text as part of the same group's measurement and deciding the combined sequence doesn't fit.The
<x />self-closing element is necessary to set up the printer state that exposes the bug — it produces the hard line break preceding the trigger expression that resets the printer's "measured group fits" tracking, so the inner expression group ends up re-measuring itself and walking past the fill entry boundary into subsequent content.Tested against oxfmt 0.47.0 and prettier 3.8.3.