Skip to content

Instantly share code, notes, and snippets.

@shmidt-i
Created April 20, 2018 11:30
Show Gist options
  • Save shmidt-i/b477dc167fb0985c3546268a62f11b53 to your computer and use it in GitHub Desktop.
Save shmidt-i/b477dc167fb0985c3546268a62f11b53 to your computer and use it in GitHub Desktop.
Eslint fix formatting object expression in ternary expression
//Eslint thinks that its wrong:
errorOrMessage instanceof Error
? {
error: errorOrMessage,
meta,
}
: {
error: new Error(errorOrMessage),
meta,
};
// But prettier do so!
// Configure eslint:
// "indent": ["error", 2, { "SwitchCase": 1, "ignoredNodes": ["ConditionalExpression > ObjectExpression"] }],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment