mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +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:
@@ -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}");
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user