Babel plugin to instrument React components with custom transforms
{
"context": "Evaluates how the solution configures and uses babel-plugin-react-transform to wrap React components while keeping export semantics intact and avoiding duplicate visits. Checks focus on plugin options, export rewrites for default and named exports, and the plugin's visited-marker behavior. General coding style is not assessed.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Plugin setup",
"description": "Babel processing includes babel-plugin-react-transform with a non-empty transforms array plus imports/locals so the plugin emits the _wrapComponent helper and _components metadata map for the file.",
"max_score": 20
},
{
"name": "Default export wrap",
"description": "Default-exported class components are rewritten by the plugin into a wrapped variable using _wrapComponent(id)(Class) while preserving the export default binding (no loss or renaming of the default export).",
"max_score": 20
},
{
"name": "Named export wrap",
"description": "Named class exports remain exported under the same names after wrapping (e.g., inline classes or re-exports still export the wrapped identifier), relying on babel-plugin-react-transform’s export-safe rewrites rather than manual export changes.",
"max_score": 15
},
{
"name": "Visited guard",
"description": "Visitor logic uses the plugin’s VISITED_KEY marker on AST nodes (checking path.node[VISITED_KEY] before wrapping and setting it after) to avoid processing the same component twice.",
"max_score": 25
},
{
"name": "Idempotent output",
"description": "Running babel-plugin-react-transform multiple times on the same source produces identical output with exactly one _wrapComponent call per detected component, demonstrating visit deduping and absence of double wrapping.",
"max_score": 20
}
]
}tessl i tessl/npm-babel-plugin-react-transform@3.0.0evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9