JSX parsing plugin for the Acorn JavaScript parser that enables fast parsing of React JSX syntax
76
{
"context": "This criteria evaluates how well the engineer uses the acorn-jsx package to detect and validate empty expression containers in JSX attributes. The focus is on proper integration of acorn-jsx as a parser plugin and leveraging its built-in validation capabilities.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Parser initialization",
"description": "Uses acorn.Parser.extend(jsx()) to create a JSX-enabled parser, correctly importing both acorn and acorn-jsx packages",
"max_score": 25
},
{
"name": "Parse invocation",
"description": "Calls the Parser.parse() method with the JSX source code string to trigger parsing and validation",
"max_score": 20
},
{
"name": "Error handling",
"description": "Uses try-catch to capture parsing errors thrown by acorn-jsx when empty expressions are encountered in attributes",
"max_score": 25
},
{
"name": "Error detection",
"description": "Correctly identifies the specific error for empty attribute expressions (error message contains 'JSX attributes must only be assigned a non-empty expression' or similar validation error)",
"max_score": 20
},
{
"name": "Parser options",
"description": "Provides appropriate parser options to Parser.parse() such as ecmaVersion and sourceType to ensure proper JSX parsing",
"max_score": 10
}
]
}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