Babel plugin that compiles ES2015 default and rest parameters to ES5-compatible code
91
{
"context": "This criteria evaluates the engineer's ability to use @babel/types and related Babel packages for AST node manipulation. The focus is on proper usage of node builders, traversal patterns, and code generation from modified AST structures.",
"type": "weighted_checklist",
"checklist": [
{
"name": "AST parsing",
"description": "Uses @babel/parser to parse the source code into an AST with appropriate options (e.g., parse() function with source type configuration)",
"max_score": 15
},
{
"name": "AST traversal",
"description": "Uses @babel/traverse to visit CallExpression nodes in the AST using the visitor pattern",
"max_score": 20
},
{
"name": "Node type checking",
"description": "Uses @babel/types validator functions (e.g., isIdentifier, isMemberExpression) to check node types before manipulation",
"max_score": 15
},
{
"name": "Node builders",
"description": "Uses @babel/types builder functions (e.g., callExpression, memberExpression, stringLiteral, sequenceExpression) to create new AST nodes for the logging wrapper",
"max_score": 25
},
{
"name": "Node replacement",
"description": "Uses path.replaceWith() or similar methods from @babel/traverse to replace the original CallExpression with the wrapped version",
"max_score": 15
},
{
"name": "Code generation",
"description": "Uses @babel/generator to convert the modified AST back to JavaScript source code (e.g., generate() function)",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-babel--plugin-transform-parametersdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10