CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-babel-plugin-transform-eval

Babel plugin that transforms eval() calls containing string literals by parsing and compiling the string content at transform time

Overall
score

98%

Overview
Eval results
Files

rubric.jsonevals/scenario-10/

{
  "context": "This evaluation assesses how well the engineer uses Babel's plugin API and AST manipulation capabilities to transform Node.js built-in imports to polyfills. The focus is on proper use of Babel types, visitor pattern, and node manipulation methods.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Plugin structure",
      "description": "Uses correct Babel plugin factory function signature that accepts babel parameter and returns an object with visitor property",
      "max_score": 10
    },
    {
      "name": "Babel types usage",
      "description": "Correctly destructures and uses babel.types (typically aliased as 't') for AST type checking and node creation",
      "max_score": 15
    },
    {
      "name": "ImportDeclaration visitor",
      "description": "Implements ImportDeclaration visitor method that receives a path parameter",
      "max_score": 15
    },
    {
      "name": "Source value access",
      "description": "Correctly accesses the import source using path.node.source.value or equivalent to get the module name string",
      "max_score": 15
    },
    {
      "name": "Node type checking",
      "description": "Uses Babel types methods (t.isStringLiteral or similar) to verify node types before manipulation",
      "max_score": 10
    },
    {
      "name": "Polyfill mapping logic",
      "description": "Implements logic to map Node.js built-in module names (fs, path, crypto) to their polyfill equivalents (browserify-fs, path-browserify, crypto-browserify)",
      "max_score": 15
    },
    {
      "name": "Node prefix handling",
      "description": "Handles the node: protocol prefix (e.g., node:fs) by stripping it before mapping to polyfills",
      "max_score": 10
    },
    {
      "name": "Source modification",
      "description": "Correctly modifies the import source by either mutating path.node.source.value or using t.stringLiteral() to create a new source node",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-babel-plugin-transform-eval

tile.json