Skip to content

Commit 840da26

Browse files
1ilsangRafaelGSS
authored andcommitted
tools: consolidate 'introduced_in' check for docs
PR-URL: #57109 Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 1ee5f84 commit 840da26

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

doc/api/typescript.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ changes:
77
description: Added `--experimental-transform-types` flag.
88
-->
99

10+
<!--introduced_in=v23.6.0-->
11+
1012
> Stability: 1.1 - Active development
1113
1214
## Enabling

tools/lint-md/lint-md.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ paths.forEach(async (path) => {
3434
const fileContents = file.toString();
3535
const result = await linter.process(file);
3636
const isDifferent = fileContents !== result.toString();
37+
38+
if (path.startsWith('doc/api/')) {
39+
if (!fileContents.includes('introduced_in')) {
40+
console.error(`${path} is missing an 'introduced_in' version. Please add one.`);
41+
process.exitCode = 1;
42+
}
43+
}
44+
3745
if (format) {
3846
if (isDifferent) {
3947
fs.writeFileSync(path, result.toString());

0 commit comments

Comments
 (0)