Align boolean inside of arrow functions (#691)
We already do it for if/... but it looks weird for arrow function body.master
parent
b93a207bb2
commit
00e5014e00
|
@ -186,11 +186,12 @@ function genericPrintNoParens(path, options, print) {
|
|||
// Avoid indenting sub-expressions in if/etc statements.
|
||||
if (
|
||||
shouldInlineLogicalExpression(n) ||
|
||||
n !== parent.body &&
|
||||
(parent.type === "IfStatement" ||
|
||||
parent.type === "WhileStatement" ||
|
||||
parent.type === "DoStatement" ||
|
||||
parent.type === "ForStatement") &&
|
||||
n !== parent.body
|
||||
parent.type === "ForStatement") ||
|
||||
n === parent.body && parent.type === "ArrowFunctionExpression"
|
||||
) {
|
||||
return group(concat(parts));
|
||||
}
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
exports[`test arrow.js 1`] = `
|
||||
"function f() {
|
||||
const appEntitys = getAppEntitys(loadObject).filter(
|
||||
entity => entity && entity.isInstallAvailable() && !entity.isQueue() && entity.isDisabled()
|
||||
)
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
function f() {
|
||||
const appEntitys = getAppEntitys(loadObject).filter(
|
||||
entity =>
|
||||
entity &&
|
||||
entity.isInstallAvailable() &&
|
||||
!entity.isQueue() &&
|
||||
entity.isDisabled()
|
||||
);
|
||||
}
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`test inline-object-array.js 1`] = `
|
||||
"prevState = prevState || {
|
||||
catalogs: [],
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
function f() {
|
||||
const appEntitys = getAppEntitys(loadObject).filter(
|
||||
entity => entity && entity.isInstallAvailable() && !entity.isQueue() && entity.isDisabled()
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue