Skip to content

feat(linter): Improve format check in linter#2538

Merged
aweell merged 7 commits intoproductionfrom
aweellll-improvements-in-linter
Feb 17, 2026
Merged

feat(linter): Improve format check in linter#2538
aweell merged 7 commits intoproductionfrom
aweellll-improvements-in-linter

Conversation

@aweell
Copy link
Copy Markdown
Collaborator

@aweell aweell commented Feb 6, 2026

Pull Request Description: Improve Format Check in Linter

This pull request enhances the linter's functionality by introducing two distinct validation modes: format and contrast.

Motivation

The primary motivation behind this change is to improve the validation process for design tokens by providing clear and targeted checks. Previously, the linter was limited in its ability to validate token descriptions against palette references and ensure compliance with WCAG contrast standards. This update allows for a more structured approach to validation, enabling developers to focus on specific aspects of their tokens.

Key Improvements

  1. Format Mode: This mode checks for:

    • Description Mismatches: Ensures that the description of each token matches its corresponding palette reference.
    • Invalid Palette References: Identifies any references to palette colors that do not exist.
  2. Contrast Mode: This mode checks for:

    • WCAG Compliance: Validates that foreground and background color combinations meet the required contrast ratios, while skipping colors with alpha transparency and gradients.
  3. Enhanced User Experience: The command-line interface has been updated to prompt users for the desired validation mode, making it easier to use the linter effectively without needing to remember specific command-line arguments.

  4. Error Reporting: The linter now provides detailed error messages for both description mismatches and contrast failures, along with suggestions for alternative colors that meet contrast requirements.

By implementing these changes, this pull request significantly enhances the robustness of our linter, ensuring that our design tokens are both accurately described and compliant with accessibility standards. This ultimately leads to a more consistent and accessible user experience across our applications.

@aweell aweell requested a review from yceballost February 6, 2026 10:24
@aweell aweell changed the title Improve format check in linter feat(linter): Improve format check in linter Feb 6, 2026
Comment thread tokens/linter/README.md
Comment thread tokens/linter/contrastPairs.js Outdated
@aweell aweell added this pull request to the merge queue Feb 17, 2026
Merged via the queue into production with commit c69623c Feb 17, 2026
10 checks passed
@aweell aweell deleted the aweellll-improvements-in-linter branch February 17, 2026 12:46
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

Successfully merging this pull request may close these issues.

2 participants