Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 1.26 KB

File metadata and controls

47 lines (37 loc) · 1.26 KB

RHDS Stylelint Plugin

# .stylelintrc.yml
extends: stylelint-config-standard

# add the plugin:
plugins:
  - ./node_modules/@rhds/tokens/plugins/stylelint.js

# Make sure to activate the rule:
rules:
  rhds/token-values: true
  rhds/no-unknown-token-name: true

Be sure to configure your editor to fix stylelint issues on save:

Rules

deprecated

Replaces deprecated tokens with their new versions.

token-values

Validates that the fallback values for tokens correspond with the values specified in the token sources. Automatically fixed incorrect values. This rule has no options.

no-unknown-token-name

Validates CSS Custom Property names beginning with --rh are legit token names.

Options

This rule can take a dictionary of names to migrate, and if it finds one of the specified names, it will automatically replace it with the new one.

rules:
  rhds/no-unknown-token-name:
    - true
    - allowed:
      - --rh-icon-color
      migrations:
      # instances of gray-90 will be replaced with gray-95
      --rh-color-gray-90: --rh-color-gray-95