Stylelint Selector Bem Pattern
Stylelint plugin that incorporates postcss-bem-linter
Install / Use
npx skills add simonsmith/stylelint-selector-bem-patternInstalls into whichever agent you are using.
README
stylelint-selector-bem-pattern
A stylelint plugin that incorporates postcss-bem-linter.
To learn more about postcss-bem-linter, please read that module's documentation.
Installation
npm install stylelint-selector-bem-pattern
Usage
Add it to your stylelint config plugins array, then add "plugin/selector-bem-pattern" to your rules,
specifying your postcss-bem-linter settings as the primary option.
Even though postcss-bem-linter has the default setting of { preset: 'suit' }, this plugin has
no default setting: if you want to use the SUIT preset, you must pass { preset: 'suit' },
and the rule will not work if you do not pass a primary option object.
Like so:
// .stylelintrc
{
"plugins": [
"stylelint-selector-bem-pattern"
],
"rules": {
// ...
"plugin/selector-bem-pattern": {
"componentName": "[A-Z]+",
"componentSelectors": {
"initial": "^\\.{componentName}(?:-[a-z]+)?$",
"combined": "^\\.combined-{componentName}-[a-z]+$"
},
"utilitySelectors": "^\\.util-[a-z]+$"
},
// ...
}
}
For more examples of postcss-bem-linter configuration possibilities, please read that module's documentation. Keep in mind that if your stylelint config is JSON you will have to use strings to specify your selector patterns (as above).
Related Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
blender-python-addon
40.5kBlender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting
flutter-development-guidelines-cursorrules-prompt-file
40.5kCursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines.
commit-push-pr
140.6kCommit, push, and open a PR
