Skip to content
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

Custom message support #46

Open
atomicrobokid opened this issue Aug 16, 2024 · 0 comments
Open

Custom message support #46

atomicrobokid opened this issue Aug 16, 2024 · 0 comments

Comments

@atomicrobokid
Copy link

Hi,

Any chance of getting custom message support (I know we can override the default message) - however some stylelint rules support message arguments:

An example from the stylelint docs:

  'color-no-hex': [true, {
    message: (hex) => `Don't use hex colors like "${hex}"`,
  }]

As the default message here is:
Unexpected custom property "something" inside declaration "background-color"

So in this case, it would look like
message: (property, decl) => The token "${property}" on property "${decl}" does not exist

Motivation for this is we would see linting errors if a user hasn't ran style dictionary build since they've added new tokens. That would enable us to give them a helpful prompt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant