-
-
Notifications
You must be signed in to change notification settings - Fork 929
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
Fix rule-selector-property-disallowed-list
false positives for nesting selectors
#7488
Comments
@emmacharp Thanks for the report with a reproduction. To clarify, do you want to disallow a I created the online demo, which doesn't seem to be a problem. See the config: {
"rules": {
"rule-selector-property-disallowed-list": [{ "input": "width" }]
}
} |
The contrary, actually. The example is about disallowing the My regex in the example was bunk, sorry. If you try your demo with this one instead, you should see what I mean: As always, thanks for the help! |
Ah, I understand it now. See the new demo. .search {
& input {
width: 100%; /* should be ok, but actually reported */
/* ^^^^^ Unexpected property "width" for selector ".search" */
}
}
.search input {
width: 100%; /* not reported, ok */
}
.search form {
width: 100%; /* reported, ok */
/*^^^^^ Unexpected property "width" for selector ".search form" */
} {
"rules": {
"rule-selector-property-disallowed-list": [{ "/^((?!input).)*$/": "width" }]
}
} This should be a bug of I've labeled the issue as ready to implement. Please consider contributing if you have time. There are steps on how to fix a bug in a rule in the Developer guide. |
rule-selector-property-disallowed-list
false positives for nesting selectors
I've updated this issue body to include the correct reproduction and the online demo. |
Thanks for rephrasing in a standard way. I'll see what I can do today & tomorrow. |
We can use Otherwise, we may be able to install and use For details, see #6234 (comment) |
Well... I have never worked with Postcss before and the truth is I'm more a designer than a programmer. Heh. So figuring out what's going on is proving a bit challenging. The way I understand it, we need to prevent walking through child nodes' rules. I'm not sure how the plugins mentioned above can help doing that. Am i missing something? Not quite sure about collateral damage either. Do you all think about something that could be broken by preventing the rule to walk through child nodes in the AST? |
Ah, I see. Don't mind. Adding |
This issue is older than one month. Please ask before opening a pull request, as it may no longer be relevant. |
@ybiquitous, do we still wait PR #7496 to be closed to progress here? If not, I'd try to see what I can do for it to be included in 16.3.0 Thanks! |
In this issue, I favor installing CC: @romainmenke if you notice something, feel free to comment.
Honestly, I'd like to release 16.3.0 as soon as possible because the version will include some bug fixes. So, you don't need to rush, we can release 16.3.1 soon when resolving this issue. |
I think that actual issue might simpler to resolve :) I'll open a PR with a proposed fix. |
It is already quite late here, so I will pick this up again tomorrow. |
What minimal example or steps are needed to reproduce the bug?
What minimal configuration is needed to reproduce the bug?
How did you run Stylelint?
stylelint *.css
Online demo
Which Stylelint-related dependencies are you using?
What did you expect to happen?
The nested block should not generate an error.
What actually happened?
.search
is evaluated and an error is thrown.Do you have a proposal to fix the bug?
Don't evaluate nested selectors... though I'm not sure about collateral damage.
The text was updated successfully, but these errors were encountered: