CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-acorn-jsx

JSX parsing plugin for the Acorn JavaScript parser that enables fast parsing of React JSX syntax

76

1.68x
Overview
Eval results
Files

rubric.jsonevals/scenario-8/

{
  "context": "This criteria evaluates how well the engineer uses acorn-jsx to parse JSX boolean attributes. Boolean attributes in JSX are attributes without explicit values (e.g., <input disabled />), and acorn-jsx represents these with a null value in the AST.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "acorn-jsx integration",
      "description": "Uses acorn.Parser.extend(jsx()) to create a Parser with JSX support",
      "max_score": 20
    },
    {
      "name": "AST parsing",
      "description": "Calls Parser.parse() to parse the JSX code string into an AST",
      "max_score": 15
    },
    {
      "name": "JSXElement traversal",
      "description": "Traverses the AST to locate JSXElement nodes",
      "max_score": 15
    },
    {
      "name": "JSXOpeningElement access",
      "description": "Accesses the openingElement property of JSXElement nodes to get attributes",
      "max_score": 15
    },
    {
      "name": "Attribute filtering",
      "description": "Filters attributes array to identify JSXAttribute nodes where value is null (boolean attributes)",
      "max_score": 20
    },
    {
      "name": "Attribute name extraction",
      "description": "Extracts the attribute name from JSXAttribute.name.name property",
      "max_score": 10
    },
    {
      "name": "Result structure",
      "description": "Returns an array of objects with 'name' and 'value' properties, where value is null for boolean attributes",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-acorn-jsx

tile.json