Babel plugin to ensure function declarations at the block level are block scoped
89
{
"context": "This criteria evaluates how effectively the engineer uses the @babel/plugin-transform-block-scoped-functions plugin to transform block-scoped function declarations. The focus is on proper plugin integration, configuration, and understanding of the transformation behavior in different contexts.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Plugin Integration",
"description": "Uses @babel/core's transform or transformSync method to apply the transformation pipeline to input code",
"max_score": 20
},
{
"name": "Plugin Configuration",
"description": "Correctly includes @babel/plugin-transform-block-scoped-functions in the Babel plugins array configuration",
"max_score": 25
},
{
"name": "Strict Mode Handling",
"description": "Demonstrates understanding that the plugin transforms all function declarations in blocks when in strict mode, as evidenced by test cases or implementation that correctly handles strict mode contexts",
"max_score": 20
},
{
"name": "Non-Strict Mode Handling",
"description": "Demonstrates understanding that the plugin only transforms async and generator functions in non-strict mode, while leaving regular functions untransformed, as shown by appropriate test cases or implementation logic",
"max_score": 20
},
{
"name": "Transformation Output",
"description": "The transformed code correctly converts function declarations to let-bound function expressions as produced by the plugin, maintaining the expected block-scoped behavior",
"max_score": 15
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-babel--plugin-transform-block-scoped-functions