Babel plugin to instrument React components with custom transforms
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.
transforms array results in the exact validation error emitted by the dependency when options are missing or malformed. @testtransforms array is provided, the normalized result includes the dependency's default factoryMethods and superClasses values alongside the original transforms. @testfactoryMethods or superClasses are supplied, the normalized result preserves those values instead of overwriting them with defaults. @test@generates
/**
* 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);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.0evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9