Migrate to eslint

Summary
We'd like contributors to use the same linter and lint rules that we use
internally.  This diff swaps out eslint for jshint and fixes all lint failures
except for the max-len failures in the test suites.

Test Plan:
- ka-lint src
- make lint
- make test

Reviewers: emily
This commit is contained in:
Kevin Barabash
2015-11-30 20:52:22 -08:00
parent 1a082e81d9
commit 14a58adb90
34 changed files with 2271 additions and 2206 deletions

View File

@@ -19,13 +19,13 @@ beforeEach(function() {
parseTree(actual, defaultSettings);
return {
pass: false,
message: "'" + actual + "' parsed without error"
message: "'" + actual + "' parsed without error",
};
} catch (e) {
if (expected === undefined) {
return {
pass: true,
message: "'" + actual + "' parsed with error"
message: "'" + actual + "' parsed with error",
};
}
var msg = e.message;
@@ -34,27 +34,27 @@ beforeEach(function() {
return {
pass: true,
message: "'" + actual + "'" +
" parsed with error '" + expected + "'"
" parsed with error '" + expected + "'",
};
} else if (msg.slice(0, 19) === prefix) {
return {
pass: false,
message: "'" + actual + "'" +
" parsed with error '" + msg.slice(19) +
"' but expected '" + expected + "'"
"' but expected '" + expected + "'",
};
} else {
return {
pass: false,
message: "'" + actual + "'" +
" caused error '" + msg +
"' but expected '" + exp + "'"
"' but expected '" + exp + "'",
};
}
}
}
},
};
}
},
});
});
@@ -265,7 +265,7 @@ describe("environments.js:", function() {
});
it("rejects incorrectly scoped \\end", function() {
expect("{\\begin{matrix}1}\\end{matrix}").toFailWithParseError(
"Expected & or \\\\\ or \\end at position 17:" +
"Expected & or \\\\\ or \\end at position 17:" +
" begin{matrix}1}̲\\end{matrix}");
});
});