microsoft / microsoft/TypeScript

Feature request: Ignore JS files when generating declarations

Đang mở
#42,647 2 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Awaiting More Feedback Suggestion
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ả

Suggestion

🔍 Search Terms

ignore js files generate declarations

✅ 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.

⭐ Suggestion

The docs for the declaration tsconfig option say:

Generate .d.ts files for every TypeScript or JavaScript file inside your project.

What if it was just TS files, and JS files were ignored?

📃 Motivating Example

I'm getting a bunch of declaration emit errors in JS files. I would rather just ignore them; I'll be converting them to TS eventually and will get higher fidelity. But until then, I'd rather not try to figure out how to annotate the JS to solve this problem.

💻 Use Cases

I'm getting errors that I don't care about.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Không có tệp triển khai hoặc bài kiểm thử nào được nêu tên. Hãy bắt đầu bằng cách lần theo tùy chọn declaration của tsconfig qua trình biên dịch TypeScript và các bài kiểm thử declaration-emit của nó; hoàn tất khi các tệp JavaScript bị loại khỏi việc tạo declaration, còn các tệp TypeScript vẫn tiếp tục phát ra declaration.

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
compilers
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
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
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.