Babel syntax plugin that enables parsing of class properties, private properties, and private methods
94
Configure Babel so class field syntax is accepted both via configuration files and inline programmatic transforms.
parseWithConfig reads a Babel config file at a provided path and transforms a source file that includes public fields, static fields, private fields, and private methods without throwing. The returned code string still contains those class field declarations. @testtransformSnippetInline transforms a provided snippet string containing public, static, and private class elements using programmatic Babel options without relying on external config files. The returned code string still contains the inline class field declarations. @test@generates
/**
* Transforms a file using a Babel config located at configPath.
* Returns the generated code string, ensuring class field syntax is accepted.
*/
export async function parseWithConfig(inputPath, configPath);
/**
* Transforms a snippet string using inline Babel options.
* Returns the generated code string, ensuring class field syntax is accepted.
*/
export function transformSnippetInline(snippet);Enables parsing of class field syntax during transforms.
Provides the Babel transform APIs used for config-based and inline transforms.
Install with Tessl CLI
npx tessl i tessl/npm-babel--plugin-syntax-class-properties