Skip to content

Commit 341c68d

Browse files
committed
Allow running check-error-documentation on individual .md files
E.g. node website/check-error-documentation.mjs docs/errors/E043.md
1 parent 011fd6a commit 341c68d

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

website/check-error-documentation.mjs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,27 @@
22
// See end of file for extended copyright information.
33

44
import {
5+
ErrorDocumentation,
56
documentationDirectoryPath,
67
loadErrorDocumentationFilesAsync,
78
reportProblemsInDocumentsAsync,
89
} from "./src/error-documentation.mjs";
910

1011
async function mainAsync() {
11-
let documents = await loadErrorDocumentationFilesAsync(
12-
documentationDirectoryPath
13-
);
12+
let files = process.argv.slice(2);
13+
let documents;
14+
if (files.length === 0) {
15+
documents = await loadErrorDocumentationFilesAsync(
16+
documentationDirectoryPath
17+
);
18+
} else {
19+
documents = await Promise.all(
20+
files.map(
21+
async (fileName) =>
22+
await await ErrorDocumentation.parseFileAsync(fileName)
23+
)
24+
);
25+
}
1426
await reportProblemsInDocumentsAsync(documents);
1527
}
1628

website/quick-lint-js.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"global-groups": [
33
"browser",
4-
"ecmascript"
4+
"ecmascript",
5+
"node.js"
56
]
67
}

0 commit comments

Comments
 (0)