2019-10-30 20:37:06 -07:00
|
|
|
// @ts-check
|
|
|
|
|
2015-03-14 23:47:34 -07:00
|
|
|
"use strict";
|
|
|
|
|
2018-04-27 22:05:34 -07:00
|
|
|
const markdownlint = require("../lib/markdownlint");
|
2015-03-14 23:47:34 -07:00
|
|
|
|
|
|
|
module.exports = function wrapper(grunt) {
|
|
|
|
grunt.initConfig({
|
|
|
|
"markdownlint": {
|
|
|
|
"example": {
|
|
|
|
"src": [ "*.md" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.registerMultiTask("markdownlint", function task() {
|
2018-04-27 22:05:34 -07:00
|
|
|
const done = this.async();
|
2015-03-14 23:47:34 -07:00
|
|
|
markdownlint(
|
|
|
|
{ "files": this.filesSrc },
|
|
|
|
function callback(err, result) {
|
2018-04-27 22:05:34 -07:00
|
|
|
const resultString = err || ((result || "").toString());
|
2015-03-14 23:47:34 -07:00
|
|
|
if (resultString) {
|
|
|
|
grunt.fail.warn("\n" + resultString + "\n");
|
|
|
|
}
|
|
|
|
done(!err || !resultString);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|