Babel plugin to ensure function declarations at the block level are block scoped
89
A utility that demonstrates integration with the Babel plugin ecosystem by creating a configurable transformation pipeline.
Build a system that correctly configures and applies the block-scoped functions transformation plugin along with related Babel plugins.
Integrate with Babel's plugin metadata system to coordinate transformations.
@generates
/**
* Transforms JavaScript code using configured Babel plugins.
*
* @param {string} code - The source code to transform
* @param {Object} options - Configuration options
* @param {boolean} options.strictMode - Whether to enable strict mode transformations
* @param {Array<string>} options.additionalPlugins - Additional plugin names to apply
* @returns {Object} Result object with 'code' property containing transformed code
*/
function transform(code, options = {}) {
// IMPLEMENTATION HERE
}
/**
* Creates a Babel configuration object with the block-scoped functions plugin.
*
* @param {Object} options - Configuration options
* @param {boolean} options.includeAsyncGenerators - Whether to include async generator plugin
* @returns {Object} Babel configuration object with plugins array
*/
function createBabelConfig(options = {}) {
// IMPLEMENTATION HERE
}
module.exports = {
transform,
createBabelConfig,
};Provides block-scoped function transformation capabilities.
@satisfied-by
Provides the core Babel transformation engine and API.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-babel--plugin-transform-block-scoped-functions