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-1/

{
  "context": "Evaluates whether the solution configures Babel to rewrite sticky regex literals using @babel/plugin-transform-sticky-regex with @babel/core, relying on a Babel config plugin entry rather than manual regex handling. Focuses on correct transformation behavior for sticky vs non-sticky regex literals while preserving original flags.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Config entry",
      "description": "Babel configuration (e.g., babel.config.json) includes the @babel/plugin-transform-sticky-regex entry in the plugins list and the code loads/uses that config during compilation.",
      "max_score": 30
    },
    {
      "name": "Babel core usage",
      "description": "Compilation is executed through @babel/core APIs (such as transformSync or similar) rather than hand-written regex rewrites, demonstrating the expected peer dependency usage.",
      "max_score": 25
    },
    {
      "name": "Sticky rewrite",
      "description": "Sticky regex literals (/pattern/y, including combinations like /pattern/gy) are emitted as new RegExp(\"pattern\", \"<flags>\") with an identical pattern string and full flag set after transformation.",
      "max_score": 25
    },
    {
      "name": "Non-sticky untouched",
      "description": "Regex literals without the y flag remain unchanged in the compiled output, aligning with @babel/plugin-transform-sticky-regex behavior that targets only sticky regexes.",
      "max_score": 20
    }
  ]
}

Install with Tessl CLI

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

tile.json