Skip to content

doc,test: fix docs/api copy #57109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
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=v22.6.0-->

> 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
Loading