chore: use vscode-markdown-languageservice for link linting (#36901)
* chore: use vscode-markdown-languageservice for docs link linting * docs: make links relative
This commit is contained in:
parent
37f5881882
commit
ca3145a547
10 changed files with 700 additions and 176 deletions
|
@ -1,5 +1,6 @@
|
|||
const { GitProcess } = require('dugite');
|
||||
const fs = require('fs');
|
||||
const klaw = require('klaw');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
|
||||
|
@ -122,8 +123,29 @@ function chunkFilenames (filenames, offset = 0) {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} top
|
||||
* @param {(filename: string) => boolean} test
|
||||
* @returns {Promise<string[]>}
|
||||
*/
|
||||
async function findMatchingFiles (top, test) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const matches = [];
|
||||
klaw(top, {
|
||||
filter: f => path.basename(f) !== '.bin'
|
||||
})
|
||||
.on('end', () => resolve(matches))
|
||||
.on('data', item => {
|
||||
if (test(item.path)) {
|
||||
matches.push(item.path);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
chunkFilenames,
|
||||
findMatchingFiles,
|
||||
getCurrentBranch,
|
||||
getElectronExec,
|
||||
getOutDir,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue