Skip to content

Commit

Permalink
update docusaurus
Browse files Browse the repository at this point in the history
  • Loading branch information
mkosir committed Feb 15, 2024
1 parent 4d34fe8 commit f843996
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions website/src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,16 @@ const renderUserAvatar = (avatar: string) => {...}
### Type Error

If TypeScript error can't be mitigated, as last resort use `@ts-expect-error` to suppress it ([eslint rule](https://typescript-eslint.io/rules/prefer-ts-expect-error/)). If at any future point suppressed line becomes error-free, TypeScript compiler will indicate it.
`@ts-ignore` is not allowed, while `@ts-expect-error` can be used with provided description ([eslint rule](https://typescript-eslint.io/rules/ban-ts-comment/#allow-with-description)).
`@ts-ignore` is not allowed, where `@ts-expect-error` must be used with provided description ([eslint rule](https://typescript-eslint.io/rules/ban-ts-comment/#allow-with-description)).

```ts
// ❌ Avoid @ts-ignore
// @ts-ignore
const result = doSomething('hello');
const newUser = createUser('Gabriel');

// ✅ Use @ts-expect-error with description
// @ts-expect-error: The library definition is wrong, doSomething accepts string as an argument.
const result = doSomething('hello');
// @ts-expect-error: The library definition is wrong, createUser accepts string as an argument.
const newUser = createUser('Gabriel');
```

### Type Definition
Expand Down

0 comments on commit f843996

Please sign in to comment.