Skip to content
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

not only BEM #48

Open
max-norin opened this issue Aug 28, 2020 · 2 comments
Open

not only BEM #48

max-norin opened this issue Aug 28, 2020 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@max-norin
Copy link

vue-scoped-css/no-unused-selector rule has ignoreBEMModifier option
Besides BEM, there are other ways to organize CSS code. For example RSCCS, where the modifier is defined as in the following code. More details here.

.like-button {
  &.-wide { /* ... */ }
  &.-short { /* ... */ }
  &.-disabled { /* ... */ }
}

Also, development teams can use custom modifier naming. Сreator of the stylelint-selector-bem-pattern made it possible to specify a regular expression to define a modifier. Maybe you should pay attention to this.

@ota-meshi
Copy link
Member

Thank you for this issue!

I am not familiar with RSCCS.
Can you write a detailed specification of the features you want to add, in this issue?
Also, can you open a pull request after that?

@ota-meshi ota-meshi added enhancement New feature or request help wanted Extra attention is needed labels Aug 28, 2020
@max-norin
Copy link
Author

For example,
replace ignoreBEMModifier option with:

ignoreModifier: {
   // The preset patterns are available: bem and rscc
   preset: 'bem'|'rscc',
   // Array of regular expressions or strings defining custom modifier naming
   list: [
     '/{componentSelector}--{modifier}/', // this regular expression match bem 
     '/{componentSelector}\\.-{modifier}/', // this regular expression match rscc
     '&--warn', '&--error', // this strings match bem where as modifiers there can only be `warn` and `error`
     '&.-warn', '&.-error', // this strings match rscc where as modifiers there can only be `warn` and `error`
     '/{componentSelector}-{modifier}/', // this regular expression match custom modifier naming
     '/{componentSelector}---{modifier}/', // this regular expression match custom modifier naming
     '/{componentSelector}.{modifier}/', // this regular expression match custom modifier naming
   ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants