Output formats

Estimated reading time: 2 minutes

kita-html check writes its report to stdout. Usage and configuration errors, and warnings about skipped files, go to stderr. Select formats with --format (-f), comma separated or repeated, such as -f pretty,github. Each format is printed once, in the given order. json cannot be combined with other formats.

FormatOutput
prettyDefault. Code frames, documentation links, and a summary line.
tscOne file(line,col): error TS88601: message line per finding, identical to tsc output. Prints nothing when clean.
jsonOne JSON document, also printed when clean. Follows the JSON Schema shipped at @kitajs/html-cli/check-report.schema.json.
githubOne GitHub Actions ::error or ::warning annotation per finding. Added to pretty by default inside GitHub Actions.

--color and --no-color force colors on or off for pretty. Without them, a non-empty NO_COLOR disables colors, and FORCE_COLOR enables them unless it is 0 or false. Otherwise colors are on in GitHub Actions and when stdout is a terminal. Other formats never print colors.

Flags

FlagDescription
-p, --project <path>tsconfig.json file or directory. Repeatable. Defaults to the current directory.
-f, --format <name>pretty, tsc, json, or github. Comma separated or repeated. Defaults to pretty, or pretty,github inside GitHub Actions.
--[no-]colorForces colors on or off for pretty.
[files...]Restricts the report to these TSX or JSX files. Types still come from the project.

JSON report

FieldTypeDescription
tool{ name, version }@kitajs/html-cli and its version.
typescriptstringVersion of the TypeScript package that ran the check.
projectsstring[]Checked tsconfig.json files, relative to the working directory.
summary{ filesChecked, errors, warnings }Counts for the whole run.
diagnostics[].filestringPath relative to the working directory, with forward slashes.
diagnostics[].codenumber88601 to 88604. id holds the TS88601 form.
diagnostics[].severity"error" | "warning"TS88604 is a warning. Every other code is an error.
diagnostics[].messagestringDiagnostic text. url links to its documentation.
diagnostics[].start, end{ line, column, offset }1-based line and column in UTF-16 code units, 0-based offset.

Diagnostics are sorted by file and position.

Exit codes

CodeMeaning
0No findings.
1At least one error (TS88601, TS88602, TS88603), or invalid flags or configuration.
2Only warnings (TS88604).
127Unknown command.