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
Describe what should be investigated or refactored
Some typing is circumvented with the use of as unknown as in mutate-request.ts. We must determine if this is truly necessary.
TypeScript is designed to catch type errors at compile time. Using as unknown as effectively bypasses TypeScript's checks. We're telling the compiler to trust the type assertion, even if the types are incompatible, which can lead to runtime errors. This could also indicate Poorly structured type hierarchies, incomplete or incorrect type definitions, and/or a lack of proper handling of the actual types involved.
In most cases, we can use a better alternative such as:
Refactor type definitions to accurately represent the data.
Use type guards or user-defined type predicates to refine types safely.
Use utility types like Partial or Omit to handle flexible or partial structures.
It's possible that no better alternative exists. If so, leave a comment on this issue or write an ADR on the use of as unknown as so that we have record of why the code is the way it is.
The text was updated successfully, but these errors were encountered:
Describe what should be investigated or refactored
Some typing is circumvented with the use of
as unknown as
inmutate-request.ts
. We must determine if this is truly necessary.TypeScript is designed to catch type errors at compile time. Using as unknown as effectively bypasses TypeScript's checks. We're telling the compiler to trust the type assertion, even if the types are incompatible, which can lead to runtime errors. This could also indicate Poorly structured type hierarchies, incomplete or incorrect type definitions, and/or a lack of proper handling of the actual types involved.
In most cases, we can use a better alternative such as:
Links to any relevant code
Additional context
It's possible that no better alternative exists. If so, leave a comment on this issue or write an ADR on the use of
as unknown as
so that we have record of why the code is the way it is.The text was updated successfully, but these errors were encountered: