Babel helper functions for inserting module loads
Overall
score
99%
{
"context": "This criteria evaluates how well the engineer uses Babel's JSX parsing and AST traversal capabilities to analyze JSX code. The focus is on correct usage of @babel/parser for parsing JSX syntax and @babel/traverse for walking the AST to extract element information.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Parse JSX source",
"description": "Uses @babel/parser's parse() or parseExpression() function to parse the JSX source code into an AST. Should include appropriate parser options for JSX syntax (e.g., plugins: ['jsx']).",
"max_score": 25
},
{
"name": "Traverse AST",
"description": "Uses @babel/traverse (or its default export) to traverse the parsed AST and visit JSX-related nodes.",
"max_score": 20
},
{
"name": "Identify JSX elements",
"description": "Correctly identifies JSX opening elements by visiting JSXOpeningElement or JSXElement nodes in the AST.",
"max_score": 20
},
{
"name": "Extract element names",
"description": "Accesses the JSX element name from the AST node structure (e.g., through node.name.name for JSXIdentifier) to retrieve element names like 'div', 'Button', etc.",
"max_score": 15
},
{
"name": "Detect self-closing elements",
"description": "Uses the selfClosing property available on JSXOpeningElement nodes to identify self-closing tags.",
"max_score": 10
},
{
"name": "Distinguish component types",
"description": "Differentiates between HTML tags and custom components by checking the first character case of the element name (lowercase vs PascalCase).",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-babel--helper-module-importsevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10