JSX parsing plugin for the Acorn JavaScript parser that enables fast parsing of React JSX syntax
76
{
"context": "This criteria evaluates how effectively an engineer uses the acorn-jsx package to parse JSX code and identify spread attributes. The focus is on proper usage of the parser's AST generation capabilities and correct identification of JSXSpreadAttribute nodes.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Parser integration",
"description": "Correctly imports and integrates acorn-jsx with acorn using acorn.Parser.extend(jsx()) to create a JSX-capable parser instance",
"max_score": 20
},
{
"name": "AST generation",
"description": "Uses Parser.parse() to generate an AST from the input JSX code string with appropriate options (sourceType and locations enabled)",
"max_score": 15
},
{
"name": "AST traversal",
"description": "Implements proper tree traversal to visit all nodes in the AST, handling nested structures correctly",
"max_score": 15
},
{
"name": "JSXElement identification",
"description": "Correctly identifies nodes with type 'JSXElement' in the AST",
"max_score": 10
},
{
"name": "JSXSpreadAttribute detection",
"description": "Correctly identifies JSXSpreadAttribute nodes within the attributes array of JSXOpeningElement nodes",
"max_score": 25
},
{
"name": "Element name extraction",
"description": "Extracts the element name from the JSXIdentifier node in the opening element's name property",
"max_score": 10
},
{
"name": "Spread expression extraction",
"description": "Extracts the spread expression from the JSXSpreadAttribute's argument property, converting the expression node to source text",
"max_score": 5
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-acorn-jsxdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10