flowts
flowts copied to clipboard
It reformats this for no reason
Input:
// @flow
const f = x => ({a: 'a', b: 'b'}[x]);
Output:
const f = (x) =>
({
a: 'a',
b: 'b',
}[x]);
With --no-prettier:
const f = x => ({
a: 'a',
b: 'b'
})[x];
It could have left that line alone.
I suspect the issue is that recast reformats the code, and then prettier preserves the formatting. Will look into but likely there is no easy fix…
The question though is why does recast bother changing the code? The AST is identical, isn't it?