Skip to content

Commit

Permalink
update docusaurus
Browse files Browse the repository at this point in the history
  • Loading branch information
mkosir committed Dec 14, 2024
1 parent 5065eee commit 989ca3e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions website/src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,10 @@ const renderUserAvatar = (avatar: string) => {...}

### Type Error

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
allowed, where `@ts-expect-error` must be used with provided description.
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.

- Always use `@ts-expect-error` with a clear description explaining why it is necessary.
- Avoid using `@ts-ignore`, as it does not provide the same level of safety and accountability as @ts-expect-error.

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

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

Expand Down

0 comments on commit 989ca3e

Please sign in to comment.