Skip to content

[Huge] Alternative File-Type extension for typescript files (.ts = mpeg-2 video) #47611

Closed as not planned
@adroste

Description

@adroste

Suggestion

Huge request. One thing that I don't like about typescript is the file extension itself. ".ts" was already reserved for mpeg-2 video long before anyone thought about shipping JS apps with the complexity we see today.
This causes a lot of problems:

  • backup tools consider them as videos and handle them differently
  • nearly every file management/operation tool think it's a video (file recovery, search, remote access, ...)
  • file explorers think it's a video (tested on windows and macOS)
  • file patterns (e.g. web servers, custom apps) that are not optimised for the existence of typescript send typescript files with wrong mime type or apply the wrong handling per default <=> again changing this manually breaks handling of actual video files
  • even vscode is confused (see Code Helper attempts to index MPEG-TS files in project and eats 100% cpu #21136)

I think giving typescript the extension ".ts" was a mistake.
As there is just no simple solution, we could introduce an alternative file extension like ".reallynotavideo", ".tscript", ".tsc", ... (I really don't care).

🔍 Search Terms

  • video
  • mpeg-2

Somewhat related issue: #25945

✅ Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

=> However, it would still be a breaking change and could also require a lot of reconfiguration (e.g. file-patterns).

⭐ Suggestion

Introduce an "official" alternative file extension that can be used ootb for typescript files (e.g. ".tsc", ".tscript", ...).

📃 Motivating Example

See above

💻 Use Cases

See above

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions