Skip to content

A flag to replace removed syntax with blank spaceΒ #61410

@marco-ippolito

Description

@marco-ippolito

πŸ” Search Terms

Blank space
ErasableSyntax
Node.js Strip Types
Type Stripping

βœ… Viability Checklist

⭐ Suggestion

A new flag to replace removed syntax during transpilation with blank space. Similarly to http://github.com/bloomberg/ts-blank-space and https://swc.rs/docs/references/wasm-typescript used in Node.js. This would remove the need of sourcemaps.
It can only be used in conjuction with --erasableSyntaxOnly

πŸ“ƒ Motivating Example

Example:

const foo: string = "Hello World";

becomes:

const foo            = "Hello World";

πŸ’» Use Cases

  1. What do you want to use this for?
    Remove the need of sourcemaps after transpilation.
  2. What shortcomings exist with current approaches?
    None other than only a subset of syntax defined by an existing flag can be stripped.
  3. What workarounds are you using in the meantime?
    swc and tsblankspace

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions