-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathmdlint.js
More file actions
23 lines (20 loc) 路 530 Bytes
/
Copy pathmdlint.js
File metadata and controls
23 lines (20 loc) 路 530 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const glob = require('glob')
const markdownlint = require('markdownlint')
const config = {
'default': true,
'line_length': false,
'no-emphasis-as-header': false,
}
const files = glob.sync('**/*.md', { ignore: '**/node_modules/**' })
markdownlint({ files, config }, (err, result) => {
if (!err) {
const resultString = result.toString()
console.log('== Linting Markdown Files...')
if (resultString) {
console.log(resultString)
process.exit(1)
} else {
console.log('== OK!')
}
}
})