mirror of
https://github.com/nodejs/node.git
synced 2025-12-28 07:50:41 +00:00
tools: consolidate 'introduced_in' check for docs
PR-URL: https://github.com/nodejs/node/pull/57109 Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
e26d4841d1
commit
73a8514305
@ -10,6 +10,8 @@ changes:
|
||||
description: Added `--experimental-transform-types` flag.
|
||||
-->
|
||||
|
||||
<!--introduced_in=v23.6.0-->
|
||||
|
||||
> Stability: 1.1 - Active development
|
||||
|
||||
## Enabling
|
||||
|
||||
@ -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());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user