Format JavaScript Standard Style as Stylish (i.e. snazzy) output
94
Create a command-line tool that transforms JSON linter output into a stylish, human-readable format with colorized output. The tool should read linter results from stdin and output formatted results to stdout.
Your CLI tool must:
--stdin or -)The tool will receive JSON input in this format:
[
{
"filePath": "src/example.js",
"messages": [
{
"line": 15,
"column": 7,
"message": "Missing semicolon.",
"ruleId": "semi"
},
{
"line": 23,
"column": 12,
"message": "Unexpected var, use let or const instead.",
"ruleId": "no-var"
}
]
},
{
"filePath": "src/utils.js",
"messages": [
{
"line": 8,
"column": 3,
"message": "Expected indentation of 2 spaces.",
"ruleId": "indent"
}
]
}
]The formatted output should look like:
src/example.js
15:7 error Missing semicolon semi
23:12 error Unexpected var, use let or const instead no-var
src/utils.js
8:3 error Expected indentation of 2 spaces indent
✖ 3 problemsThe formatted output should include:
Provides stream-based transformation of compact linter output to stylish format.
@generates
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