Comments (3)
It's done in SUIT (https://github.com/postcss/postcss-bem-linter/pull/35/files) --- but looks like you're using the BEM preset -- is that right? If so, yeah, we could alter the BEM regex just like we did the SUIT one.
from postcss-bem-linter.
I'm using BEM, yes, but not the preset. Still, I figured those who are using the preset might benefit the same. I just added this to my custom component selectors:
componentSelectors(block) {
const element = `(?:__${WORD})?`;
const modifier = `(?:--${WORD})?`;
const attributes = `(?:\\[[^\\]]*\\])*`;
return new RegExp(`^(?:\\.${block}${element}${modifier}${attributes})+$`);
}
from postcss-bem-linter.
Released in 2.2.0.
from postcss-bem-linter.
Related Issues (20)
- Allow chaining BEM modifiers
- Please print expected selector in error message HOT 2
- Is there an online playground to try this to validate some BEM code? HOT 1
- Cannot get the plugin to log an error HOT 5
- Node#moveTo was deprecated. Use Container#append
- Add support for different types of components
- Issue with prepending selectors (separated by whitespace) HOT 10
- Clarify usage of initial vs combined HOT 2
- Does not work with Sass interpolation HOT 5
- How to configure it inside a postcss.config.js HOT 3
- Components not linted if no immediate rule HOT 2
- Implicit component file name customisation HOT 2
- valid component selectors detected as invalid, and reported line numbers are also incorrect. HOT 2
- Ability to have a themed component HOT 5
- Nested multiple definitions HOT 2
- Concise & verbose comment syntax for "weak" not fully working? HOT 1
- How check bem?
- Namespaces are confused as selectors
- Question: how to ignore not-pseudo class
- [4.0.0] `implicitComponents` in conjunction with a custom `componentName` pattern causes error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postcss-bem-linter.