Babel plugin that automatically adds displayName properties to React class components created with createClass
Overall
score
96%
{
"context": "Assesses how well the solution uses @babel/plugin-transform-react-display-name to inject displayName values for React createClass calls by leveraging the plugin's ancestry crawling behavior across assignments, member expressions, and nested call wrappers while preserving existing names.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Plugin wired",
"description": "Babel transform invokes @babel/plugin-transform-react-display-name (e.g., via @babel/core transform options) rather than reimplementing displayName injection manually.",
"max_score": 20
},
{
"name": "Property inference",
"description": "Transformation relies on the plugin to derive displayName from object property keys when createClass calls are values (matching the object-property test), producing the expected injected name.",
"max_score": 20
},
{
"name": "Member assignment",
"description": "Uses the plugin's capability to read member expression targets (e.g., registry.Widget) so the injected displayName matches the right-most property name without extra custom parsing.",
"max_score": 20
},
{
"name": "Wrapped assignment",
"description": "Leverages the plugin's nested ancestry crawl to infer displayName from the left-hand identifier when createClass is wrapped inside another call on assignment (e.g., wrap(createClass(...))).",
"max_score": 20
},
{
"name": "Preserves explicit",
"description": "Configuration ensures @babel/plugin-transform-react-display-name leaves existing displayName properties untouched, demonstrating awareness of the plugin's skip-when-present behavior.",
"max_score": 20
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-babel-plugin-transform-react-display-name