bem-xjst
bem-xjst copied to clipboard
Add static check: warning on several block/mix/attrs/js/etc subpredicates
block('page')(
tag()('body'),
block('content').tag()('article'),
block('footer').tag()('footer')
)
P.S. Test needed.
Need tests for cases such as block('a').mod('m1', 'v1').mod('m2', 'v2')…
We have three options:
- Throw error only in case of block in block case (
block('a').block('b')… or block('a')(block('b')…)
) (see my commit https://github.com/bem/bem-xjst/commit/e7c5cb1abf0ef715b66f19992426faf958621da1) - Throw error in any necessary case:
tag().tag()…
,mix().mix()…
,attrs().attrs()…
,js().js()…
,content().content()…
, etc - Do not throw errors but introduce static check.
IMHO we need a combination of 1 and 3. Because 2 is much more heavy for bundle size.
@veged @zxqfox @tadatuta what are you think about it?
let's do this through static check