feat 🥁: add no-unknown-unit rule

Adds a rule to disallow unknown or invalid CSS units in vanilla-extract style objects.

- Reports any usage of unrecognized units in property values
- Handles all vanilla-extract APIs (style, styleVariants, recipe, etc.)
- Ignores valid units in special contexts (e.g., CSS functions, custom properties)

No autofix is provided because replacing or removing unknown units may result in unintended or invalid CSS. Manual developer review is required to ensure correctness.
This commit is contained in:
Ante Budimir 2025-04-16 09:43:06 +03:00
parent 7dc7204749
commit f880c051ff
11 changed files with 623 additions and 5 deletions

View file

@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.9.0] - 2025-04-16
- add new rule `no-unknown-unit` that disallows unknown or invalid CSS units in vanilla-extract style objects.
- Reports any usage of unrecognized units in property values
- Handles all vanilla-extract APIs, including style, recipe, fontFace, and keyframes
- Ignores valid units in special contexts (e.g., CSS functions, custom properties)
- Supports nested objects, media queries, and pseudo-selectors
- No autofix is provided because replacing or removing unknown units may result in unintended or invalid CSS; manual developer review is required
## [1.8.0] - 2025-04-12
- add new rule `no-zero-unit` that enforces unitless zero values in vanilla-extract style objects