microsoft / microsoft/TypeScript
A flag to replace removed syntax with blank space
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Go
- Star
- 111k
- Fork
- 14.3k
- Merge trung bình
- 2 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 132
Mô tả
### 🔍 Search Terms
Blank space
ErasableSyntax
Node.js Strip Types
Type Stripping
### ✅ Viability Checklist
- [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
- [x] This wouldn't change the runtime behavior of existing JavaScript code
- [x] This could be implemented without emitting different JS based on the types of the expressions
- [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- [x] This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- [x] This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
### ⭐ 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.
3. What shortcomings exist with current approaches?
None other than only a subset of syntax defined by an existing flag can be stripped.
4. What workarounds are you using in the meantime?
swc and tsblankspace
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Issue không nêu tên tệp hoặc bài kiểm thử nào trong repository. Hãy bắt đầu bằng cách lần theo tùy chọn hiện có --erasableSyntaxOnly trong compiler và so sánh đầu ra khoảng trắng được yêu cầu với các cách tiếp cận swc và ts-blank-space được dẫn chiếu. Hoàn thành nghĩa là có một flag tương thích mới thay thế syntax đã bị loại bỏ bằng các khoảng trắng và chỉ áp dụng cho erasable syntax.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- compilers
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 28/100