-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bem selector-class-pattern stylelint rule #8
base: main
Are you sure you want to change the base?
Conversation
@juantxokupul Sweet, can we add a test for something like: .block__elementSomething Which I've seen in many places. See what happens, or what do we think should happen. Thank you |
package.json
Outdated
@@ -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", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Following contribution guidelines, please fill an issue and link to this PR. This way we can track and discuss this change. |
In my opinion, we shouldn't force a naming convention. This project is open source and hence potentially it can be used by anyone and not only by Netcentric. And as much as at Netcentric we love BEM, we cannot force it to any developer that wants to use this stylelint configuration. |
@raohmaru developers can always overwrite this rule in their stylelint.config (which they'll need anyway to add the extend rule with our package) Considering this should be one of the standard packages we use for all our new projects, having to copy and paste this long regex every time to follow the NC Code Style seems overkill. Seems more optimal to have it here in the package and remove it in the few cases where it's not wanted. |
I liked it when it was a 1 liner in the config. I'm not a fan of adding a new dependency, which can not be taken out via config when someone includes this package. |
Issue created by @prototowb, thank you! @raohmaru This PR was created since kebab-case was the default class naming convention, and we thought that bem would be better. @quicoto yes, I also don't like to add a dependency, but you need a css post-processor to support scss nested selectors. |
I'm retracting my enthusiasm with this change. I don't think we should go forward with it. |
NOTE: you can take out this config setting the rule to null
(EDIT) you also need to define the component in order to have this working. Without that, this will do nothing -> no need to override anything. |
993e036
to
81d6ee6
Compare
PR updated I realized that stylelint is already a post processor and the only thing needed was to set The only advantage I see with the plugin, is that you can apply bem naming convention only in certain css files/sections |
this is allowed and I think it should The page is under 'Archive OLD' itself but seems like a good reference to me |
@juantxokupul Please have a look at the updated page (subpages) of https://projects.netcentric.biz/wiki/pages/viewpage.action?pageId=48141171 Which also needs to be updated... Archive pages should not be used. |
@quicoto thank you! Fortunately, it seems the 6. Classes (.name) section is a copy/paste from the old :) |
No description provided.