Open bitc opened 3 years ago
Would this generated code work in older versions of typescript? Having had problems with this in the past, we test that the generate code works with typescript versions 2.9, 3.5 and 3.8 and deno 1.10. See:
I see, looks nice. I think it should be able to work also in older versions of TypeScript.
A quick-fix is to add @ts-ignore
before every catch
statement. But a cleaner solution should also be possible
FWIW, we normally turn off linting for all the generated code - there doesn't seem to be much value in lint checking code that wasn't written by humans.
That makes sense. I guess it comes down to how you organize your project.
Here is how I do things: I copy all of the adl generated TypeScript files directly into my project, and compile them all together along with my application code, using a single "tsconfig.json" file. This seems like the simplest way to do things, but then there is a problem if the settings I want in my "tsconfig.json" file are not compatible with the generated code.
An alternate approach would be to use a separate "tsconfig.json" file for the adl generated TypeScript code, but this makes the project setup more complex.
Addressed by https://github.com/timbod7/adl/pull/155
Hi, it would be nice if the generated TypeScript code would be compatible with https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables
The fix is make sure that all "catch" blocks have an
: unknown
type annotation.Thank you