Fixed: false positives Scss selector with nested properties. #2102

Merged
merged 1 commit into from Nov 26, 2016

Projects

None yet

4 participants

@evilebottnawi
Member
evilebottnawi commented Nov 22, 2016 edited

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

#2093

Is there anything in the PR that needs further explanation?

No, it's self explanatory.

I believe that the rule does not work correctly and we should fix this in 8.0.0.

Example:

.foo .bar > .foobar { & .test { @media screen { color: red; } } }

We this line use for check on nested

if (rule.nodes.some(node => node.type === "rule" || node.type === "atrule")) { return }

And we get:

  1. We use walkRules.
  2. Here we have 2 selector .foo .bar > .foobar and & .test
    First selector have nodes and return.
    Second selector have nodes and return.
    But we should get error here.

Also rule don't work with nested properties.

/cc @davidtheclark @jeddy3

@evilebottnawi evilebottnawi Fixed: false positives Scss selector with nested properties.
4d449eb
@evilebottnawi
Member

strange, some tests failed

@ntwb
ntwb approved these changes Nov 23, 2016 View changes

LGTM

@jeddy3
Member
jeddy3 commented Nov 26, 2016

As this addresses the immediate parse error, I think we should merge this.

@evilebottnawi Can you create two new issues to discuss your other findings; one for .foo .bar > .foobar { & .test { @media screen { color: red; } } } and another for nested properties.

@jeddy3
jeddy3 approved these changes Nov 26, 2016 View changes
@davidtheclark davidtheclark merged commit 3486515 into master Nov 26, 2016

4 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 95.684%
Details
@davidtheclark
Contributor

Added note to changelog:

  • Fixed: selector-max-compound-selectors ignores SCSS nested declarations (#2102)
@jeddy3 jeddy3 deleted the issue-2093 branch Nov 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment