mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
24 lines
645 B
JavaScript
24 lines
645 B
JavaScript
// @ts-check
|
|
|
|
"use strict";
|
|
|
|
const gulp = require("gulp");
|
|
const through2 = require("through2");
|
|
|
|
// Simple task wrapper
|
|
gulp.task("markdownlint", function task() {
|
|
return gulp.src("*.md", { "read": false })
|
|
.pipe(through2.obj(function obj(file, enc, next) {
|
|
import("markdownlint/async").then(({ lint }) => {
|
|
lint(
|
|
{ "files": [ file.relative ] },
|
|
function callback(err, result) {
|
|
const resultString = (result || "").toString();
|
|
if (resultString) {
|
|
console.log(resultString);
|
|
}
|
|
next(err, file);
|
|
});
|
|
}).catch(next);
|
|
}));
|
|
});
|