mirror of
https://github.com/antebudimir/eslint-plugin-vanilla-extract.git
synced 2025-12-31 08:53:33 +00:00
feat 🥁: add no-zero-unit rule
This rule enforces unitless zero values in vanilla-extract style objects: - Automatically removes unnecessary units from zero values - Handles both positive and negative zero values - Preserves units where required (time properties, CSS functions) - Works with all vanilla-extract APIs
This commit is contained in:
parent
52d38d4477
commit
7dc7204749
20 changed files with 650 additions and 737 deletions
|
|
@ -13,11 +13,11 @@ import { areAllChildrenEmpty, getStyleKeyName } from './property-utils.js';
|
|||
* @param recipeNode The recipe object node to process.
|
||||
* @param reportedNodes A set of nodes that have already been reported by other processors.
|
||||
*/
|
||||
export function processRecipeProperties(
|
||||
export const processRecipeProperties = (
|
||||
ruleContext: Rule.RuleContext,
|
||||
recipeNode: TSESTree.ObjectExpression,
|
||||
reportedNodes: Set<TSESTree.Node>,
|
||||
): void {
|
||||
): void => {
|
||||
recipeNode.properties.forEach((property) => {
|
||||
if (property.type !== 'Property') {
|
||||
return;
|
||||
|
|
@ -139,4 +139,4 @@ export function processRecipeProperties(
|
|||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue