CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-babel--plugin-syntax-class-properties

Babel syntax plugin that enables parsing of class properties, private properties, and private methods

94

1.04x
Overview
Eval results
Files

task.mdevals/scenario-3/

Babel Class Field Parsing

Configure Babel so class field syntax is accepted both via configuration files and inline programmatic transforms.

Capabilities

Parses class fields from config-driven 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. @test

Parses class fields from inline transforms

  • transformSnippetInline 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

Leaves syntax untouched

  • Neither transform strips or rewrites class field declarations; outputs mirror the original class bodies aside from formatter differences. @test

Implementation

@generates

API

/**
 * 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);

Dependencies { .dependencies }

@babel/plugin-syntax-class-properties { .dependency }

Enables parsing of class field syntax during transforms.

@babel/core { .dependency }

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

tile.json