@@ -3,15 +3,15 @@ open GenTypeCommon
33let fileHeader ~sourceFile =
44 let makeHeader ~lines =
55 match lines with
6- | [line] -> " /* " ^ line ^ " */\n "
6+ | [line] -> " /* " ^ line ^ " */\n\n "
77 | _ ->
88 " /** \n "
99 ^ (lines |> List. map (fun line -> " * " ^ line) |> String. concat " \n " )
10- ^ " \n */\n "
10+ ^ " \n */\n\n "
1111 in
1212 makeHeader
1313 ~lines: [" TypeScript file generated from " ^ sourceFile ^ " by genType." ]
14- ^ " /* eslint-disable import/first */\n\n "
14+ ^ " /* eslint-disable */\n " ^ " /* tslint:disable */ \n "
1515
1616let interfaceName ~(config : Config.t ) name =
1717 match config.exportInterfaces with
@@ -183,8 +183,7 @@ let rec renderType ~(config : Config.t) ?(indent = None) ~typeNameIsInterface
183183 in
184184 let tagField =
185185 case |> labelJSToString
186- |> field
187- ~name: (Runtime. jsVariantTag ~polymorphic: false ~tag )
186+ |> field ~name: (Runtime. jsVariantTag ~polymorphic: false ~tag )
188187 in
189188 match (unboxed, type_) with
190189 | true , type_ ->
@@ -355,20 +354,15 @@ let emitExportType ~(config : Config.t) ~emitters ~nameAs ~opaque ~type_
355354 | true -> " any"
356355 | false -> typeVars |> String. concat " | "
357356 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
363358 ^ " { protected opaque!: " ^ typeOfOpaqueField
364359 ^ " }; /* simulate opaque types */" ^ exportNameAs
365360 |> Emitters. export ~emitters
366361 else
367362 (if isInterface && config.exportInterfaces then
368363 docString ^ " export interface " ^ resolvedTypeName ^ typeParamsString ^ " "
369364 else
370- " // tslint:disable-next-line:interface-over-type-literal\n " ^ docString
371- ^ " export type " ^ resolvedTypeName ^ typeParamsString ^ " = " )
365+ docString ^ " export type " ^ resolvedTypeName ^ typeParamsString ^ " = " )
372366 ^ (match type_ with
373367 | _ -> type_ |> typeToString ~config ~type NameIsInterface)
374368 ^ " ;" ^ exportNameAs
@@ -386,11 +380,6 @@ let emitImportValueAsEarly ~emitters ~name ~nameAs importPath =
386380
387381let emitRequire ~importedValueOrComponent ~early ~emitters ~(config : Config.t )
388382 ~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
394383 let importPath =
395384 match config.moduleResolution with
396385 | Node ->
@@ -402,15 +391,15 @@ let emitRequire ~importedValueOrComponent ~early ~emitters ~(config : Config.t)
402391 | ES6 when not importedValueOrComponent ->
403392 let moduleNameString = ModuleName. toString moduleName in
404393 (let es6ImportModule = moduleNameString ^ " __Es6Import" in
405- commentBeforeRequire ^ " import * as " ^ es6ImportModule ^ " from '"
394+ " import * as " ^ es6ImportModule ^ " from '"
406395 ^ (importPath |> ImportPath. emit)
407396 ^ " ';\n " ^ " const " ^ moduleNameString ^ " : any = " ^ es6ImportModule ^ " ;" )
408397 |> (match early with
409398 | true -> Emitters. requireEarly
410399 | false -> Emitters. require)
411400 ~emitters
412401 | _ ->
413- commentBeforeRequire ^ " const "
402+ " const "
414403 ^ ModuleName. toString moduleName
415404 ^ " = require('"
416405 ^ (importPath |> ImportPath. emit)
0 commit comments