Why doesn’t TypeScript natively do any type checking

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/typescript

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • InfluxDB - Access the most powerful time series database as a service
  • Sonar - Write Clean JavaScript Code. Always.
  • zod

    TypeScript-first schema validation with static type inference

  • Superstruct

    A simple and composable way to validate data in JavaScript (and TypeScript).

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

  • ajv

    The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)

  • runtypes

    Runtime validation for static types

  • class-validator

    Decorator-based property validation for classes.

  • class-transformer

    Decorator-based transformation, serialization, and deserialization between objects and classes.

  • io-ts

    Runtime type system for IO decoding/encoding

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

  • typescript-runtime-type-benchmarks

    📊 Benchmark Comparison of Packages with Runtime Validation and TypeScript Support

    Learning Typescript, I had that same reaction. Others already explained the main reason but there is also another point to it, which I learned while refactoring parts of the runtime type benchmark:

  • TypeScript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    Yea i guess my question was poorly worded. I understand that validation should not be language level. However, one thing that i would like to see is being able to get the structure of the type at runtime, which i guess would just be a macro. The issue https://github.com/Microsoft/TypeScript/issues/4892 goes over adding macros to the language. The first use case shown there is a validator, which is exactly what i should have asked about in the first place.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts