Incorrect vendor prefix identification
crstauf opened this issue · 16 comments
Describe the bug
Error Separate different vendor prefixes into their own rules.
is showing on SASS that has no vendor prefixes:
.menu-item {
&.menu-item-has-children::after,
&.menu-item-has-grandchildren::after {
content: '';
position: absolute;
top: 24px;
right: 30px;
width: 18px;
height: 18px;
background-size: contain;
}
}
To Reproduce
Steps to reproduce the behavior:
- Add the SASS code above into a sass/scss file
- Run Stylelint with
use-defensive-css
plugin - Notice errors
Expected behavior
No vendor error(s).
Desktop (please complete the following information):
- OS: macOS
- Browser: NA
- Version: Sonoma 14.2
Additional context
package.json
{
"devDependencies": {
"stylelint": "^15.10.2",
"stylelint-config-standard": "^34.0.0",
"stylelint-config-standard-scss": "^11.1.0",
"stylelint-high-performance-animation": "^1.9.0",
"stylelint-order": "^6.0.3",
"stylelint-plugin-defensive-css": "^0.9.1",
"stylelint-stylistic": "^0.4.3"
}
Thank you for reporting this. I will dig into it as soon as I can 🤘
@crstauf Could you share your full package file? I want to set up a project in the same way as yours to make sure I am testing correctly.
@yuschick The package.json
I shared above is the pertinent info (only other thing is a custom command).
I'm interested in seeing how you're bringing in SCSS. I don't work with it often, so I'd like to see your project setup there, so I can make sure I am testing correctly.
Oh. I have Dart Sass installed globally. That shouldn't impact Stylelint's review of files though, correct?
I'm not sure off hand, but that at least gives me a place to start. From what it seems, I may need to write tests specific to SCSS. This is a bit new for me, so bare with me as I try to figure out what is needed.
@crstauf Okay. I can recreate the error. Seems like I just need to update the RegExp I am using. Will get an update out soon.
Will check it out ASAP to confirm.
@yuschick I ran npm update stylelint-plugin-defensive-css
, and now I get some output that is not correct:
package.json
{
"devDependencies": {
"stylelint": "^15.10.2",
"stylelint-config-standard": "^34.0.0",
"stylelint-config-standard-scss": "^11.1.0",
"stylelint-high-performance-animation": "^1.9.0",
"stylelint-order": "^6.0.3",
"stylelint-plugin-defensive-css": "0.10.3",
"stylelint-stylistic": "^0.4.5"
}
}
@crstauf Thanks for catching this and reporting it so quickly. I have published 0.10.4
which will no longer have those logs.
Ugh, I completely forgot about this until now. Will test and report back latest by Monday.
Managed to get to my desk tonight. Looks like it requires Stylelint 16, which not all my dependencies support yet, so I'll come back 'round once that happens.
Updated to Stylelint 16 and v1.0.0 today: works well. Thanks!