Helper function to get function arity by analyzing parameter lists for assignment patterns and rest parameters
95
{
"context": "This criteria evaluates how well the engineer uses @babel/helper-get-function-arity and related Babel packages to build a static analysis tool that examines function signatures and parameter requirements in JavaScript code.",
"type": "weighted_checklist",
"checklist": [
{
"name": "AST parsing",
"description": "Uses @babel/parser to parse the source code string into an Abstract Syntax Tree (AST)",
"max_score": 15
},
{
"name": "AST traversal",
"description": "Uses @babel/traverse to visit and identify function nodes in the AST",
"max_score": 20
},
{
"name": "Arity calculation",
"description": "Uses getFunctionArity from @babel/helper-get-function-arity to determine the number of required parameters for each function",
"max_score": 30
},
{
"name": "Parameter type detection",
"description": "Uses @babel/types utilities (such as isAssignmentPattern and isRestElement) to detect optional and rest parameters",
"max_score": 20
},
{
"name": "Function name extraction",
"description": "Correctly extracts function names from various function types or marks anonymous functions appropriately",
"max_score": 5
},
{
"name": "Summary statistics",
"description": "Correctly calculates aggregate metrics (totalFunctions, avgRequiredParams, highArityCount) from the collected function data",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-babel--helper-get-function-aritydocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10