microsoft / microsoft/TypeScript
--format=checkstyle option for tsc --noEmit
Personne n'a encore pris cette issue.
- Langage dominant
- Go
- Étoiles
- 111k
- Forks
- 14.3k
- Merge moyen
- 1 j 19 h
- PR mergées (30 j)
- 117
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par la commande tsc --project ./tsconfig.json --noEmit et examinez comment ses diagnostics sont actuellement écrits dans build-logs/typescript-error.log. Examinez la structure XML de Checkstyle liée dans l’issue et déterminez comment les erreurs signalées doivent y être mappées ; c’est terminé lorsque --format=checkstyle produit un XML analysable sans modifier la sortie existante.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- typescript
- Domaine
- cli, compilers
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100