Skip to content

Typescript: Realistic type definition errors #35247

Closed
@SephReed

Description

@SephReed

Type checking, and type definitions errors could me made significantly easier to debug by boiling down the type definitions to something realistic.

  1. This first example shows the kind of errors I run into in actual development. It's totally unreadable.

Screen Shot 2019-11-20 at 3 58 27 PM

  1. This second example shows the same effect

Screen Shot 2019-11-20 at 4 01 34 PM

Screen Shot 2019-11-20 at 4 02 52 PM

For this second example, it would be a lot more useful if instead it just showed what the type realistically is, and what it was missing. Ie:

Property "badProp" does not exist on type `{
  requestId: string;
  type: string;
  id?: string;
  createdAt?: Date;
  data?: string;
}`

This could be a configuration thing, but I can't imagine any reason why a person would want cryptic error messages by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    UnactionableThere isn't something we can do with this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions