stylelint-declaration-strict-value: stylelint message not showing interpolated values
I am struggling with message
module.exports = {
plugins: ["stylelint-declaration-strict-value"],
rules: {
"scale-unlimited/declaration-strict-value": [
["/color$/", "fill", "stroke"], {
ignoreVariables:false,
message: "Custom expected ${types} for \"${value}\" of \"${property}\"",
}],
},
};
and this what i see in vscode
should’nt it show the interpolated values here or am i missing some thing
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (11 by maintainers)
Thanks, now I understand why you want to have that specific messages.
Thanks for your reply. Glad to hear it works 😃
Keep in mind though that it’s a hacky workaround, wich messes with stylelint’s internals. This should become an official API as part of stylelint https://github.com/stylelint/stylelint/issues/5170
No, that’s not possible as of now. The only options which supports that is
ignoreValues
, because it needs it.Why would you need that?
@AndyOGo your bug fix did the trick ,thanks a lot i had a follow up question can i have separate message for different selector for eg /color$/ ==>message “use a color function xyz” "padding==>message “use padding values abc”
I see something for ignoreValues which takes an object to do this split ,but nothing for message
// .stylelintrc "rules": { // ... "scale-unlimited/declaration-strict-value": [ ["/color$/", "fill", "stroke"], { ignoreValues: { "/color$/": ["currentColor", "/^#[0-9a-fA-F]{3,6}$/", "inherit"], "fill": ["currentColor", "inherit"], "stroke": "currentColor", "z-index": "/^\\d+$/", }, }], // ... }
i did look in the scheme section ,didn’t find anything that could help am i missing something
I don’t have the repo public But I can put something together real quick tomorrow and will let you know
it does work without the message option both in vscode and from the terminal
Thank you. I need to look into it.
“stylelint”: “^13.11.0” “stylelint-declaration-strict-value”: “^1.7.7” node :13.7.0
and did try this its the same issue https://github.com/AndyOGo/stylelint-declaration-strict-value/blob/7f9475d9f701ac9a1657f33b1f59aa184ab9727a/test/custom-message.js#L15