Skip to content

Commit

Permalink
fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
peey committed May 19, 2017
1 parent e51cf9f commit e1eec6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/babel-traverse/src/path/parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export function inlineParameters() {
fnBodyVarBindingSymbols = unique(fnBodyVarBindingSymbols);
const commonSymbols = intersection(fnBodyVarBindingSymbols, parameterBindings);

if (!paramsContainAFunction && commonSymbols.length == 0) {
this.get("body").unshiftContainer("body", parameterDeclaration)
if (!paramsContainAFunction && commonSymbols.length == 0) {
this.get("body").unshiftContainer("body", parameterDeclaration);
} else { // put body in a block

// first convert existing declarations to assignments where applicable
Expand Down Expand Up @@ -129,4 +129,4 @@ export function inlineParameters() {

this.get("body").pushContainer("body", bodyClone);
}
};
}
10 changes: 5 additions & 5 deletions packages/babel-traverse/test/family.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ describe("path/family", function () {
});

it("should return child of given type", function () {
assert.notEqual(path.findChild('Identifier').node.name, null);
assert.equal(path.findChild('Identifier', (x) => x.node.name == 'b').node.name, 'b');
assert.notEqual(path.findChild("Identifier").node.name, null);
assert.equal(path.findChild("Identifier", (x) => x.node.name == "b").node.name, "b");
});

it("should return null if the child could not be found", function () {
assert.equal(path.findChild('ArrayExpression'), null);
assert.equal(path.findChild('Identifier', (x) => x.node.name == 'x'), null);
assert.equal(path.findChild("ArrayExpression"), null);
assert.equal(path.findChild("Identifier", (x) => x.node.name == "x"), null);
});

it("should not match itself", function () {
assert.equal(path.findChild('Function'), null);
assert.equal(path.findChild("Function"), null);
});
});
});
Expand Down

0 comments on commit e1eec6d

Please sign in to comment.