I'm setting up a .stylint file for my VS Code editor. Here is the example:
#main > div // there is no comma so stylint should throw an error here
div {
...
}
#main > div, // this is ok, no error here
div {
...
}
I'm setting up a .stylint file for my VS Code editor. Here is the example:
#main > div // there is no comma so stylint should throw an error here
div {
...
}
#main > div, // this is ok, no error here
div {
...
}
It is not possible to do this with the built-in rules in stylelint because the following is a valid selector:
#main > div
div {}
It's the equivalent of:
#main > div div {}
As the descendant combinator is any whitespace, including a newline.
However, you could write your own plugin for stylelint that enforces a comma at the end of each line of a selector, but the consequences of the plugin may be problematic unless you can guarantee that each selector within a selector list will occupy a single line.