CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-babel-plugin-transform-es2015-sticky-regex

Babel plugin that transforms ES2015 sticky regex literals to ES5-compatible RegExp constructor calls

Overall
score

100%

Overview
Eval results
Files

rubric.jsonevals/scenario-6/

{
  "context": "Evaluates whether the solution uses @babel/plugin-transform-sticky-regex with @babel/core to rewrite sticky regex literals while preserving other regex usage. Scoring checks plugin configuration, transformed output for sticky literals, and that non-sticky literals and RegExp constructors remain unchanged.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Plugin wiring",
      "description": "Includes @babel/plugin-transform-sticky-regex in the plugins array passed to @babel/core.transformSync (or equivalent transform) rather than hand-rolled regex rewriting.",
      "max_score": 20
    },
    {
      "name": "Sticky rewrite",
      "description": "Babel output shows sticky regex literals rewritten by the plugin into new RegExp(\"pattern\",\"flags\") constructor calls, matching the plugin's default formatting for examples like /abc/y.",
      "max_score": 30
    },
    {
      "name": "Flag preservation",
      "description": "Transformed code retains all original flags when sticky is present (e.g., /foo/gy -> new RegExp(\"foo\",\"gy\")), demonstrating reliance on the plugin's handling of flags.",
      "max_score": 20
    },
    {
      "name": "Non-sticky untouched",
      "description": "Outputs from the Babel transform keep non-sticky regex literals exactly as authored, showing the plugin was allowed to leave them unchanged.",
      "max_score": 15
    },
    {
      "name": "RegExp constructors",
      "description": "Existing new RegExp(...) constructor calls remain unaltered in the transform output, reflecting that the plugin's scope is limited to regex literals.",
      "max_score": 15
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-babel-plugin-transform-es2015-sticky-regex

tile.json