CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-cjs-module-lexer

High-performance CommonJS module lexer for detecting named exports and reexports from JavaScript source code

93

0.98x

Quality

Pending

Does it follow best practices?

Impact

93%

0.98x

Average score across 10 eval scenarios

Overview
Eval results
Files

rubric.jsonevals/scenario-5/

{
  "context": "This criteria evaluates how effectively the engineer uses the cjs-module-lexer package to extract and validate JavaScript identifiers, with focus on leveraging the package's grammar validation capabilities for ECMA-262 identifiers and surrogate pairs.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Uses parse function",
      "description": "Correctly uses the cjs-module-lexer `parse()` function to analyze JavaScript source code",
      "max_score": 25
    },
    {
      "name": "Extracts exports correctly",
      "description": "Extracts identifiers from the `exports` array returned by `parse()` function",
      "max_score": 20
    },
    {
      "name": "Handles Unicode identifiers",
      "description": "Solution correctly handles Unicode identifiers including multi-byte characters, leveraging the lexer's built-in Unicode support",
      "max_score": 20
    },
    {
      "name": "Validates surrogate pairs",
      "description": "Correctly processes identifiers containing UTF-16 surrogate pairs, relying on the lexer's surrogate pair validation",
      "max_score": 20
    },
    {
      "name": "Filters reserved words",
      "description": "Identifies and filters out JavaScript reserved words from valid identifiers, using the lexer's strict reserved word filtering",
      "max_score": 15
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-cjs-module-lexer

tile.json