Skip to content

Add TS guideline: "Document safe or necessary uses of type assertions" #57

@mcmire

Description

@mcmire

When a type assertion is absolutely necessary due to constraints or is even safe due to runtime checks, we should document the reason for doing so. Something like:

// Type assertion: We ensure that "xyzzy" is filled in above.
const foo = bar as Baz;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions