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

@@ -1,3 +1,4 @@
/* eslint no-console:0 */
"use strict";
var fs = require("fs");
@@ -6,7 +7,7 @@ var childProcess = require("child_process");
var opts = require("nomnom")
.option("spacing", {
flag: true,
help: "Print mismatches involving spacing commands"
help: "Print mismatches involving spacing commands",
})
.parse();
@@ -15,7 +16,7 @@ var keys = Object.keys(symbols.math);
keys.sort();
var types = [
"mathord", "op", "bin", "rel", "open", "close", "punct", "inner",
"spacing", "accent", "textord"
"spacing", "accent", "textord",
];
process.nextTick(writeTexFile);
@@ -94,7 +95,8 @@ function evaluate(err, log) {
throw err;
}
var match, nextIndex = 0;
var match;
var nextIndex = 0;
while ((match = reMM.exec(log)) !== null) {
var list = match[1];
match = reParts.exec(list);
@@ -143,7 +145,8 @@ function evaluate(err, log) {
}
function extractDigits(str) {
var match, res = "";
var match;
var res = "";
while ((match = reDigit.exec(str)) !== null) {
res += match[1];
}