Skip to content

Docs: Maybe create a common page/section for when types aren't correct at runtime? #11854

@kirkwaiblinger

Description

@kirkwaiblinger

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

Suggested Changes

Several rules suffer from the limitation that their reports and suggestions are based on type information, which may be incorrect because:

  1. A project doesn't have strict TS types (e.g. anys, invalid type assertions, unsafe generics), doesn't use "strict": true, etc

  2. Even in a pristinely typesafe codebase, one runs into Trade-offs in Control Flow Analysis microsoft/TypeScript#9998

  3. noUncheckedIndexedAccess-type issues

Right now, https://typescript-eslint.io/rules/no-unnecessary-condition/#limitations has discussion of this, but some other rules that can be affected by this (particular with respect to nullishness) include:

It might be useful to have a common explainer that they all can point to?

Affected URL(s)

https://typescript-eslint.io/troubleshooting/faqs/typescript#limitations-of-analysis-involving-types

Or maybe a blog post?

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationDocumentation ("docs") that needs adding/updatingteam assignedA member of the typescript-eslint team should work on this.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions