Skip to content

Commit

Permalink
fix(core/generate): typings takes headComments option
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamel committed Oct 18, 2019
1 parent 79196ca commit a7c0faa
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/core/src/generate/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,26 @@ export interface TypingsGenerateOptions {
* Path to optionally write the result into a file. Default: `null`.
*/
write?: string | null;
/**
* Enables head comments disabling *tslint* and *eslint*. Default: `true`.
*/
headComments?: boolean;
}

export async function typings(
collection: CollectionTree,
options?: TypingsGenerateOptions
): Promise<string> {
const opts = { write: null, ...options };
const opts = { write: null, headComments: true, ...options };

let content = '';

content +=
'/* eslint-disable */\n' +
'/* tslint:disable */\n' +
'/* This file was automatically generated. DO NOT MODIFY IT BY HAND. */\n\n';
if (opts.headComments) {
content +=
'/* eslint-disable */\n' +
'/* tslint:disable */\n' +
'/* This file was automatically generated. DO NOT MODIFY IT BY HAND. */\n\n';
}

const { types } = normalize(collection);
for (const [key, value] of Object.entries(types)) {
Expand Down

0 comments on commit a7c0faa

Please sign in to comment.