Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/motiz88/babel-plugin-class-properties-7to6
es7.classProperties without es6.classes
https://github.com/motiz88/babel-plugin-class-properties-7to6
babel-plugin deprecated
Last synced: about 1 month ago
JSON representation
es7.classProperties without es6.classes
- Host: GitHub
- URL: https://github.com/motiz88/babel-plugin-class-properties-7to6
- Owner: motiz88
- License: mit
- Created: 2015-07-10T05:44:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-02T07:44:33.000Z (over 7 years ago)
- Last Synced: 2024-09-30T16:34:15.561Z (about 2 months ago)
- Topics: babel-plugin, deprecated
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# babel-plugin-class-properties-7to6
[es7.classProperties](https://gist.github.com/jeffmo/054df782c05639da2adb) without [es6.classes](https://babeljs.io/docs/learn-es2015/#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](https://github.com/jsdoc3/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](https://github.com/babel/babel/tree/master/src/babel/transformation/transformers/es6/classes) while still emitting valid ES6 are very welcome.
## Installation
```sh
$ npm install babel-plugin-class-properties-7to6
```## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"plugins": ["class-properties-7to6"]
}
```### Via CLI
```sh
$ babel --plugins class-properties-7to6 script.js
```### Via Node API
```javascript
require('babel').transform('code', {
plugins: ['class-properties-7to6']
});
```