New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow plugins to bail out of custom message and do it themselfs with substitutions #5170
Comments
@AndyOGo Thanks for the request. Labelling as a discussion for now. Ideally, we would provide a common way for using interpolated values in custom messages that all plugins can use, but in the meantime, an official flag may by the best option.
It picked up again in #4117, but the issue has stalled. |
I would love the ability to supplement the default message with extra info and recommendation. We have RTL aware Sass variables that we want developers to use instead of I would love to be able to do the following for example {
"rules": {
"property-disallowed-list": [
"/left|right$/",
{
"message": "${original_message}. Use the \"$start-direction\" & \"$end-direction\" SASS variables instead of \"left\" & \"right\".",
}
]
}
} or {
"rules": {
"property-disallowed-list": [
"/left|right$/",
{
"additional_message": "Use the \"$start-direction\" & \"$end-direction\" SASS variables instead of \"left\" & \"right\".",
}
]
}
} |
@jeddy3 Is there anything I can help with on this one? I would be keen to contribute, or is this needing internal discussion first? Thanks. |
@SalimBensiali Thanks for offering to contribute. The original interpolated custom messages issue (#4117) stalled, but a proof-of-concept pull request showing how this might work would be a good start in getting it going again. It is probably worth seeing if this problem has been solved in other tools, and applying their approach here in stylelint. |
Thanks @jeddy3. I will do some research and raise a POC PR afterwards. |
@ybiquitous is this achievable since #6312 merge? |
Yes, let's close this. The functional stylelint/docs/user-guide/configure.md Lines 150 to 160 in 68cb920
|
My plugin provides a custom
message
with substituted interpolations.Unfortunately they are overruled by stylelint's
message
option introduced with #672Support for substitutions has never been added and the request for it got closed #836
Seem that it is ignored because of this general solution, so I deleted the
customMessages
entry for my rule, like:Well, some official way of saying, hey stylelint this plugin is handling the
message
option by itself.Original issue in my plugin: AndyOGo/stylelint-declaration-strict-value#142
The text was updated successfully, but these errors were encountered: