sass - How to lint for a harry robert's BEM convention with stylelint? -
postcss bem linter plugin needs component definition each block time consuming thing in legacy project.
is there way use stylelint check classes pattern , show error in stylesheets (.scss in case) of project without needing component definition in each file/block?
https://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/
.block {} .block__element {} .block--modifier {}
you can use stylelint's selector-class-pattern
rule enforce pattern class selectors using regular expression.
however, if you're writing bem-like css stylelint-selector-bem-pattern
, wraps postcss bem linter, more powerful understands concept of components, elements, modifiers , utility classes.
there an option implicitly define components based on filename, removing need component definitions within each file.
Comments
Post a Comment