Babel plugin that compiles ES2015 default and rest parameters to ES5-compatible code
91
Build a Babel plugin that enables parsing and transforming experimental JavaScript syntax features. Your plugin should support parsing code that uses cutting-edge ECMAScript proposals.
Create a Babel plugin that:
Configures parser for experimental syntax: Set up the Babel parser to accept experimental JavaScript proposals including pipeline operators and decorators.
Transforms experimental features: Transform at least one experimental syntax feature (such as do expressions) into backward-compatible JavaScript code.
Provides plugin options: Allow users to configure which experimental features to enable through plugin options.
Integrates with Babel's plugin system: Return a proper plugin object with visitor methods that work with Babel's transformation pipeline.
Create the following files:
src/plugin.js - The main Babel plugin implementationtest/plugin.test.js - Tests verifying the plugin works correctlyYour plugin should be able to process source code containing experimental syntax and produce transformed output. The plugin must work with Babel's standard transformation pipeline.
@generates
/**
* Babel plugin that enables experimental syntax support
* @param {Object} api - Babel API object
* @param {Object} options - Plugin configuration options
* @param {boolean} options.pipelineOperator - Enable pipeline operator support
* @param {boolean} options.decorators - Enable decorators support
* @param {boolean} options.doExpressions - Enable do expressions support
* @returns {Object} Babel plugin object with visitor methods
*/
module.exports = function experimentalSyntaxPlugin(api, options) {
// Plugin implementation
};Provides the core Babel transformation API and plugin system.
Provides JavaScript parsing with support for experimental syntax plugins.
Provides AST node builders and utilities for code transformation.
Install with Tessl CLI
npx tessl i tessl/npm-babel--plugin-transform-parametersdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10