Why doesn’t TypeScript natively do any type checking

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

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • zod

    TypeScript-first schema validation with static type inference

  • Superstruct

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

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • 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

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • 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

  • Is there any reason not to use typescript?

    5 projects | /r/typescript | 16 Nov 2022
  • How to check that an 'unknown' object has a specific key and that the key is a specific type?

    5 projects | /r/typescript | 11 Jan 2022
  • Mastering Type-Safe JSON Serialization in TypeScript

    2 projects | dev.to | 26 Feb 2024
  • Active fork of superstruct?

    3 projects | /r/typescript | 1 Mar 2022
  • A few questions about type guards

    4 projects | /r/typescript | 25 Oct 2021