microsoft / microsoft/TypeScript

SARIF output for tsc failures

Offen
#55,890 5 Kommentare 6 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Awaiting More Feedback Suggestion
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

🔍 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem Pfad des Befehls tsc --noEmit und dem bestehenden @microsoft/eslint-formatter-sarif-Workflow, die im Issue beschrieben sind. Kläre, ob der beabsichtigte Umfang ein integriertes Flag oder eine Formatter-Schnittstelle ist, und definiere den Abschluss als SARIF-Ausgabe, die GitHub für Kompilierungsfehler anzeigen kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
github-actions, typescript
Bereich
ci-cd, cli, developer-experience
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.