21 lines
517 B
JavaScript
21 lines
517 B
JavaScript
const YAML = require('js-yaml');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const argv = require('yargs').argv;
|
|
const linter = require('./linter');
|
|
|
|
const CONFIG_PATH = path.resolve(
|
|
__dirname,
|
|
'../../../curriculum/challenges/.markdownlint.yaml'
|
|
);
|
|
const isMDRE = /.*\.md$/;
|
|
|
|
const lintRules = fs.readFileSync(CONFIG_PATH, 'utf8');
|
|
|
|
const lint = linter(YAML.load(lintRules));
|
|
|
|
const files = argv._.filter(arg => isMDRE.test(arg));
|
|
files.forEach(path => lint({ path: path }));
|
|
|
|
module.exports = lint;
|