Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ module.exports = {
"declaration-no-important": true,
"declaration-property-unit-allowed-list": {
"font-size": ["px", "em"]
}
},

// bem
// https://github.com/postcss/postcss-bem-linter/issues/82#issuecomment-193851353
"selector-class-pattern": [
"^(?:(?:o|c|u|t|s|is|has|_|js|qa)-)?[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*(?:__[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:--[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:\\[.+\\])?$",
{
"message": "Expected class selector to match BEM naming convention"
}
]
}
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@netcentric/stylelint-config",
"description": "Netcentric's coding and style rules for Stylelint",
"version": "1.2.1",
"version": "1.3.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package version is changed automatically after a release, no need to change it manually.
Please revert this change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"license": "Apache-2.0",
"private": false,
"publishConfig": {
Expand Down
10 changes: 10 additions & 0 deletions test/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,13 @@
.unsuported {
display: flex;
}

/* bem ok */
.block__element {
color: red;
}

/* bem error */
.block_element {
color: red;
}