CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-babel-plugin-react-transform

Babel plugin to instrument React components with custom transforms

59%

Overall

Evaluation59%

1.48x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-7/

React Transform Options Normalizer

Create a small utility that takes raw configuration intended for a React transform Babel plugin and returns a normalized shape while relying on the dependency to validate and apply default option values.

Capabilities

Rejects invalid configuration

  • Passing anything other than an object with a transforms array results in the exact validation error emitted by the dependency when options are missing or malformed. @test

Applies dependency defaults

  • When only the required transforms array is provided, the normalized result includes the dependency's default factoryMethods and superClasses values alongside the original transforms. @test

Respects custom patterns

  • When factoryMethods or superClasses are supplied, the normalized result preserves those values instead of overwriting them with defaults. @test

Implementation

@generates

API

/**
 * Normalizes user-supplied plugin options using the dependency's validation and defaulting behavior.
 *
 * @param {unknown} rawOptions - Raw configuration object supplied by a caller.
 * @returns {{ transforms: any[]; factoryMethods: string[]; superClasses: string[] }} Normalized options ready for plugin consumption.
 * @throws {Error} When validation fails for missing or invalid options.
 */
export function normalizeReactTransformOptions(rawOptions);

Dependencies { .dependencies }

babel-plugin-react-transform { .dependency }

Uses the dependency's built-in option validation and default value handling for the React transform Babel plugin.

tessl i tessl/npm-babel-plugin-react-transform@3.0.0

tile.json