chore: format curriculum (#37912)
This commit is contained in:
committed by
GitHub
parent
45fe3d8814
commit
22fbc62f88
19
tools/scripts/formatter/md-to-mdx/validate-hints.js
Normal file
19
tools/scripts/formatter/md-to-mdx/validate-hints.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const readDirP = require('readdirp-walk');
|
||||
const { getText } = require('./transform-to-mdx');
|
||||
const { validateHints } = require('./create-mdx');
|
||||
|
||||
const challengeDir = '../../../../curriculum/challenges/english';
|
||||
|
||||
readDirP({
|
||||
root: challengeDir,
|
||||
fileFilter: ['*.md']
|
||||
}).on('data', file => {
|
||||
if (file.stat.isFile()) {
|
||||
getText(file.fullPath)
|
||||
.then(validateHints)
|
||||
.catch(() => {
|
||||
console.log('invalid hint in');
|
||||
console.log(file.path);
|
||||
});
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user