0.0.1 • Published 9 years ago

babel-plugin-class-properties-7to6 v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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']
});