Re-enable the max-len ESLint rule. (#5265)

This commit is contained in:
Logan Smyth
2017-02-04 08:07:15 -08:00
committed by Henry Zhu
parent 4d411ef83e
commit b845f2b69d
63 changed files with 317 additions and 223 deletions

View File

@@ -17,22 +17,29 @@ function getPath(code) {
describe("scope", function () {
describe("binding paths", function () {
it("function declaration id", function () {
assert.ok(getPath("function foo() {}").scope.getBinding("foo").path.type === "FunctionDeclaration");
assert.ok(getPath("function foo() {}")
.scope.getBinding("foo").path.type === "FunctionDeclaration");
});
it("function expression id", function () {
assert.ok(getPath("(function foo() {})").get("body")[0].get("expression").scope.getBinding("foo").path.type === "FunctionExpression");
assert.ok(getPath("(function foo() {})").get("body")[0].get("expression")
.scope.getBinding("foo").path.type === "FunctionExpression");
});
it("function param", function () {
assert.ok(getPath("(function (foo) {})").get("body")[0].get("expression").scope.getBinding("foo").path.type === "Identifier");
assert.ok(getPath("(function (foo) {})").get("body")[0].get("expression")
.scope.getBinding("foo").path.type === "Identifier");
});
it("variable declaration", function () {
assert.ok(getPath("var foo = null;").scope.getBinding("foo").path.type === "VariableDeclarator");
assert.ok(getPath("var { foo } = null;").scope.getBinding("foo").path.type === "VariableDeclarator");
assert.ok(getPath("var [ foo ] = null;").scope.getBinding("foo").path.type === "VariableDeclarator");
assert.ok(getPath("var { bar: [ foo ] } = null;").scope.getBinding("foo").path.type === "VariableDeclarator");
assert.ok(getPath("var foo = null;")
.scope.getBinding("foo").path.type === "VariableDeclarator");
assert.ok(getPath("var { foo } = null;")
.scope.getBinding("foo").path.type === "VariableDeclarator");
assert.ok(getPath("var [ foo ] = null;")
.scope.getBinding("foo").path.type === "VariableDeclarator");
assert.ok(getPath("var { bar: [ foo ] } = null;")
.scope.getBinding("foo").path.type === "VariableDeclarator");
});
it("purity", function () {