diff --git a/404.html b/404.html index dab22a0..912a2e8 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@
type User = { id: string; username: string; avatar: string | null };
// ❌ Avoid type assertions
const user = { name: 'Nika' } as User;
// ❌ Avoid non-nullability assertions
renderUserAvatar(user!.avatar); // Runtime error
const renderUserAvatar = (avatar: string) => {...}
When a TypeScript error cannot be mitigated, use @ts-expect-error
as a last resort to suppress it. This directive allows the TypeScript compiler to notify you if the suppressed line becomes error-free in the future.
When a TypeScript error cannot be mitigated, use @ts-expect-error
as a last resort to suppress it. This directive enables the TypeScript compiler to indicate when the suppressed line no longer contains an error.
@ts-expect-error
with a clear description explaining why it is necessary.@ts-ignore
, as it does not provide the same level of safety and accountability as @ts-expect-error.