CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-escodegen

ECMAScript code generator that transforms Mozilla's Parser API ASTs back into executable JavaScript code

95

1.07x
Overview
Eval results
Files

rubric.jsonevals/scenario-6/

{
  "context": "This criteria evaluates how well the engineer uses escodegen's comprehensive JavaScript syntax support to generate modern ECMAScript code from AST nodes. The focus is on correct usage of the escodegen.generate() function with proper AST node structures for ES6+ features.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Import escodegen",
      "description": "Correctly imports or requires the escodegen package (e.g., `const escodegen = require('escodegen')` or `import escodegen from 'escodegen'`)",
      "max_score": 10
    },
    {
      "name": "Use generate function",
      "description": "Uses escodegen.generate() function to convert AST nodes to JavaScript code strings",
      "max_score": 15
    },
    {
      "name": "Arrow function AST",
      "description": "Correctly constructs or handles AST nodes for arrow functions (ArrowFunctionExpression type) with proper parameter and body structure",
      "max_score": 20
    },
    {
      "name": "Async/await AST",
      "description": "Correctly constructs or handles AST nodes for async functions (async: true flag on FunctionDeclaration/FunctionExpression) and await expressions (AwaitExpression type)",
      "max_score": 20
    },
    {
      "name": "Optional chaining AST",
      "description": "Correctly constructs or handles AST nodes for optional chaining operator (ChainExpression with optional: true on member/call expressions)",
      "max_score": 20
    },
    {
      "name": "Class syntax AST",
      "description": "Correctly constructs or handles AST nodes for class declarations (ClassDeclaration/ClassExpression) with constructor and method definitions (MethodDefinition type)",
      "max_score": 15
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-escodegen

tile.json