Format JavaScript Standard Style as Stylish (i.e. snazzy) output
94
A tool that programmatically processes JavaScript linter output, formats it into a readable display, and tracks error statistics.
The processor must handle JSON strings containing linter results in compact format. The input format follows the standard linter output structure with an array of results, where each result contains a file path and an array of messages.
Example input format:
[
{
"filePath": "src/example.js",
"messages": [
{"line": 10, "column": 5, "message": "Missing semicolon.", "ruleId": "semi"}
]
}
]The processor must track whether errors were found and expose this information via an exit code property.
The processor must work with Node.js streams, allowing it to be composed in stream pipelines.
@generates
/**
* Creates a processor that formats linter output.
*
* @param {string} linterJson - JSON string containing linter results in compact format
* @returns {Promise<{formatted: string, exitCode: number}>} The formatted output and exit code
*/
async function processLinterOutput(linterJson) {
// IMPLEMENTATION HERE
}
module.exports = {
processLinterOutput
};Provides linter output formatting from compact to stylish format.
Install with Tessl CLI
npx tessl i tessl/npm-snazzydocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10