Skip to content

Custom message support #46

Open
Open
@atomicrobokid

Description

@atomicrobokid

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions