Skip to content

Codemod to help adoption of types stripping #267

Open

Description

@AugustinMauroy

Description/Context

To enable TypeScript support on Node.js, Marco implement types stripping. This approach is now supported by the TypeScript transpiler and is on its way to becoming stable on Node.js. That is why we must try to create one or more codemods that will enable adoption of this approach.

Todo

Thing to define

  • How to go away from enum
  • What do we have to change in the tsconfig.json

Activity

  1. Renegade334 commented on Nov 15, 2025

    @Renegade334
    Member

    For context, a list of what TS currently considers non-strippable:

    • Pointy type assertions: <T>x (as opposed to x as T which is strippable)
    • Class properties from constructor parameters: constructor(public x) { ... }
    • enums
    • namespaces containing any runtime exports (type-only namespaces are strippable)
    • import x = ... and export = ...
  2. AugustinMauroy commented on Nov 16, 2025

    @AugustinMauroy
    MemberAuthor

    import { type } from "package"; also if a type is imported without the type keyword it's not working

  3. JakobJingleheimer commented on Nov 16, 2025

    @JakobJingleheimer
    Member

    import { type } from "package"; also if a type is imported without the type keyword it's not working

    correct-ts-specifiers handles some of that (if it's a .d.ts file). tslint handles the other cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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