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:
David Sanders 2023-01-24 00:00:25 -08:00 committed by GitHub
parent 37f5881882
commit ca3145a547
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 700 additions and 176 deletions

View file

@ -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,