CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-babel-plugin-transform-eval

Babel plugin that transforms eval() calls containing string literals by parsing and compiling the string content at transform time

Overall
score

98%

Overview
Eval results
Files

task.mdevals/scenario-1/

Console Transform Plugin

A Babel plugin that transforms console method calls with configurable prefixes and optional method filtering.

Capabilities

Prefix configuration validation

  • The plugin accepts a prefix option as a string and prepends it to console messages @test
  • The plugin throws a validation error when prefix option is provided but is not a string @test

Method filtering validation

  • The plugin accepts a methods option as an array of strings to filter which console methods to transform @test
  • The plugin throws a validation error when methods option is provided but is not an array @test
  • The plugin throws a validation error when methods array contains non-string values @test

Required options validation

  • The plugin throws a validation error when no options are provided at all @test

Default behavior

  • When only prefix is provided without methods, all console methods are transformed @test

Implementation

@generates

API

/**
 * A Babel plugin that transforms console method calls
 *
 * @param {Object} babel - The Babel API object
 * @param {Object} options - Plugin options
 * @param {string} options.prefix - Required prefix to prepend to console messages
 * @param {string[]} [options.methods] - Optional array of console method names to transform
 * @returns {Object} Babel plugin object with visitor
 */
module.exports = function(babel, options) {
  // IMPLEMENTATION HERE
};

Dependencies { .dependencies }

@babel/core { .dependency }

Provides the core Babel transformation and plugin API including schema validation utilities.

@satisfied-by

@babel/helper-plugin-utils { .dependency }

Provides utilities for creating Babel plugins with proper option handling.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-babel-plugin-transform-eval

tile.json