CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-babel--plugin-transform-block-scoped-functions

Babel plugin to ensure function declarations at the block level are block scoped

89

1.04x
Overview
Eval results
Files

task.mdevals/scenario-5/

Babel Plugin Configuration Manager

A utility that demonstrates integration with the Babel plugin ecosystem by creating a configurable transformation pipeline.

Capabilities

Plugin Configuration

Build a system that correctly configures and applies the block-scoped functions transformation plugin along with related Babel plugins.

  • Given a JavaScript source file containing block-scoped function declarations, the configuration manager applies the transformation plugin and returns the transformed code @test
  • When multiple plugins are configured in sequence, the manager applies them in the correct order and produces properly transformed output @test
  • The manager correctly detects and handles strict mode contexts when applying transformations @test

Plugin Metadata Integration

Integrate with Babel's plugin metadata system to coordinate transformations.

  • When async generator functions are present, the manager correctly reads and uses plugin metadata to ensure proper transformation @test

Implementation

@generates

API

/**
 * 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,
};

Dependencies { .dependencies }

@babel/plugin-transform-block-scoped-functions { .dependency }

Provides block-scoped function transformation capabilities.

@satisfied-by

@babel/core { .dependency }

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

tile.json