microsoft / microsoft/TypeScript
--format=checkstyle option for tsc --noEmit
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
Suggestion
🔍 Search Terms
Checkstyle
✅ 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
We have automated checking for typescript errors in our CI tooling (Jenkins), using the following command ./node_modules/.bin/tsc --project ./tsconfig.json --noEmit > build-logs/typescript-error.log. Currently we save the output to a plaint text file, but we would like to be able to parse it in our CI. The standards most tooling follows is a format option which supports a checkstyle format, which can easily be parsed by most CI's.
See https://checkstyle.sourceforge.io/config.html#Configuration_XML_Structure for more information on how to format the xml.
It would be great to have a --format=checkstyle option we could add to our current command to get a formatted xml file with all errors.
📃 Motivating Example
Most of our current tooling already supports this, and this enables us to check code quality, fail builds, etc.

💻 Use Cases
We currently have checks for stylelint, eslint, php codesniffer, phpstan, psalm and htmlhint. It would be great if we could also easily identify and report which typescript errors exist within our projects and possibly fail a build if we encounter them.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con il comando tsc --project ./tsconfig.json --noEmit e analizza come i suoi diagnostici vengono attualmente scritti in build-logs/typescript-error.log. Esamina la struttura XML di Checkstyle collegata nell’issue e determina come gli errori segnalati debbano essere mappati su di essa; il lavoro è completato quando --format=checkstyle produce XML analizzabile senza modificare l’output esistente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- cli, compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100