@@ -3,15 +3,15 @@ open GenTypeCommon
3
3
let fileHeader ~sourceFile =
4
4
let makeHeader ~lines =
5
5
match lines with
6
- | [line] -> " /* " ^ line ^ " */\n "
6
+ | [line] -> " /* " ^ line ^ " */\n\n "
7
7
| _ ->
8
8
" /** \n "
9
9
^ (lines |> List. map (fun line -> " * " ^ line) |> String. concat " \n " )
10
- ^ " \n */\n "
10
+ ^ " \n */\n\n "
11
11
in
12
12
makeHeader
13
13
~lines: [" TypeScript file generated from " ^ sourceFile ^ " by genType." ]
14
- ^ " /* eslint-disable import/first */\n\n "
14
+ ^ " /* eslint-disable */\n " ^ " /* tslint:disable */ \n "
15
15
16
16
let interfaceName ~(config : Config.t ) name =
17
17
match config.exportInterfaces with
@@ -183,8 +183,7 @@ let rec renderType ~(config : Config.t) ?(indent = None) ~typeNameIsInterface
183
183
in
184
184
let tagField =
185
185
case |> labelJSToString
186
- |> field
187
- ~name: (Runtime. jsVariantTag ~polymorphic: false ~tag )
186
+ |> field ~name: (Runtime. jsVariantTag ~polymorphic: false ~tag )
188
187
in
189
188
match (unboxed, type_) with
190
189
| true , type_ ->
@@ -355,20 +354,15 @@ let emitExportType ~(config : Config.t) ~emitters ~nameAs ~opaque ~type_
355
354
| true -> " any"
356
355
| false -> typeVars |> String. concat " | "
357
356
in
358
- " // tslint:disable-next-line:max-classes-per-file \n "
359
- ^ (match String. capitalize_ascii resolvedTypeName <> resolvedTypeName with
360
- | true -> " // tslint:disable-next-line:class-name\n "
361
- | false -> " " )
362
- ^ docString ^ " export abstract class " ^ resolvedTypeName ^ typeParamsString
357
+ docString ^ " export abstract class " ^ resolvedTypeName ^ typeParamsString
363
358
^ " { protected opaque!: " ^ typeOfOpaqueField
364
359
^ " }; /* simulate opaque types */" ^ exportNameAs
365
360
|> Emitters. export ~emitters
366
361
else
367
362
(if isInterface && config.exportInterfaces then
368
363
docString ^ " export interface " ^ resolvedTypeName ^ typeParamsString ^ " "
369
364
else
370
- " // tslint:disable-next-line:interface-over-type-literal\n " ^ docString
371
- ^ " export type " ^ resolvedTypeName ^ typeParamsString ^ " = " )
365
+ docString ^ " export type " ^ resolvedTypeName ^ typeParamsString ^ " = " )
372
366
^ (match type_ with
373
367
| _ -> type_ |> typeToString ~config ~type NameIsInterface)
374
368
^ " ;" ^ exportNameAs
@@ -386,11 +380,6 @@ let emitImportValueAsEarly ~emitters ~name ~nameAs importPath =
386
380
387
381
let emitRequire ~importedValueOrComponent ~early ~emitters ~(config : Config.t )
388
382
~moduleName importPath =
389
- let commentBeforeRequire =
390
- match importedValueOrComponent with
391
- | true -> " // tslint:disable-next-line:no-var-requires\n "
392
- | false -> " // @ts-ignore: Implicit any on import\n "
393
- in
394
383
let importPath =
395
384
match config.moduleResolution with
396
385
| Node ->
@@ -402,15 +391,15 @@ let emitRequire ~importedValueOrComponent ~early ~emitters ~(config : Config.t)
402
391
| ES6 when not importedValueOrComponent ->
403
392
let moduleNameString = ModuleName. toString moduleName in
404
393
(let es6ImportModule = moduleNameString ^ " __Es6Import" in
405
- commentBeforeRequire ^ " import * as " ^ es6ImportModule ^ " from '"
394
+ " import * as " ^ es6ImportModule ^ " from '"
406
395
^ (importPath |> ImportPath. emit)
407
396
^ " ';\n " ^ " const " ^ moduleNameString ^ " : any = " ^ es6ImportModule ^ " ;" )
408
397
|> (match early with
409
398
| true -> Emitters. requireEarly
410
399
| false -> Emitters. require)
411
400
~emitters
412
401
| _ ->
413
- commentBeforeRequire ^ " const "
402
+ " const "
414
403
^ ModuleName. toString moduleName
415
404
^ " = require('"
416
405
^ (importPath |> ImportPath. emit)
0 commit comments