ECMAScript code generator that transforms Mozilla's Parser API ASTs back into executable JavaScript code
95
{
"context": "This criteria evaluates how well the engineer uses escodegen's precedence-based parenthesization capabilities to generate properly parenthesized JavaScript code from ASTs. The focus is on using escodegen.generate() with appropriate options to control parenthesis insertion based on operator precedence rules.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses escodegen.generate",
"description": "Uses escodegen.generate() function as the primary method to transform AST nodes into JavaScript code",
"max_score": 25
},
{
"name": "Passes parentheses option",
"description": "Correctly passes the 'parentheses' option to escodegen.generate() to control whether optional parentheses are included (true) or minimized (false)",
"max_score": 25
},
{
"name": "Handles AST input",
"description": "Properly accepts and passes Mozilla Parser API compliant AST nodes to escodegen.generate() without manual transformation",
"max_score": 20
},
{
"name": "Leverages precedence handling",
"description": "Relies on escodegen's built-in precedence-based parenthesization logic rather than manually adding or removing parentheses in the AST or output string",
"max_score": 30
}
]
}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