babel-plugin-bem-helpers
v1.0.0
Published
Ugly constructions simplifier
Downloads
11
Maintainers
Readme
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'
};
}
});