Hook up ESLint, fix warnings (including conversion to async I/O).

This commit is contained in:
David Anson 2015-02-24 18:40:37 -08:00
parent d16e1cafc1
commit 160146ac3a
5 changed files with 230 additions and 41 deletions

View file

@ -3,20 +3,20 @@
function padAndTrim(lines) {
return [].concat(
"",
lines.map(function(line) {
lines.map(function mapLine(line) {
return line.trim();
}),
"");
}
module.exports = {
MD031: function(lines) {
"MD031": function MD031(lines) {
// Some parsers have trouble detecting fenced code blocks without
// surrounding whitespace, so examine the lines directly.
lines = padAndTrim(lines);
var errors = [];
var inCode = false;
lines.forEach(function(line, lineNum) {
lines.forEach(function forLine(line, lineNum) {
if (line.match(/^(```|~~~)/)) {
inCode = !inCode;
if ((inCode && lines[lineNum - 1].length) ||