-
-
Notifications
You must be signed in to change notification settings - Fork 927
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
Update selector parser #4595
Update selector parser #4595
Conversation
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.
👍
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.
Thanks, @jeddy3!
Could you take a look at few tiny requests, please?
@@ -10,23 +10,5 @@ module.exports = function(node) { | |||
// Ghost descendant combinators around reference combinators like `/deep/` | |||
// postcss-selector-parser parsers references combinators as tag selectors surrounded |
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.
This comment shall be changed to match new parser.
lib/rules/string-quotes/index.js
Outdated
const needsCorrectEscape = attributeNode.value.indexOf(correctQuote) !== -1; | ||
const needsOtherEscape = attributeNode.value.indexOf(erroneousQuote) !== -1; |
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.
A little bit of readability:
const needsCorrectEscape = attributeNode.value.includes(correctQuote);
const needsOtherEscape = attributeNode.value.includes(erroneousQuote);
lib/rules/string-quotes/index.js
Outdated
const needsCorrectEscape = attributeNode.value.indexOf(correctQuote) !== -1; | ||
const needsOtherEscape = attributeNode.value.indexOf(erroneousQuote) !== -1; |
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.
const needsCorrectEscape = attributeNode.value.includes(correctQuote);
const needsOtherEscape = attributeNode.value.includes(erroneousQuote);
Good catches. I've made the changes. |
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.
Thank you!
We shall create an issue with all of these downgrades. To remember to restore functionality when time comes.
Do you think we should mention in a changelog that some rules were downgraded? |
|
I think so. |
|
References https://github.com/orgs/stylelint/teams/core/discussions/18
Replaces #3988
I've ported over the changes from #3988. We changed our formatting and moved to TS JS Docs from flow since we made the original pull request
I believe only two rules are affected by this update:
selector-descendant-combinator-no-non-space
will now outright ignore selectors containing commentsselector-pseudo-class-parentheses-space-inside
can now longer autofix pseudo-classes that contain commentsI think these are minor limitations for the sake of updating. I've added a note to the READMEs of both these rules.
We have fixed some other bugs by updating the selector parser, e.g. the one in
selector-attribute-brackets-space-inside/__tests__/index.js
. Things probably balance out in the end.I've skipped the affected tests.
It'd be great if we could get #4592 and #4591 approved and merged too so that the new workaround feature and related documentation changes are also released.