Babel plugin that compiles ES2015 default and rest parameters to ES5-compatible code
91
{
"context": "This criteria evaluates how effectively the engineer uses @babel/parser to parse JavaScript source code and extract function information. The focus is on correct usage of the parser API, proper AST traversal, and accurate node type identification.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses parse function",
"description": "Code imports and uses the parse() function from @babel/parser (or parser.parse()) to convert source code into an AST",
"max_score": 20
},
{
"name": "Configures sourceType",
"description": "Code passes the sourceType option (from input options parameter) to the parser via the parse() function's options parameter",
"max_score": 15
},
{
"name": "Traverses AST",
"description": "Code traverses or walks the AST to find function declarations (e.g., checking node.type === 'FunctionDeclaration' or using visitor pattern)",
"max_score": 20
},
{
"name": "Extracts function names",
"description": "Code accesses the function name via AST node properties (e.g., node.id.name for FunctionDeclaration)",
"max_score": 10
},
{
"name": "Identifies default parameters",
"description": "Code correctly identifies parameters with default values by checking for AssignmentPattern nodes or examining node types in the params array",
"max_score": 15
},
{
"name": "Identifies rest parameters",
"description": "Code correctly identifies rest parameters by checking for RestElement node type in the params array",
"max_score": 15
},
{
"name": "Extracts line numbers",
"description": "Code accesses location information from the AST node (e.g., node.loc.start.line) to provide line numbers",
"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