mirror of
https://github.com/antebudimir/eslint-plugin-vanilla-extract.git
synced 2026-01-01 01:13:32 +00:00
feat 🥁: add no-zero-unit rule
This commit is contained in:
parent
52d38d4477
commit
c1b4e70bd9
19 changed files with 784 additions and 285 deletions
|
|
@ -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',
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue