This site uses cookies for analytics. By continuing to browse this site, you agree to this use.
A JS Foundation Project

Formatters

Formatters

A formatter takes the results of executing the configured hints and transforms them to be consumed by the user. A formatter can output the results via the console in different formats, a JSON file, XML, etc.

You can specify one or more formatters as the output. E.g.: You want a summary in the screen as well as a text report. You need to add the name inside the property formatters:

{
"formatters": "formatter1"
}

or

{
"formatters": [
"formatter1",
"formatter2"
]
}

List of official formatters

The officially supported formatters that can be installed via npm are:

Example output for the json formatter

Example output for the stylish formatter

Example output for the codeframe formatter

Example output for the summary formatter

Example output for the summary sheet of the excel formatter

Example output for one of the details sheet of the excel formatter

  • @hint/formatter-html creates an HTML page in the folder hint-report/<url_analyzed> with the result:

Example out for the HTML result of the html formatter

Note: If you are running customs hints the buttons Why is this important and How to solve it will not work.

If you want to implement your own formatter, visit the contributor guide