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

5
cli.js
View File

@@ -1,6 +1,7 @@
#!/usr/bin/env node
// Simple CLI for KaTeX.
// Reads TeX from stdin, outputs HTML to stdout.
/* eslint no-console:0 */
var katex = require("./");
var input = "";
@@ -8,7 +9,7 @@ var input = "";
// Skip the first two args, which are just "node" and "cli.js"
var args = process.argv.slice(2);
if (args.indexOf("--help") != -1) {
if (args.indexOf("--help") !== -1) {
console.log(process.argv[0] + " " + process.argv[1] +
" [ --help ]" +
" [ --display-mode ]");
@@ -25,7 +26,7 @@ process.stdin.on("data", function(chunk) {
});
process.stdin.on("end", function() {
var options = { displayMode: args.indexOf("--display-mode") != -1 };
var options = { displayMode: args.indexOf("--display-mode") !== -1 };
var output = katex.renderToString(input, options);
console.log(output);
});