mirror of
https://github.com/antebudimir/eslint-plugin-vanilla-extract.git
synced 2026-01-01 17:23:31 +00:00
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:
parent
7dc7204749
commit
f880c051ff
11 changed files with 623 additions and 5 deletions
|
|
@ -12,7 +12,7 @@ const noZeroUnitRule: Rule.RuleModule = {
|
|||
fixable: 'code',
|
||||
schema: [],
|
||||
messages: {
|
||||
noZeroUnit: 'Unit with zero value is unnecessary. Use 0 instead.',
|
||||
noZeroUnit: 'Zero values don’t need a unit. Replace with "0".',
|
||||
},
|
||||
},
|
||||
create(context) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue