mirror of
https://github.com/antebudimir/eslint-plugin-vanilla-extract.git
synced 2025-12-31 17:03:32 +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
|
|
@ -2,18 +2,20 @@ import alphabeticalOrderRule from './css-rules/alphabetical-order/index.js';
|
|||
import concentricOrderRule from './css-rules/concentric-order/index.js';
|
||||
import customOrderRule from './css-rules/custom-order/rule-definition.js';
|
||||
import noEmptyStyleBlocksRule from './css-rules/no-empty-blocks/rule-definition.js';
|
||||
import noUnknownUnitRule from './css-rules/no-unknown-unit/rule-definition.js';
|
||||
import noZeroUnitRule from './css-rules/no-zero-unit/rule-definition.js';
|
||||
|
||||
export const vanillaExtract = {
|
||||
meta: {
|
||||
name: '@antebudimir/eslint-plugin-vanilla-extract',
|
||||
version: '1.8.0',
|
||||
version: '1.9.0',
|
||||
},
|
||||
rules: {
|
||||
'alphabetical-order': alphabeticalOrderRule,
|
||||
'concentric-order': concentricOrderRule,
|
||||
'custom-order': customOrderRule,
|
||||
'no-empty-style-blocks': noEmptyStyleBlocksRule,
|
||||
'no-unknown-unit': noUnknownUnitRule,
|
||||
'no-zero-unit': noZeroUnitRule,
|
||||
},
|
||||
configs: {
|
||||
|
|
@ -22,6 +24,7 @@ export const vanillaExtract = {
|
|||
rules: {
|
||||
'vanilla-extract/concentric-order': 'error',
|
||||
'vanilla-extract/no-empty-style-blocks': 'error',
|
||||
'vanilla-extract/no-unknown-unit': 'error',
|
||||
'vanilla-extract/no-zero-unit': 'error',
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue