You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But if the input looks like this, the output with recast is the same as above:
// @flow
({
a,
b: <></>,
c,
});
before/after object literal property
Input:
// @flow
({
a,
b: {
c,
},
c,
})
Output with recast:
({
a,
b: {
c,
},
c
});
Output with --no-recast:
({
a,
b: {
c
},
c
});
But if the input looks like this:
// @flow
({
a,
b: {c},
c,
})
Then the output with recast looks like this:
({
a,
b: {c},
c
});
While the output with --no-recast continues to look like this:
({
a,
b: {
c
},
c
});
before/after comment
Input:
// @flow
({
a,
// comment
b,
c,
});
Output with recast:
({
a,
// comment
b,
c
});
Output with --no-recast:
({
a,
// comment
b,
c
});
If the input is:
// @flow
({
a,
b, // comment
c,
})
Then the output with recast is still:
({
a,
// comment
b,
c
});
Though the output with --no-recast is different:
({
a,
b,
// comment
c
});
before/after interesting indentation
Input:
// @flow
({
a,
b:
x,
c,
});
Output with recast:
({
a,
b:
x,
c
});
Output without recast:
({
a,
b: x,
c
});
But if the input is:
// @flow
({
a,
b: x,
c,
});
Then the output with and without recast is the same:
({
a,
b: x,
c
});
It seems like the rule is that if a property takes more than one line, including just because it has a comment, recast will reserve two extra lines for it.
This also triggers the problem:
// @flow
({
a,
b: [
],
c,
});
But this doesn't:
// @flow
({
a,
b: [],
c,
});
The text was updated successfully, but these errors were encountered:
Commands run with
--no-prettier
before/after JSX property
Input:
Output with recast:
Output with
--no-recast
But if the input looks like this, the output with recast is the same as above:
before/after object literal property
Input:
Output with recast:
Output with
--no-recast
:But if the input looks like this:
Then the output with recast looks like this:
While the output with
--no-recast
continues to look like this:before/after comment
Input:
Output with recast:
Output with
--no-recast
:If the input is:
Then the output with recast is still:
Though the output with
--no-recast
is different:before/after interesting indentation
Input:
Output with recast:
Output without recast:
But if the input is:
Then the output with and without recast is the same:
It seems like the rule is that if a property takes more than one line, including just because it has a comment, recast will reserve two extra lines for it.
This also triggers the problem:
But this doesn't:
The text was updated successfully, but these errors were encountered: