You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Declaration files (.d.ts) used for type support by the IDE.
Declaration files (d.ts) are subject to our user's tsconfig.json which is more strict than sdk/wasp/tsconfig.json used to build the SDK. This results in the SDK's declaration files having type errors when looked at from the user's perspective (e.g., during go-to-definition jumps).
We've avoided using strict: true in the tsconfig.json we use for building the SDK due to legacy reasons (old JS or improperly typed code that still works).
This is not a big problem, but definitely isn't ideal:
Our SDK is deemed "wrong" by our own system, which is a little unprofessional.
These type errors truly are type errors (they're not false-positives). Not compiling the SDK in strict mode prevents us from catching them. In other words, a small part of legacy code disqualifies the entire SDK from reaping the full benefits of TypeScript.
Since the strict: true compiler flag is a shorthand for multiple more specific flags, we should activate all the "subflags" that don't require a major refactor of the SDK. After that's done, we can tackle #1938 and change whatever we need to go full strict mode (this will probably take some time).
The text was updated successfully, but these errors were encountered:
sodic
changed the title
Prevent type errors in generated declaration files
Use a subset of strict: true in the SDK
May 6, 2024
Building the SDK generates two kinds of files:
.js
) used in the runtime..d.ts
) used for type support by the IDE.Declaration files (
d.ts
) are subject to our user's tsconfig.json which is more strict than sdk/wasp/tsconfig.json used to build the SDK. This results in the SDK's declaration files having type errors when looked at from the user's perspective (e.g., during go-to-definition jumps).We've avoided using
strict: true
in the tsconfig.json we use for building the SDK due to legacy reasons (old JS or improperly typed code that still works).This is not a big problem, but definitely isn't ideal:
Since the
strict: true
compiler flag is a shorthand for multiple more specific flags, we should activate all the "subflags" that don't require a major refactor of the SDK. After that's done, we can tackle #1938 and change whatever we need to go full strict mode (this will probably take some time).The text was updated successfully, but these errors were encountered: