4.0.1 • Published 3 months ago

stylelint-selector-bem-pattern v4.0.1

Weekly downloads
45,557
License
MIT
Repository
github
Last release
3 months ago

stylelint-selector-bem-pattern

NPM version Build Status

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).

stylelint-config-gekutech@infinitebrahmanuniverse/nolb-stylelint-s@everything-registry/sub-chunk-2842vue-customlin3s-distributionmr-style-lintkleros-js-scriptskleros-scriptsgulp-tasks-frontnebula-stylelint-configpegakit-build-toolsrecruiter_epiq_depsstylelint-config-championdatastylelint-config-cloudfour-suitstylelint-config-fitplanstylelint-config-foxsportsstylelint-config-crowdlabstylelint-config-factorialstylelint-config-mrtnvhstylelint-config-materialstylelint-config-material-kitstylelint-config-lorastylelint-config-nebulastylelint-config-angular-materialstylelint-config-atomikuistylelint-config-adidas-bemstylelint-config-usoniancssstylelint-config-ryanairstylelint-config-samplestylelint-config-schoenwaldnilsstylelint-config-syzygy-bemstylelint-config-standard-onestylelint-config-qbestylelint-config-regardiostylelint-config-rivet-scssstylelint-config-pavosky-toolbeltsky-css-lint@antipodes-medical/stylelint-config-antipodes@aptuitiv/website-build-tools@alexandrov/stylelint-config@axa-ch/stylelint-config-axa-bem@b.ds/scss@baneuna/gulp-task-collection@barnardos/stylelint-config-barnardos@clarifynl/stylelint-config-clarify@10stars/stylelint-config@bolt/config-stylelint@ecl/stylelint-config@frankrecalde/es-css-lint-config@hub9/stylelint-config@hwf-cn/stylelint-config@ifanrx/stylelint-config-standard-bem@etchteam/stylelint-config@geniem/geniem-rules-stylelint@gracious/stylelint-config-gracious@launchbadge/stylelint-config@lemoninternet/stylelint-config@marain/stylelint-plugin@netzstrategen/stylelint-config@emulsify/core@factorial/frontend-stack-core@factorial/stack-css@ec-europa/stylelint-config-ecl@max-norin/style-project-init@jvmanke/stylelint-config-jvmanke@joinbox/stylelint-config-joinbox@kleros/kathari@kanikarp/react-scripts@kanikarphan/react-scripts@prk/stylelint-config@rm-frontend/stylelint-config@peterek/stylelint-config-scss@ntks/stylelint-config@pegakit/build-tools@shlinkio/stylelint-config-css-coding-standard@supportclass/stylelint-config@taknepoidet-config/stylelint@dreipol/pandora@condorhero/stylelint-config-css@computerrock/react-scripts@computerrock/stylelint-config-react-app@computerrock/toolchain-react-app@culur/config-stylelint@considonet/stylelint-config-bem@primo/stylelint-configeslint-config-stefan@transfermarkt/global-styles@transfermarkt/stylelint-config@tresinternet/stylelint-config@tresinternet/stylelint-config-vue3@unic/estatico-stylelint@wavevision/coding-standard@zlatjs/stylelint-configam-vue-toolsgg-stylelint-configblackjack-toolbeltca-buildmodulecactus-frameworkcustomize-material
4.0.1

3 months ago

4.0.0

10 months ago

3.0.1

1 year ago

3.0.0

1 year ago

2.1.1

3 years ago

2.1.0

6 years ago

2.0.0

7 years ago

1.1.1

7 years ago

1.1.0

8 years ago

1.0.0

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago