darkf / darkfo

DarkFO, a post-nuclear RPG remake (of Fallout 2)
Apache License 2.0
135 stars 12 forks source link

Compile with --strict #111

Open darkf opened 6 years ago

darkf commented 6 years ago

To ensure the code's type coverage is high and there aren't any obvious lurking bugs due to subversive type errors, we should be compiling with tsc's --strict mode (which turns on all safety options.)

As of now, we can and do compile with --noImplicitAny which is a big part of it.

However, the next biggest part will be --noImplicitThis, mainly due to requiring a proper this type on procedures in scripting. Unfortunately it cannot be ScriptProto as it would be circularly defined.

darkf commented 6 years ago

ScriptProto is now gone in the scriptclass branch, and it compiles cleanly with --noImplicitThis.

The biggest thing left is --strictNullChecks which is rather annoying.

darkf commented 6 years ago

Did some more work on --strictNullChecks tonight, there are still about 120 errors left... Some of them are more involved than the others, so there might be something like 40 left that won't be done for a while.