Run prettier

This commit is contained in:
Brian Ng
2017-06-27 12:15:00 -05:00
parent 93cc22dae1
commit e4b35f680d
307 changed files with 6742 additions and 4080 deletions

View File

@@ -1,6 +1,6 @@
import syntaxFunctionBind from "babel-plugin-syntax-function-bind";
export default function ({ types: t }) {
export default function({ types: t }) {
function getTempId(scope) {
let id = scope.path.getData("functionBind");
if (id) return id;
@@ -25,7 +25,11 @@ export default function ({ types: t }) {
bind.callee,
]);
} else {
bind.callee.object = t.assignmentExpression("=", tempId, bind.callee.object);
bind.callee.object = t.assignmentExpression(
"=",
tempId,
bind.callee.object,
);
}
return tempId;
}
@@ -46,7 +50,12 @@ export default function ({ types: t }) {
BindExpression(path) {
const { node, scope } = path;
const context = inferBindContext(node, scope);
path.replaceWith(t.callExpression(t.memberExpression(node.callee, t.identifier("bind")), [context]));
path.replaceWith(
t.callExpression(
t.memberExpression(node.callee, t.identifier("bind")),
[context],
),
);
},
},
};