Format JavaScript Standard Style as Stylish (i.e. snazzy) output
94
Build a command-line tool that analyzes code quality reports and exits with appropriate status codes for CI/CD pipeline integration.
Your tool should read JSON-formatted code quality reports from stdin and output a summary to stdout. The tool must set appropriate exit codes based on the analysis results to enable proper CI/CD integration.
The tool receives JSON data via stdin with the following structure:
{
"files": [
{
"path": "src/app.js",
"issues": [
{"severity": "error", "message": "Undefined variable"},
{"severity": "warning", "message": "Unused import"}
]
}
]
}Display a summary showing:
Exit code behavior:
0 if no errors are found (warnings are acceptable)1 if one or more errors are found@generates
/**
* Analyzes code quality reports and sets appropriate exit codes.
* Extends Transform stream to process JSON input from stdin.
*/
class CodeAnalyzer extends require('stream').Transform {
constructor(options);
/**
* Exit code to be set based on analysis results.
* 0 = no errors found, 1 = errors detected
*/
exitCode: number;
}
module.exports = CodeAnalyzer;Provides Node.js stream support for processing stdin data.
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