tessl install tessl/npm-babel--runtime@7.28.0Babel's modular runtime helpers that provide transpilation support for modern JavaScript features
Agent Success
Agent success rate when using this tile
94%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.19x
Baseline
Agent success rate without this tile
79%
Build a Babel plugin that uses a custom parser to handle special comment syntax in JavaScript code.
You need to create a Babel plugin that replaces the default JavaScript parser with a custom one. The custom parser should be able to parse standard JavaScript code while also recognizing and preserving special metadata comments in a specific format: /*@metadata key=value */.
These special comments should be extracted during parsing and made available in the AST as custom metadata that can be accessed by other plugins or tools in the Babel pipeline.
Your plugin should:
/*@metadata key=value */ during the parsing phase/*@metadata author=john */ should extract the metadata and include it in the parse result @test@generates
/**
* A Babel plugin that overrides the default parser to handle special metadata comments.
*
* The plugin exports a function that returns a Babel plugin object with a parserOverride.
*
* @param {Object} api - The Babel API object
* @returns {Object} A Babel plugin object with parserOverride
*/
module.exports = function(api) {
// Plugin implementation
};Provides the core Babel transformation and parsing APIs, including the ability to override the default parser.