Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
tools: consolidate 'introduced_in' check for docs
  • Loading branch information
1ilsang committed Feb 20, 2025
commit 41715462bd65bea448c8c257ac1924f90b8f64d8
2 changes: 2 additions & 0 deletions doc/api/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ changes:
description: Added `--experimental-transform-types` flag.
-->

<!--introduced_in=v23.6.0-->
Comment thread
jakecastelli marked this conversation as resolved.
Resolved

> Stability: 1.1 - Active development

## Enabling
Expand Down
8 changes: 8 additions & 0 deletions tools/lint-md/lint-md.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ paths.forEach(async (path) => {
const fileContents = file.toString();
const result = await linter.process(file);
const isDifferent = fileContents !== result.toString();

if (path.startsWith('doc/api/')) {
if (!fileContents.includes('introduced_in')) {
console.error(`${path} is missing an 'introduced_in' version. Please add one.`);
process.exitCode = 1;
}
}

if (format) {
if (isDifferent) {
fs.writeFileSync(path, result.toString());
Expand Down