praeclarum / Netjs

Compile .NET assemblies to TypeScript and JavaScript
MIT License
963 stars 134 forks source link

Support for --strictNullChecks for the generated code #30

Open mhgamework opened 7 years ago

mhgamework commented 7 years ago

I want to use NetJS to have some shared code between my typescript and csharp codebase. I am however using --strictNullChecks in typescript 2.0 and would like to keep using that.

netjs generates "AddIntegrationRequest: string = null;" for fields, while for typescript 2.0 this should be "AddIntegrationRequest: (string | null) = null;"

I already fixed these errors manually for the mscorlib.ts, but i cannot do this for the generated code easily.

Is there some workaround for this problem or a plan to solve?

praeclarum commented 6 years ago

I will look into fixing this. Thanks for the heads-up.