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 effectively the engineer uses @babel/parser and @babel/traverse to analyze JavaScript code and identify unused variables. The focus is on proper usage of the visitor pattern, scope analysis APIs, and binding tracking capabilities provided by Babel's traversal system.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Parser usage",
"description": "Uses @babel/parser (or its parse function) to convert the source code string into an AST. The code should call parse() or similar function from @babel/parser.",
"max_score": 15
},
{
"name": "Traverse invocation",
"description": "Uses the traverse function from @babel/traverse to walk the AST. The solution should import and call traverse() with the AST and a visitor object.",
"max_score": 20
},
{
"name": "Visitor pattern implementation",
"description": "Implements a visitor object with appropriate node type handlers (e.g., VariableDeclarator, Identifier, FunctionDeclaration) to process variable declarations. The visitor should follow Babel's visitor pattern with methods corresponding to AST node types.",
"max_score": 20
},
{
"name": "Scope API usage",
"description": "Uses the Path API's scope property to access binding information. This should include using methods like path.scope.getBinding(), path.scope.bindings, or similar scope analysis methods to track variable declarations and references.",
"max_score": 25
},
{
"name": "Binding reference tracking",
"description": "Uses binding.referenced or binding.references to determine if a declared variable is actually used in the code. The solution should check the binding's reference count or reference list to identify unused variables.",
"max_score": 15
},
{
"name": "Location extraction",
"description": "Extracts line number information from AST nodes using node.loc.start.line or similar location properties to include in the output for each unused variable.",
"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