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

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -