CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-acorn-jsx

tessl install tessl/npm-acorn-jsx@5.3.0

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

Agent Success

Agent success rate when using this tile

76%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.69x

Baseline

Agent success rate without this tile

45%

rubric.jsonevals/scenario-1/

{
  "context": "This criteria evaluates how well the engineer uses the acorn-jsx package to parse and analyze JSX code with recursive nesting. The focus is on correctly using acorn-jsx's parsing capabilities to handle JSX elements nested within expression containers.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Parser initialization",
      "description": "Correctly extends Acorn parser with JSX support using acorn.Parser.extend() and the jsx plugin (e.g., const Parser = acorn.Parser.extend(jsx());)",
      "max_score": 15
    },
    {
      "name": "Parse method usage",
      "description": "Calls Parser.parse() method to parse the JSX code string into an AST with appropriate options (e.g., ecmaVersion, sourceType)",
      "max_score": 10
    },
    {
      "name": "JSXElement recognition",
      "description": "Correctly identifies and processes JSXElement nodes in the AST (checking node.type === 'JSXElement')",
      "max_score": 15
    },
    {
      "name": "JSXExpressionContainer handling",
      "description": "Correctly identifies and processes JSXExpressionContainer nodes (checking node.type === 'JSXExpressionContainer') to detect JSX within expressions",
      "max_score": 20
    },
    {
      "name": "Recursive traversal",
      "description": "Implements recursive AST traversal to handle arbitrarily nested JSX-in-expression-in-JSX structures, tracking depth through the recursion",
      "max_score": 20
    },
    {
      "name": "JSX element naming",
      "description": "Correctly extracts element names from JSXIdentifier nodes within JSXElement.openingElement.name",
      "max_score": 10
    },
    {
      "name": "Location tracking",
      "description": "Uses AST node location information (node.loc or node.start/node.line) to report line numbers of nested elements",
      "max_score": 10
    }
  ]
}

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/acorn-jsx@5.3.x
tile.json