Replies: 1 comment
-
There is no such option, see #350 and #1622 for context. You can add Prettier 3.2.5 --parser babel Input: // prettier-ignore
const myObject = {
short: "value1",
longerName: "value2",
evenLongerName: "value3" ,
};
const myOtherObject = {
short: "value1",
longerName: "value2",
evenLongerName: "value3" ,
}; Output: // prettier-ignore
const myObject = {
short: "value1",
longerName: "value2",
evenLongerName: "value3" ,
};
const myOtherObject = {
short: "value1",
longerName: "value2",
evenLongerName: "value3",
}; Note that Aligned values look neat in a ’static’ code snapshot, but they don’t play nice in an evolving codebase. Imagine we want to add const myObject = {
- short: "value1",
- longerName: "value2",
- evenLongerName: "value3",
+ short: "value1",
+ longerName: "value2",
+ evenLongerName: "value3",
+ evenMuchLongerName: "value4",
}; The above diff is harder to review compared to: const myOtherObject = {
short: "value1",
longerName: "value2",
evenLongerName: "value3",
+ evenMuchLongerName: "value4",
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Like this:
Beta Was this translation helpful? Give feedback.
All reactions