microsoft / microsoft/TypeScript

--format=checkstyle option for tsc --noEmit

Offen
#42,453 3 Kommentare 9 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
2 T. 4 Std.
Gemergte PRs (30 T.)
132

Beschreibung

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.
Screenshot 2021-01-22 at 10 28 59

💻 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.

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 Befehl tsc --project ./tsconfig.json --noEmit und untersuche, wie seine Diagnosen derzeit in build-logs/typescript-error.log geschrieben werden. Sieh dir die im Issue verlinkte Checkstyle-XML-Struktur an und bestimme, wie gemeldete Fehler darauf abgebildet werden sollen; abgeschlossen ist die Aufgabe, wenn --format=checkstyle parsebares XML erzeugt, ohne die bestehende Ausgabe zu ändern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
cli, compilers
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

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