Description
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)
- it opens the file in a video player per default <=> changing the default makes no sense as proper .ts (actual videos) would open up in a text editor
- os specific features like code-preview (quicklook) stop working (see macOS considers typescript files to be MPEG-2 Transport Stream - QuickLook and Spotlight do not work #25945)
- wrong icons
- 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