Skip to content

Commit

Permalink
Prohibit type assertions
Browse files Browse the repository at this point in the history
This should not be used unless there is no other way for the TypeScript
compiler to infer the type properly. In such cases, a comment with
per-line exception should be used.

I will address existing violations in subsequent commits.
  • Loading branch information
victorlin committed Nov 20, 2024
1 parent ef18825 commit 4592e2a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ globals:
rules:
# Code quality rules
eqeqeq: error
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: 'never' }]
"@typescript-eslint/no-empty-function": ["error", { "allow": ["arrowFunctions"] }]
"@typescript-eslint/no-explicit-any": off # Allow explicit any to make incremental TypeScript adoption easier.
# TODO: use strict ruleset which includes no-non-null-assertion.
Expand Down

0 comments on commit 4592e2a

Please sign in to comment.