Babel plugin to ensure function declarations at the block level are block scoped
89
{
"context": "This criteria evaluates how well the engineer uses @babel/plugin-transform-block-scoped-functions and @babel/core to build a transformation pipeline that integrates with Babel's plugin ecosystem, including proper plugin configuration, ordering, and metadata handling.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses @babel/core transform API",
"description": "Uses @babel/core's transform() or transformSync() function to transform JavaScript code with plugins configured",
"max_score": 20
},
{
"name": "Configures block-scoped functions plugin",
"description": "Correctly includes @babel/plugin-transform-block-scoped-functions in the Babel plugins array configuration",
"max_score": 15
},
{
"name": "Handles plugin ordering",
"description": "Demonstrates understanding of Babel plugin execution order by correctly ordering plugins in the configuration when multiple plugins are present",
"max_score": 15
},
{
"name": "Integrates with strict mode",
"description": "Properly handles strict mode by configuring the source type or using appropriate Babel options that affect how the block-scoped functions plugin processes code",
"max_score": 15
},
{
"name": "Coordinates with async generator plugin",
"description": "When async generators are present, includes @babel/plugin-transform-async-generator-functions in the configuration to enable proper metadata coordination with the block-scoped functions plugin",
"max_score": 15
},
{
"name": "Returns transformed code properly",
"description": "Correctly extracts and returns the transformed code from Babel's transformation result object (accessing the 'code' property)",
"max_score": 10
},
{
"name": "Creates reusable Babel configuration",
"description": "Implements createBabelConfig() to generate a valid Babel configuration object with a plugins array that can be passed to Babel's transform functions",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-babel--plugin-transform-block-scoped-functions