bem-xjst icon indicating copy to clipboard operation
bem-xjst copied to clipboard

Add static check: warning on several block/mix/attrs/js/etc subpredicates

Open miripiruni opened this issue 7 years ago • 3 comments

block('page')(
    tag()('body'),
    block('content').tag()('article'),
    block('footer').tag()('footer')
)

P.S. Test needed.

miripiruni avatar Mar 20 '17 16:03 miripiruni

Need tests for cases such as block('a').mod('m1', 'v1').mod('m2', 'v2')…

miripiruni avatar Mar 20 '17 16:03 miripiruni

We have three options:

  1. 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)
  2. Throw error in any necessary case: tag().tag()…, mix().mix()…, attrs().attrs()…, js().js()…, content().content()…, etc
  3. 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?

miripiruni avatar Apr 17 '17 20:04 miripiruni

let's do this through static check

veged avatar Apr 19 '17 15:04 veged