Helper function to get function arity by analyzing parameter lists for assignment patterns and rest parameters
95
{
"context": "This criteria evaluates how effectively an engineer uses @babel/helper-get-function-arity within a Babel plugin to analyze function parameter lists and determine required parameter counts.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Import getFunctionArity",
"description": "Correctly imports the getFunctionArity function from @babel/helper-get-function-arity package",
"max_score": 15
},
{
"name": "Babel plugin structure",
"description": "Returns a valid Babel plugin object with a visitor property containing function node visitors",
"max_score": 20
},
{
"name": "Function node visiting",
"description": "Implements visitor methods for function-type nodes (Function, FunctionDeclaration, FunctionExpression, or ArrowFunctionExpression) to traverse all functions in the code",
"max_score": 20
},
{
"name": "Call getFunctionArity",
"description": "Calls getFunctionArity with the function node (path.node) to determine the required parameter count",
"max_score": 25
},
{
"name": "Add leading comment",
"description": "Uses Babel's addComment method or similar API to add a leading comment to the function with the format indicating required parameter count",
"max_score": 20
}
]
}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