dprint-plugin-typescript
dprint-plugin-typescript copied to clipboard
Line breaks occur in strange places.
Describe the bug
dprint-plugin-typescript version: 0.83.0
Input Code
a(() => {
const b = c(d =>
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
).e;
const f = (
<>
<Component
callback={() => z()}
/>
<Component
callback={() => z()}
/>
</>
);
});
Expected Output
Same as input code.
Actual Output
a(() => {
const b = c(d =>
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
).e;
const f = (
<>
<Component
callback={() =>
z()}
/>
<Component
callback={() => z()}
/>
</>
);
});
The arrow function in the first Component wraps, but second is not.
It does not occur in the following cases.
- Change
a(() => {})toconst a = () => {}.const a = () => { const b = c(d => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ).e; const f = ( <> <Component callback={() => z()} /> <Component callback={() => z()} /> </> ); }; - Remove variable
ba(() => { const f = ( <> <Component callback={() => z()} /> <Component callback={() => z()} /> </> ); }); - Remove
.eproperty accessa(() => { const b = c(d => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ); const f = ( <> <Component callback={() => z()} /> <Component callback={() => z()} /> </> ); });