Input
const doc = md`
${
(
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- reason
<div style={{ marginTop: token('space.100') }}>
<Child />
</div>
)
}
`;
Oxfmt output
Oxfmt version: latest (0.47.0)
const doc = md`
${
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- reason
(
<div style={{ marginTop: token("space.100") }}>
<Child />
</div>
)
}
`;
Oxfmt playground link
oxfmt playground
Prettier output
Prettier version: 3.8.3
const doc = md`
${
(
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- reason
<div style={{ marginTop: token("space.100") }}>
<Child />
</div>
)
}
`;
Prettier playground link
prettier playground
Additional notes
oxfmt moves the eslint-disable-next-line comment out of a parenthesized JSX expression inside a template interpolation.
This is behaviour-changing because eslint-disable-next-line is line-sensitive. After formatting, the directive applies to the line containing ( instead of the JSX element line it was intended to suppress.
Input
Oxfmt output
Oxfmt version:
latest(0.47.0)Oxfmt playground link
oxfmt playground
Prettier output
Prettier version:
3.8.3Prettier playground link
prettier playground
Additional notes
oxfmtmoves theeslint-disable-next-linecomment out of a parenthesized JSX expression inside a template interpolation.This is behaviour-changing because
eslint-disable-next-lineis line-sensitive. After formatting, the directive applies to the line containing(instead of the JSX element line it was intended to suppress.