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

Fix false positives for no-descending-specificity and scss syntax #3420

Merged
merged 2 commits into from Jun 23, 2018

Conversation

YozhikM
Copy link
Contributor

@YozhikM YozhikM commented Jun 23, 2018

Which issue, if any, is this issue related to?

Closes #3417

Is there anything in the PR that needs further explanation?

No.

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YozhikM Thanks. Looking good. I've made two minor requests around conventions.


accept: [
{
code: ".foo { &--a, &--a#{&}--b { div { padding: 10px; } } }"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the conventions:

Use the minimum amount of code possible to communicate the pattern e.g. if the rule targets selectors then use an empty rule e.g. {}.

Can we use the following please?:

.foo { &--a, &--a#{&}--b { div {} } }

checkSelector(s, rule, index, comparisonContext)
);
parseSelector(resolvedSelector, result, rule, s => {
if (isStandardSyntaxSelector(resolvedSelector)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention, in this file and others, is to return early when using the isStandard* utils. We should probably follow it here too:

parseSelector(resolvedSelector, result, rule, s => {
  if (isStandardSyntaxSelector(resolvedSelector)) {
    return;
  }
  checkSelector(s, rule, index, comparisonContext);
}

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@hudochenkov hudochenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hudochenkov hudochenkov merged commit 68784b2 into stylelint:master Jun 23, 2018
@hudochenkov
Copy link
Member

  • Fixed: no-descending-specificity false positives for #{&} (#3420).

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

Successfully merging this pull request may close these issues.

None yet

3 participants