CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-babel--plugin-proposal-object-rest-spread

Babel plugin that transforms ECMAScript object rest and spread syntax into ES5-compatible code.

85

1.06x

Quality

Pending

Does it follow best practices?

Impact

85%

1.06x

Average score across 10 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

task.mdevals/scenario-9/

Console Statement Remover Plugin

Create a Babel plugin that removes all console method calls (like console.log, console.warn, console.error, etc.) from JavaScript code during compilation.

Requirements

Your plugin should:

  1. Remove all statement-level console method calls (e.g., console.log('hello');)
  2. Remove console method calls that are expression statements
  3. Handle console calls with any method name (log, warn, error, debug, info, etc.)
  4. Preserve other code and not affect non-console statements
  5. Use the visitor pattern to traverse the AST

Test Cases

  • Given code with a single console.log('test') statement, the plugin removes it completely @test
  • Given code with multiple different console methods (console.log, console.warn, console.error), the plugin removes all of them @test
  • Given code with console statements mixed with other statements, the plugin removes only the console statements @test
  • Given code with nested console calls inside blocks (if statements, loops), the plugin removes them @test

Implementation

@generates

API

/**
 * Babel plugin that removes console method calls from code.
 *
 * @param {object} babel - The Babel instance with types utilities
 * @returns {object} Plugin object with visitor methods
 */
export default function removeConsolePlugin(babel) {
  // Plugin implementation
}

Dependencies { .dependencies }

@babel/core { .dependency }

Provides the core Babel transformation pipeline and plugin infrastructure.

@babel/traverse { .dependency }

Provides AST traversal capabilities with the visitor pattern and Path API.

tile.json