Babel plugin that compiles ES2015 default and rest parameters to ES5-compatible code
91
{
"context": "This criteria evaluates how well the engineer uses Babel's plugin system to solve the console.log transformation problem. The focus is on proper use of Babel's core transformation API, visitor pattern implementation, and AST manipulation capabilities.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Plugin structure",
"description": "Uses babel.transform or babel.transformSync with a properly structured plugin object containing a visitor",
"max_score": 20
},
{
"name": "Visitor pattern",
"description": "Implements a visitor for CallExpression or MemberExpression nodes to locate console.log calls",
"max_score": 20
},
{
"name": "Scope traversal",
"description": "Uses path.scope or path.getFunctionParent() to determine the enclosing function context",
"max_score": 15
},
{
"name": "Function name retrieval",
"description": "Correctly retrieves the function name from the parent function node (e.g., FunctionDeclaration.id.name or FunctionExpression with assigned name)",
"max_score": 15
},
{
"name": "AST node creation",
"description": "Uses @babel/types builders (e.g., t.stringLiteral, t.arrayExpression) to create new AST nodes for the prepended context",
"max_score": 15
},
{
"name": "Node modification",
"description": "Correctly modifies the console.log arguments array using path.node.arguments or similar to prepend the context string",
"max_score": 10
},
{
"name": "Code generation",
"description": "Returns the transformed code string using the result from babel.transform (result.code)",
"max_score": 5
}
]
}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