Files
freeCodeCamp/tools/lint-guide/gulpfile.js
Oliver Eyton-Williams 9de68bd4a7 feat: Add rule checking Prism languages
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.
2019-07-19 15:30:17 +05:30

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);