rstacruz / stylelint-rscss

Validate CSS with RSCSS conventions
MIT License
75 stars 6 forks source link

Doesn't understand selector lists #13

Open hjri opened 4 years ago

hjri commented 4 years ago

here's stylelint config:

    "rscss/no-descendant-combinator": false,
    "rscss/class-format": [
      true,
      {
        "component": "pascal-case",
        "variant": "^-[a-z]\\w+",
        "element": "^[a-z]\\w+",
        "helper": "^fr-[a-z]\\w+"
      }
    ]

here's example code that breaks:

.Component {
  .elementA,
  .elementB {
     color: red
  }
}

It gives this error: Invalid component name: '.elementB' (rscss/class-format) (css-stylelint) workaround is to do this:

.Component {
  & .elementA,
  & .elementB {
     color: red
  }
}

both ways are equivalent and produce same code