Use parameterized custom messages #263
Labels
status: ask to implement
ask before implementing as may no longer be relevant
type: enhancement
a new feature that isn't related to rules
What is the problem you're trying to solve?
This sharable config
stylelint-config-standard
has defined a custom message for a few rules, for example of theselector-class-pattern
:stylelint-config-standard/index.js
Lines 136 to 141 in f569bb1
A custom message (demo):
An original message (demo):
It would seem more useful if the custom message would become as below:
What solution would you like to see?
We have added the experimental feature for custom message formatting via stylelint/stylelint#6312 and the 14.12.0 version, so we can use it here.
I suggest like this:
Also, we need to update the built-in rules to enable the custom formatting for the rules using a custom message in
stylelint-config-standard
. Like this:See also the built-in rule code.
Target rules can be as below:
custom-media-pattern
custom-property-pattern
keyframes-name-pattern
selector-class-pattern
selector-id-pattern
The text was updated successfully, but these errors were encountered: