microsoft / microsoft/TypeScript

SARIF output for tsc failures

Đang mở
#55,890 5 bình luận 6 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.4k
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
117

Mô tả

🔍 Search Terms

sarif

✅ Viability Checklist
  • 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 our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion

Today the @typescript-eslint/eslint-plugin plugin will not output errors that happen during compile time. This is by design.

So in my CI (Github Actions) I use eslint but I also need to run a tsc --noEmit in order to check compile-time errors.

Ok so far. The pipeline will fail and PR merge will be prevented.

Let's make the developer experience better. Today, in case of a failure in tsc --noEmit, the developer will need to read the step logs to see the failures of the command.

ESlint already supports the @microsoft/eslint-formatter-sarif to output SARIF format outputs in case of failures and github can take those failures and beautifully display them in the PR for the developer. Link to the Github feature. I already use that for eslint and the typescript plugin.

My feature request is for tsc CLI to have same functionality and output SARIF format files in the output if requested. This can be a flag or implement an interface where output formatters can be implemented separately like ESlint.

📃 Motivating Example

This feature improves the developer experience around the git workflow in Github and in any other version control system.

💻 Use Cases

Showed in the suggestion

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

Bắt đầu với đường dẫn của lệnh tsc --noEmit và workflow @microsoft/eslint-formatter-sarif hiện có được mô tả trong issue. Làm rõ liệu phạm vi dự kiến là một flag tích hợp hay một interface của formatter, sau đó xác định hoàn thành là đầu ra SARIF mà GitHub có thể hiển thị cho các lỗi biên dịch.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
github-actions, typescript
Lĩnh vực
ci-cd, cli, developer-experience
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

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.