The linter now checks that fences have languages and that those languages are supported by PrismJS. The linter has been extended over the guide with its own set of rules that only validate code fences.
28 lines
520 B
JavaScript
28 lines
520 B
JavaScript
const gulp = require('gulp');
|
|
const through2 = require('through2');
|
|
|
|
const { testedLangs } = require('../../curriculum/utils');
|
|
const lintMarkdown = require('./lint-guide');
|
|
|
|
/**
|
|
* Tasks
|
|
**/
|
|
|
|
function lint() {
|
|
return gulp.src(globLangs(testedLangs()), { read: false }).pipe(
|
|
through2.obj(function obj(file, enc, next) {
|
|
lintMarkdown(file, next);
|
|
})
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Helper functions
|
|
**/
|
|
|
|
function globLangs(langs) {
|
|
return langs.map(lang => `../../guide/${lang}/**/*.md`);
|
|
}
|
|
|
|
gulp.task('lint', lint);
|