bem / bem-xjst

bem-xjst (eXtensible JavaScript Templates): declarative template engine for the browser and server
https://bem.github.io/bem-xjst
Other
115 stars 47 forks source link

Runtime lint: mods and elemMods must be string or number or boolean #420

Closed Yeti-or closed 7 years ago

Yeti-or commented 7 years ago

for example I was confused with all bem* formats and write something like that:

({ block: 'popup', mods: { theme: ['normal', 'action'] } })

I will get <div class="popup popup_theme_normal,action"></div>

In big project I can even don't notice this mistake.

What about dev and production build of bem-xjst? So in dev I will get Error about wrong format of bemjson Node.

Or you have already have such solution? If so, why not include it in bem-xjst demo stand?

miripiruni commented 7 years ago

@Yeti-or use runtimeLint option https://github.com/bem/bem-xjst/tree/master/runtime-lint

I’ll add you case to check list. mods and elemMods must be string or number or boolean.

Yeti-or commented 7 years ago

@miripiruni does demo bem.github.io/bem-xjst run with runtime lint option?

miripiruni commented 7 years ago

@Yeti-or No. In the demo you can not choose options. PRs are welcome ;)