-
-
Notifications
You must be signed in to change notification settings - Fork 977
Labels
good first issueis good for newcomersis good for newcomersstatus: wipis being worked on by someoneis being worked on by someonesubtype: new optiona new option for an existing rulea new option for an existing rule
Description
What minimal example or steps are needed to reproduce the bug?
Use this code:
@mixin hardcode-total-height(
$base-height,
$extra-height: 0px
) {
height: calc($base-height + $extra-height);
}
a {
@include hardcode-total-height(10px);
}
@function add-numbers(
$number-a,
$number-b: 0px
) {
@return calc($number-a + $number-b)
}
div {
width: add-numbers(10px);
}
Run stylelint on it with option --fix
.
Recompile Sass.
What minimal configuration is needed to reproduce the bug?
{
"extends": [
"stylelint-config-standard-scss"
]
}
How did you run Stylelint?
stylelint "src/**/*.{css,scss,sass,vue}" --fix
Which Stylelint-related dependencies are you using?
"sass": "^1.85.0",
"stylelint": "^16.14.1",
"stylelint-config-standard-scss": "^14.0.0",
"stylelint-config-standard-vue": "^1.0.0",
"stylelint-order": "^6.0.4",
"stylelint-scss": "^6.10.1",
"vite": "^6.1.0",
What did you expect to happen?
- autofix does NOT remove the unit from the default argument values
- therefore there is no Sass compilation error about invalid units
What actually happened?
- Autofix transforms 0px into 0
- On recompilation, Sass says
10px and 0 are incompatible
.
Do you have a proposal to fix the bug?
Apply the same fix as in #8034 to mixin/function default argument values
Metadata
Metadata
Assignees
Labels
good first issueis good for newcomersis good for newcomersstatus: wipis being worked on by someoneis being worked on by someonesubtype: new optiona new option for an existing rulea new option for an existing rule