1.0.0 • Published 8 years ago

babel-plugin-bem-helpers v1.0.0

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

BEM helpers

Ugly constructions simplifier.

Install

npm i -D babel-plugin-bem-helpers

Usage

.babelrc

{
  "plugins": ["bem-helpers"]
}

Super call

Similar to bem-xjst templates previous mode call.

Before:

import {decl} from 'bem-react-core';

export default decl({
  block: 'block',
  mods() {
    return {
      ...applyNext(),
      modName: 'modVal'
    };
  }
});

After:

import {decl} from 'bem-react-core';

export default decl({
  block: 'block',
  mods() {
    return {
      ...this.__base.apply(this, arguments),
      modName: 'modVal'
    };
  }
});

License MIT