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

{
  "context": "Evaluates whether the solution routes source code through @babel/plugin-transform-sticky-regex using Babel APIs to preserve non-sticky regex literals while still converting sticky ones. Checks focus solely on correct plugin configuration and observable transform output for sticky versus non-sticky patterns.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Uses plugin",
      "description": "Configures Babel transformation with @babel/plugin-transform-sticky-regex in the plugins list when invoking transformSync or transformAsync.",
      "max_score": 25
    },
    {
      "name": "Babel API",
      "description": "Invokes @babel/core transformation entry points (e.g., transformSync/transformAsync) instead of manual string rewriting, passing source through the plugin-enabled pipeline.",
      "max_score": 10
    },
    {
      "name": "Plain literals intact",
      "description": "Output for inputs like const re = /abc/; keeps the literal unchanged with no new RegExp wrapper when the plugin runs.",
      "max_score": 20
    },
    {
      "name": "Non-sticky flags kept",
      "description": "Outputs for non-sticky flags (e.g., /foo/gim) remain literals with the same flags and are not converted to RegExp constructors.",
      "max_score": 20
    },
    {
      "name": "Sticky transformed",
      "description": "Sticky literals (e.g., /bar/y) are emitted as new RegExp(\"bar\",\"y\") preserving the pattern text and sticky flag as produced by the plugin.",
      "max_score": 25
    }
  ]
}

Install with Tessl CLI

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

tile.json