microsoft / microsoft/TypeScript
Add Command-Line Syntax-Only Validation
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
Keywords I searched:
- Syntax
- Validation
Suggestion
I would like to see a command line option that makes tsc only validate the syntax of TypeScript (and possibly JavaScript) files within the project, but does not perform type checking. It would not emit any files.
Use Cases
- (My current use case) TypeScript generated by code generation programs that skips generation of certain symbols, or needs to import symbols from other modules where those modules may not be available yet, so their types cannot be known. The generated files would almost always have type-related errors that cannot reliably be automatically fixed, so just validation of the syntax alone would be helpful.
- Certain CI/CD workflows could benefit from the lower overhead of just checking syntax only in large projects for every commit, and only performing type checking for commits that are expected to result in a build.
Examples
The command
tsc --noTypeCheck index.ts
could return the normal errors and exit code that it would if the syntax were incorrect, but never check typing.
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, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
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
Bắt đầu từ điểm vào dòng lệnh tsc và xem xét cách các chẩn đoán cú pháp, kiểm tra kiểu và quá trình phát sinh đầu ra hiện được chọn. Xác định các chế độ tệp được tùy chọn hỗ trợ và xác minh rằng tùy chọn này báo cáo lỗi cú pháp với trạng thái thoát thông thường, đồng thời ngăn kiểm tra kiểu và đầu ra.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, typescript
- Lĩnh vực
- cli, 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
- 25/100