This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 889
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include actual types for restrict-plus-operands.
It can be difficult for users to find out why exactly they received the "restrict-plus-operands" lint error. In particular, users often end up with `any` types leaking into their code (e.g. in tests), and are then puzzled why this triggers. To fix, this change includes a textual representation of the type in the error message, e.g.: [Operands of '+' operation must either be both strings or both numbers, but found 5 + undefined[]] The type representation isn't always super pretty (e.g. the `undefined[]` bit above), but should still be helpful, and also matches TS compiler's representation of these.
- Loading branch information
Showing
2 changed files
with
29 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters