Babel plugin that transforms ECMAScript object rest and spread syntax into ES5-compatible code.
85
Quality
Pending
Does it follow best practices?
Impact
85%
1.06xAverage score across 10 eval scenarios
Pending
The risk profile of this skill
{
"context": "This criteria evaluates how well the engineer uses Babel's AST pattern matching capabilities to analyze JavaScript code and identify unused functions. The focus is on proper usage of @babel/parser for parsing, @babel/traverse for AST traversal with visitor patterns, and @babel/types for node type checking and scope analysis.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Parse code to AST",
"description": "Uses @babel/parser.parse() or @babel/parser.parseExpression() to convert the input code string into an Abstract Syntax Tree",
"max_score": 15
},
{
"name": "Traverse with visitors",
"description": "Uses @babel/traverse with visitor pattern to walk the AST, defining handlers for specific node types (e.g., FunctionDeclaration, FunctionExpression, VariableDeclarator)",
"max_score": 25
},
{
"name": "Identify function patterns",
"description": "Uses @babel/types type checking methods (e.g., t.isFunctionDeclaration, t.isFunctionExpression, t.isIdentifier) to identify function declarations and function expressions in the AST",
"max_score": 20
},
{
"name": "Track bindings",
"description": "Uses the Path API's scope property or binding analysis to track where functions are declared and referenced (e.g., path.scope.getBinding(), binding.referenced, binding.referencePaths)",
"max_score": 25
},
{
"name": "Extract node metadata",
"description": "Correctly extracts function names and line numbers from AST nodes using node properties (e.g., node.id.name for function names, node.loc.start.line for line numbers)",
"max_score": 10
},
{
"name": "Error handling",
"description": "Handles parsing errors appropriately by catching exceptions from @babel/parser and throwing or returning appropriate error messages as specified in the API",
"max_score": 5
}
]
}docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10