mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01: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
15fec136e8
commit
03fdde505e
|
|
@ -10,6 +10,8 @@ changes:
|
||||||
description: Added `--experimental-transform-types` flag.
|
description: Added `--experimental-transform-types` flag.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<!--introduced_in=v23.6.0-->
|
||||||
|
|
||||||
> Stability: 1.1 - Active development
|
> Stability: 1.1 - Active development
|
||||||
|
|
||||||
## Enabling
|
## Enabling
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,14 @@ paths.forEach(async (path) => {
|
||||||
const fileContents = file.toString();
|
const fileContents = file.toString();
|
||||||
const result = await linter.process(file);
|
const result = await linter.process(file);
|
||||||
const isDifferent = fileContents !== result.toString();
|
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 (format) {
|
||||||
if (isDifferent) {
|
if (isDifferent) {
|
||||||
fs.writeFileSync(path, result.toString());
|
fs.writeFileSync(path, result.toString());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user