vojtechhabarta / typescript-generator

Generates TypeScript from Java - JSON declarations, REST service client
MIT License
1.14k stars 237 forks source link

Trailing comma in generated enums? #223

Closed krezovic closed 6 years ago

krezovic commented 6 years ago

Is there any specific reason that the trailing comma is being generated in enum definitions when using

<mapEnum>asEnum</mapEnum>

in pom.xml? We use tslint, which errors out on trailing commas, so this is pretty unwelcome behaviour. Can it be changed somehow?

Thx!

vojtechhabarta commented 6 years ago

It is not possible to configure formatting (only indentation and quotes).

I think generated files should not be checked by tslint. Could you disable it?

Maybe typescript-generator could generate /* tslint:disable */ flag to disable tslint in the generated file. What do you think?

krezovic commented 6 years ago

Hi, thank you for your answer.

Truth is, we use this generator with a DOJO2 app, whose integrated tslint ignores the ignored files (see https://github.com/dojo/cli-build-app/issues/85).

I believe the /* tslint:disable */ is an acceptable solution, if it's not a big problem to implement in the generator.

TIA.

vojtechhabarta commented 6 years ago

Released v2.1.410 with /* tslint:disable */.