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

"ignoreKeywords" for "selector-no-redundant-nesting-selector" #749

Open
malika-hanotte opened this issue Feb 10, 2023 · 1 comment
Open

Comments

@malika-hanotte
Copy link

malika-hanotte commented Feb 10, 2023

Context : to enhance the lisibilty of our SCSS files, we have decided to use nesting sign & before > and +.
So we've tried to add stylelint rule selector-no-redundant-nesting-selector with the option ignoreKeywords for > and +, but the use of this rule exception seems to doesn't work (with string or regex).

In the documentation, it's writthen "if you are using Less or some other non-SCSS syntax, the warnings can be disabled by using ignoreKeywords option".
Is ignoreKeywords only available for other framework than sass ?
Is it a bug ?
Did we made a mistake in implemantation ?

Here is the different codes we've tried :
"scss/selector-no-redundant-nesting-selector": [ true, { "ignoreKeywords": ["[>+]"] } ]

"scss/selector-no-redundant-nesting-selector": [ true, { "ignoreKeywords": ["/[>+]/"] } ]

"scss/selector-no-redundant-nesting-selector": [ true, { "ignoreKeywords": ["+", ">"] } ]

Thanks in advance for you're feedback

@kristerkari
Copy link
Collaborator

Thanks @malika-hanotte !

I think that the problem is that the ignoreKeywords option was added for a different use case.

It's meant to allow the rule to ignore keywords that can be used in some non-SCSS syntaxes (e.g. LESS) to allow it work as it should, but you are trying to use it to ignore the combinators in the selector (e.g. https://developer.mozilla.org/en-US/docs/Web/CSS/Adjacent_sibling_combinator).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants