Skip to content

Commit

Permalink
Disable the @typescript-eslint/no-unsafe-type-assertion rule
Browse files Browse the repository at this point in the history
  • Loading branch information
amikheychik committed Dec 1, 2024
1 parent 0ce312a commit b946a91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/rules/typescript-eslint/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,9 @@ Empty interfaces are allowed.

| `link:{ts-eslint-rules}/no-unsafe-type-assertion/[@typescript-eslint/no-unsafe-type-assertion]`
| Recommended
| Error
| Off
3+| Does not handle function overloads,
and in general, type assertions are only needed when they _are_ unsafe.

| `link:{ts-eslint-rules}/no-unsafe-unary-minus/[@typescript-eslint/no-unsafe-unary-minus]`
|
Expand Down
3 changes: 2 additions & 1 deletion src/rules/typescript-eslint/supported-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ export const supportedRules = {
'@typescript-eslint/no-unsafe-function-type': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'error',
'@typescript-eslint/no-unsafe-return': 'error',
'@typescript-eslint/no-unsafe-type-assertion': 'error',
// Type assertions are only needed when they are unsafe, because they hint the types that compiler cannot deduce.
'@typescript-eslint/no-unsafe-type-assertion': 'off',
'@typescript-eslint/no-unsafe-unary-minus': 'error',
'@typescript-eslint/no-useless-empty-export': 'warn',
// Deprecated. Use @typescript-eslint/no-useless-template-expressions instead.
Expand Down

0 comments on commit b946a91

Please sign in to comment.