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

{
  "context": "Evaluates how the solution leverages @babel/plugin-transform-sticky-regex within a Babel transform to rewrite sticky regex literals while respecting non-sticky cases. Focuses purely on correct plugin configuration and expected transformation outcomes tied to the provided spec.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Plugin use",
      "description": "Transforms code via Babel with @babel/plugin-transform-sticky-regex active (for example, listed in the plugins array) instead of manual regex rewrites.",
      "max_score": 30
    },
    {
      "name": "Sticky rewrite",
      "description": "With the plugin enabled, /foo/y is emitted as new RegExp(\"foo\", \"y\") or equivalent output produced by the plugin.",
      "max_score": 25
    },
    {
      "name": "Flag preservation",
      "description": "Combined flags such as /ab+c/gy are preserved exactly in the constructor call emitted by @babel/plugin-transform-sticky-regex.",
      "max_score": 20
    },
    {
      "name": "Non-sticky passthrough",
      "description": "Non-sticky literals like /bar/g remain untouched when processed through the plugin.",
      "max_score": 15
    },
    {
      "name": "Constructor untouched",
      "description": "Existing RegExp constructor usages (for example, new RegExp(\"foo\", \"y\")) are left unchanged by the plugin-driven transform.",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

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

tile.json