mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
28 lines
661 B
JavaScript
28 lines
661 B
JavaScript
// @ts-check
|
|
|
|
"use strict";
|
|
|
|
module.exports = function wrapper(grunt) {
|
|
grunt.initConfig({
|
|
"markdownlint": {
|
|
"example": {
|
|
"src": [ "*.md" ]
|
|
}
|
|
}
|
|
});
|
|
|
|
grunt.registerMultiTask("markdownlint", function task() {
|
|
const done = this.async();
|
|
import("markdownlint/async").then(({ lint }) => {
|
|
lint(
|
|
{ "files": this.filesSrc },
|
|
function callback(err, result) {
|
|
const resultString = err || ((result || "").toString());
|
|
if (resultString) {
|
|
grunt.fail.warn("\n" + resultString + "\n");
|
|
}
|
|
done(!err || !resultString);
|
|
});
|
|
}).catch(done);
|
|
});
|
|
};
|