Style: Disallow else if in no-else-return (#10310)

This commit is contained in:
fisker Cheung authored and GitHub committed 2021-02-15 05:29:58 +02:00
1 parent 7e8f746a4e
commit c3d08c943e
7 files changed
+65 -20

No files matched your search

+13 -4
View File
@@ -17,7 +17,9 @@ function flattenDoc(doc) {
}
return { type: "concat", parts: res };
} else if (doc.type === "if-break") {
}
if (doc.type === "if-break") {
return {
...doc,
breakContents:
@@ -25,7 +27,9 @@ function flattenDoc(doc) {
flatContents:
doc.flatContents != null ? flattenDoc(doc.flatContents) : null,
};
} else if (doc.type === "group") {
}
if (doc.type === "group") {
return {
...doc,
contents: flattenDoc(doc.contents),
@@ -33,11 +37,16 @@ function flattenDoc(doc) {
? doc.expandedStates.map(flattenDoc)
: doc.expandedStates,
};
} else if (doc.type === "fill") {
}
if (doc.type === "fill") {
return { type: "fill", parts: doc.parts.map(flattenDoc) };
} else if (doc.contents) {
}
if (doc.contents) {
return { ...doc, contents: flattenDoc(doc.contents) };
}
return doc;
}