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-6/

Class Fields Version Gate

A Babel plugin that refuses to run on unsupported Babel core versions while enabling class field syntax parsing without emitting transforms.

Capabilities

Version compatibility guard

  • Running the plugin against Babel core major version 6.x throws a clear compatibility error before parsing any code. @test
  • Running the plugin against Babel core 7.x completes initialization without errors so parser setup can proceed. @test

Public and static fields syntax

  • Code containing public instance and static class fields parses successfully and the emitted code string matches the input when no transforms are configured. @test

Private members syntax

  • Code using private fields and private methods parses successfully and is emitted unchanged when no transforms are configured. @test

Config integration paths

  • Using the plugin via a Babel config file and via a direct transformSync call both apply the version guard and allow class field syntax parsing on supported versions. @test

Implementation

@generates

API

/**
 * Creates a Babel plugin that enforces supported Babel core versions
 * before enabling parser support for class fields and private members.
 *
 * @param {object} api - Babel plugin API object provided by Babel.
 * @returns {object} Babel plugin definition exposing a name and manipulateOptions hook.
 */
export default function classFieldsVersionGate(api);

Dependencies { .dependencies }

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

Enables Babel parser support for class fields, private fields, and private methods without transforming output. @satisfied-by

@babel/core { .dependency }

Provides the Babel core runtime needed to initialize and version-check plugins programmatically. @satisfied-by

Install with Tessl CLI

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

tile.json