feat 🥁: add no-zero-unit rule

This commit is contained in:
Ante Budimir 2025-04-12 20:43:11 +03:00
parent 52d38d4477
commit c1b4e70bd9
19 changed files with 784 additions and 285 deletions

View file

@ -6,12 +6,12 @@ import { reportEmptyDeclaration } from './fix-utils.js';
/**
* Handles conditional expressions with empty objects.
*/
export function processConditionalExpression(
export const processConditionalExpression = (
context: Rule.RuleContext,
node: TSESTree.ConditionalExpression,
reportedNodes: Set<TSESTree.Node>,
callNode: TSESTree.CallExpression,
): void {
): void => {
const isConsequentEmpty = node.consequent.type === 'ObjectExpression' && isEmptyObject(node.consequent);
const isAlternateEmpty = node.alternate.type === 'ObjectExpression' && isEmptyObject(node.alternate);
@ -33,4 +33,4 @@ export function processConditionalExpression(
messageId: 'emptyConditionalStyle',
});
}
}
};