1
1
import type { OpenAPILatest } from '../types/openapi' ;
2
2
import type { OpenApiLatest_Media , OpenApiLatest_Operation , OpenApiLatest_Parameter , OpenApiLatest_PathItem , OpenApiLatest_Request , OpenApiLatest_Response , OpenApiLatest_Schema } from './helpers' ;
3
3
import type { PrinterConfigs , PrinterOptions } from './types' ;
4
+ import { pkgName , pkgVersion } from '../const' ;
4
5
import { OpenAPIVersion } from '../types/openapi' ;
5
6
import { toImportPath } from '../utils/path' ;
6
7
import { isString , isUndefined } from '../utils/type-is' ;
@@ -272,6 +273,7 @@ export class Printer {
272
273
hideHeaders,
273
274
hideHelpers,
274
275
hideFooters,
276
+ hideAlert,
275
277
hideInfo,
276
278
hideComponents,
277
279
hideImports,
@@ -282,6 +284,7 @@ export class Printer {
282
284
283
285
return [
284
286
! hideHeaders && header ,
287
+ ! hideAlert && this . #printAlert( ) ,
285
288
! hideInfo && this . #printInfo( ) ,
286
289
! hideImports && this . #printImports( ) ,
287
290
! hideHelpers && Printer . helpersCode ,
@@ -293,6 +296,20 @@ export class Printer {
293
296
. join ( '\n\n' ) ;
294
297
}
295
298
299
+ #printAlert( ) {
300
+ return [
301
+ `/**` ,
302
+ ` * This file is generated by ${ pkgName } @${ pkgVersion } .` ,
303
+ ` * Please do not edit it manually.` ,
304
+ ` * If you use the following tools, you can refer to the corresponding documentation` ,
305
+ ` * and ignore the check of this file.` ,
306
+ ` * - [ESLint](https://eslint.org/docs/latest/use/configure/ignore)` ,
307
+ ` * - [Prettier](https://prettier.io/docs/en/ignore.html)` ,
308
+ ` * - [Biome](https://biomejs.dev/guides/configure-biome/#ignore-files)` ,
309
+ ` */` ,
310
+ ] . join ( `\n` ) ;
311
+ }
312
+
296
313
#printInfo( ) {
297
314
const {
298
315
contact,
0 commit comments