4.0.1 • Published 2 months ago

stylelint-selector-bem-pattern v4.0.1

Weekly downloads
45,557
License
MIT
Repository
github
Last release
2 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@dreipol/pandora@condorhero/stylelint-config-css@computerrock/react-scripts@computerrock/stylelint-config-react-app@computerrock/toolchain-react-app@culur/config-stylelint@considonet/stylelint-config-bemcustomize-materialeslint-config-stefancactus-frameworkca-buildmodule@primo/stylelint-config@prk/stylelint-config@rm-frontend/stylelint-config@transfermarkt/global-styles@transfermarkt/stylelint-config@tresinternet/stylelint-config@tresinternet/stylelint-config-vue3@peterek/stylelint-config-scss@ntks/stylelint-config@pegakit/build-tools@wavevision/coding-standard@unic/estatico-stylelint@zlatjs/stylelint-config@shlinkio/stylelint-config-css-coding-standard@supportclass/stylelint-config@taknepoidet-config/stylelintblackjack-toolbeltam-vue-toolsgg-stylelint-config
4.0.1

2 months ago

4.0.0

8 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

7 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