babel-plugin-class-properties-7to6

0.0.1 • Public • Published

babel-plugin-class-properties-7to6

es7.classProperties without es6.classes.

Note: This plugin doesn't actually transform properties correctly at the moment. Instead, it just removes class properties wherever they're encountered. This obviously breaks the code in the general case, but can still be helpful to apply before some tools (e.g. JSDoc) that rely on pre-ES7 parsers.

The current behavior is enough for my needs. Of course, PRs reimplementing the required bits of es6.classes while still emitting valid ES6 are very welcome.

Installation

$ npm install babel-plugin-class-properties-7to6

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["class-properties-7to6"]
}

Via CLI

$ babel --plugins class-properties-7to6 script.js

Via Node API

require('babel').transform('code', {
  plugins: ['class-properties-7to6']
});

Package Sidebar

Install

npm i babel-plugin-class-properties-7to6

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • motiz88