mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 11:18:39 +00:00
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:
@@ -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];
|
||||
}
|
||||
|
Reference in New Issue
Block a user