Skip to content

Commit 73a8514

Browse files
1ilsangtargos
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 e26d484 commit 73a8514

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

doc/api/typescript.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ changes:
1010
description: Added `--experimental-transform-types` flag.
1111
-->
1212

13+
<!--introduced_in=v23.6.0-->
14+
1315
> Stability: 1.1 - Active development
1416
1517
## Enabling

tools/lint-md/lint-md.mjs

+8
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)