Skip to content

Docs: [no-unnecessary-condition] checkTypePredicates section: mention assumptions of valid type predicates #12349

@kirkwaiblinger

Description

@kirkwaiblinger

Before You File a Documentation Request Please Confirm You Have Done The Following...

Suggested Changes

The checkTypePredicates feature relies on the assumption that the type predicate is "if and only if". While this is a requirement of a well-formed type predicate in TS, that may not be common knowledge for TS users. Also, this may actually not be the case for the asserts variants... See https://discord.com/channels/1026804805894672454/1088474511759917106/1506050671399538919. But we should probably wait for some more input from the TS side before addressing that in the docs.

Affected URL(s)

https://typescript-eslint.io/rules/no-unnecessary-condition/#checktypepredicates

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updating

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions