Babel plugin that compiles ES2015 computed properties to ES5-compatible code
88
{
"context": "This evaluation assesses how well the engineer uses Babel's AST transformation APIs to convert ObjectMethod nodes with computed keys into function expressions, preserving async/generator flags and properly handling the transformation within object expressions.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Visitor pattern usage",
"description": "Uses Babel's visitor pattern to target ObjectExpression nodes and processes them appropriately",
"max_score": 15
},
{
"name": "ObjectMethod detection",
"description": "Correctly identifies ObjectMethod nodes within object properties using t.isObjectMethod() or equivalent type checking",
"max_score": 15
},
{
"name": "Computed property check",
"description": "Filters for computed properties using the 'computed' flag or property on ObjectMethod nodes",
"max_score": 15
},
{
"name": "Function expression conversion",
"description": "Converts ObjectMethod to FunctionExpression using t.functionExpression() or t.toExpression() helper",
"max_score": 20
},
{
"name": "Async flag preservation",
"description": "Preserves the 'async' flag when creating function expressions from async computed methods",
"max_score": 15
},
{
"name": "Generator flag preservation",
"description": "Preserves the 'generator' flag when creating function expressions from generator computed methods",
"max_score": 15
},
{
"name": "Property replacement",
"description": "Replaces the ObjectMethod with an ObjectProperty containing the function expression using appropriate node construction (t.objectProperty())",
"max_score": 5
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-babel-plugin-transform-es2015-computed-propertiesdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10