ECMAScript code generator that transforms Mozilla's Parser API ASTs back into executable JavaScript code
95
{
"context": "This criteria evaluates how effectively the engineer uses escodegen's core code generation functionality to transform AST nodes into JavaScript code. The focus is on proper usage of escodegen's API, including the generate() function and formatting options.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses generate() function",
"description": "Uses escodegen.generate() as the primary method to convert AST nodes to JavaScript code",
"max_score": 30
},
{
"name": "Basic AST handling",
"description": "Correctly passes Mozilla Parser API compliant AST nodes (with properties like type, operator, left, right, value) to escodegen.generate()",
"max_score": 20
},
{
"name": "Formatting options",
"description": "Uses escodegen's formatting options parameter (second argument to generate()) to control output style, such as using FORMAT_MINIFY preset or custom format options for compact vs readable output",
"max_score": 25
},
{
"name": "Default formatting",
"description": "Leverages escodegen's built-in format presets (FORMAT_MINIFY, FORMAT_DEFAULTS) or equivalent custom options rather than implementing custom formatting logic",
"max_score": 15
},
{
"name": "Correct output",
"description": "The generated code from escodegen.generate() is returned as-is or with minimal processing, demonstrating trust in escodegen's correct handling of operator precedence and parenthesization",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-escodegendocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10