-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript: support "useUnknownInCatchVariables" compiler option #145
Comments
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: https://github.com/timbod7/adl/tree/master/typescript/tests |
I see, looks nice. I think it should be able to work also in older versions of TypeScript. A quick-fix is to add |
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 #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
The text was updated successfully, but these errors were encountered: