Skip to content

Commit 989ca3e

Browse files
committed
update docusaurus
1 parent 5065eee commit 989ca3e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

website/src/pages/index.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,10 @@ const renderUserAvatar = (avatar: string) => {...}
382382

383383
### Type Error
384384

385-
When a TypeScript error cannot be mitigated, as last resort use `@ts-expect-error` to suppress it. If at any future point suppressed line becomes error-free, TypeScript compiler will indicate it. `@ts-ignore` is not
386-
allowed, where `@ts-expect-error` must be used with provided description.
385+
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.
386+
387+
- Always use `@ts-expect-error` with a clear description explaining why it is necessary.
388+
- Avoid using `@ts-ignore`, as it does not provide the same level of safety and accountability as @ts-expect-error.
387389

388390
<Rule href="https://typescript-eslint.io/rules/ban-ts-comment/#allow-with-description">{`'@typescript-eslint/ban-ts-comment': [
389391
'error',
@@ -398,7 +400,7 @@ allowed, where `@ts-expect-error` must be used with provided description.
398400
const newUser = createUser('Gabriel');
399401

400402
// ✅ Use @ts-expect-error with description.
401-
// @ts-expect-error: The library type definition is wrong, createUser accepts string as an argument.
403+
// @ts-expect-error: This library function has incorrect type definitions - createUser accepts string as an argument.
402404
const newUser = createUser('Gabriel');
403405
```
404406

0 commit comments

Comments
 (0)