Babel plugin that compiles ES2015 default and rest parameters to ES5-compatible code
91
{
"context": "This criteria evaluates how well the engineer uses Babel's module transformation capabilities, specifically the core transformation API and module system plugins, to convert ES Module syntax to CommonJS format.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses @babel/core",
"description": "Uses @babel/core's transformation functions (transform, transformSync, or transformAsync) to process the input code",
"max_score": 25
},
{
"name": "Applies module plugin",
"description": "Applies @babel/plugin-transform-modules-commonjs plugin in the Babel configuration to transform ES modules to CommonJS",
"max_score": 30
},
{
"name": "Returns transformed code",
"description": "Extracts and returns the transformed code from the Babel transformation result (typically result.code)",
"max_score": 15
},
{
"name": "Named imports conversion",
"description": "Successfully converts named imports (import { foo } from 'module') to CommonJS require with destructuring or property access",
"max_score": 10
},
{
"name": "Default imports conversion",
"description": "Successfully converts default imports (import foo from 'module') to CommonJS require with appropriate default handling",
"max_score": 5
},
{
"name": "Namespace imports conversion",
"description": "Successfully converts namespace imports (import * as foo from 'module') to require the entire module",
"max_score": 5
},
{
"name": "Exports conversion",
"description": "Successfully converts export statements (both named and default) to CommonJS exports",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-babel--plugin-transform-parametersdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10