Fix prettier on all files

This commit is contained in:
2019-08-03 20:40:07 +05:30
parent feee690b48
commit 67206dfe41
24 changed files with 164 additions and 144 deletions
+8 -2
View File
@@ -48,7 +48,10 @@ function findNodeByComponent(
}
}
{
const returnVal = findNodeByComponent(node.sibling, expectedClassOrFunction);
const returnVal = findNodeByComponent(
node.sibling,
expectedClassOrFunction
);
if (returnVal !== null) {
return returnVal;
}
@@ -76,7 +79,10 @@ function findNodeByComponentRef(
}
}
{
const returnVal = findNodeByComponentRef(node.sibling, expectedClassInstance);
const returnVal = findNodeByComponentRef(
node.sibling,
expectedClassInstance
);
if (returnVal !== null) {
return returnVal;
}
+8 -2
View File
@@ -1,6 +1,10 @@
import * as React from "react";
export type FiberNode = FiberNodeForComponentClass | FiberNodeForFunctionComponent | FiberNodeForInstrinsicElement | FiberNodeForTextNode;
export type FiberNode =
| FiberNodeForComponentClass
| FiberNodeForFunctionComponent
| FiberNodeForInstrinsicElement
| FiberNodeForTextNode;
export interface FiberNodeForFunctionComponent {
child: FiberNode | null;
@@ -52,4 +56,6 @@ export interface FiberNodeForTextNode {
stateNode: Text;
}
export type FiberNodeisHTMLLike = FiberNodeForInstrinsicElement | FiberNodeForTextNode;
export type FiberNodeisHTMLLike =
| FiberNodeForInstrinsicElement
| FiberNodeForTextNode;
+4 -2
View File
@@ -16,7 +16,7 @@ function* traverseGenerator(
node: FiberNode,
{
order = ["self", "child", "sibling"]
}: { order?: Array<"self"|"child"|"sibling"> } = {}
}: { order?: Array<"self" | "child" | "sibling"> } = {}
): IterableIterator<FiberNode> {
let skipChild = false,
skipSibling = false;
@@ -52,7 +52,9 @@ function* traverseGenerator(
};
// For each item mentioned in order, find generator functions to run
const orderedGenerators = order.map((step) => traverseMap[step]).filter(tmp => tmp!==undefined);
const orderedGenerators = order
.map(step => traverseMap[step])
.filter(tmp => tmp !== undefined);
// Now run each generator till end
for (const eachGen of orderedGenerators) {
+3 -1
View File
@@ -28,7 +28,9 @@ function isNodeComponentClass(
return isNodeNotHtmlLike(node) && node.stateNode instanceof React.Component;
}
function isConstructorHtmlLike(ctr: React.ElementType): ctr is Exclude<React.ElementType, React.ComponentType> {
function isConstructorHtmlLike(
ctr: React.ElementType
): ctr is Exclude<React.ElementType, React.ComponentType> {
if (typeof ctr === "string" || ctr === null) {
return true;
}