microsoft / microsoft/TypeScript

SARIF output for tsc failures

Aperta
#55,890 5 commenti 6 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Awaiting More Feedback Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.4k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

🔍 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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal percorso del comando tsc --noEmit e dal workflow esistente @microsoft/eslint-formatter-sarif descritti nell’issue. Chiarisci se l’ambito previsto è un flag integrato o un’interfaccia di formatter, quindi definisci il completamento come un output SARIF che GitHub possa visualizzare per gli errori di compilazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
github-actions, typescript
Ambito
ci-cd, cli, developer-experience
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.