This project exposes the available formatters from the CLI for users that perform custom validation through Javascript.
import { pretty } from "@stoplight/spectral-formatters";
const spectral = new Spectral();
// ...
const result = await spectral.run(document);
// You can also filter the results here.
const output = pretty(result);
console.error(output);
// ...
- json
- stylish
- junit
- html
- text
- teamcity
- markdown (example: markdown_example.md)
- pretty
- github-actions
- sarif
- gitlab
- code-climate