ssivanatarajan / stylelint-group-selectors

Identify the selectors, which can be grouped as they have same set of properties and values.
10 stars 2 forks source link

Getting false positives #4

Closed fent closed 3 years ago

fent commented 5 years ago

Some false positive scenarios I've noticed

.a {
  .b {
    color: blue;
  }
}

.c { // <- will get a warning here saying it can be merged with `.a`
  .d {
    font-size:  12pt;
  }
}
@media (max-width: 100px) {
  .a {
    color: blue;
  }
}

@media (max-width: 200px) {
  .b { // <-- warning here saying it can be merged with `.a` above despite different @media query
    color: blue;
  }
}
jigneshchudasama commented 3 years ago

Any update on this? @ssivanatarajan

ssivanatarajan commented 3 years ago

@fent unable to reproduce the media query case. The nested selector case in SCSS was fixed

fent commented 3 years ago

hmm, i haven't used this in a while. i noticed that the test file only tests one case https://github.com/ssivanatarajan/stylelint-group-selectors/blob/master/_tests_/index.js

The nested selector case in SCSS was fixed

that's good!

ssivanatarajan commented 3 years ago

@fent Will add more test cases