Babel plugin that automatically adds displayName properties to React class components created with createClass
Overall
score
96%
{
"context": "Evaluates whether the solution wires up the display-name injection plugin to transform createClass-style React components. Confirms displayName inference from surrounding identifiers and preservation of existing names as described in the spec.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Plugin enabled",
"description": "Configures and invokes babel-plugin-transform-react-display-name in the transform pipeline (via Babel config or direct plugin usage) instead of manually editing source.",
"max_score": 25
},
{
"name": "Variable names",
"description": "Uses the plugin to inject displayName values derived from variable declarators holding createClass calls (e.g., const Fancy = ... -> displayName 'Fancy').",
"max_score": 25
},
{
"name": "Member targets",
"description": "Uses the plugin to derive displayName strings from assignment targets that are member expressions (e.g., Library.Widget = createClass(...) -> displayName 'Library.Widget').",
"max_score": 20
},
{
"name": "Object keys",
"description": "Uses the plugin so createClass calls inside object literals pick up the property key as displayName (e.g., registry = { Widget: createClass(...) } -> displayName 'Widget').",
"max_score": 15
},
{
"name": "Preserves existing",
"description": "Relies on plugin behavior to leave existing displayName definitions unchanged rather than overwriting them.",
"max_score": 15
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-babel-plugin-transform-react-display-name