mirror of
https://github.com/antebudimir/eslint-plugin-vanilla-extract.git
synced 2026-01-03 10:01:38 +00:00
refactor ♻️: improve code quality and test coverage
- Fix handling of missing groupOrder configuration - Refactor negative conditions to positive ones with optional chaining - Add comprehensive tests to achieve total coverage
This commit is contained in:
parent
5557409368
commit
46751da51b
15 changed files with 310 additions and 186 deletions
|
|
@ -16,13 +16,11 @@ import { enforceAlphabeticalCSSOrderInStyleObject } from './style-object-process
|
|||
* 3. For each relevant property (e.g., 'base', 'variants'), it applies alphabetical ordering to the CSS properties.
|
||||
*/
|
||||
export const enforceAlphabeticalCSSOrderInRecipe = (node: TSESTree.CallExpression, context: Rule.RuleContext): void => {
|
||||
if (!node.arguments[0] || node.arguments[0].type !== 'ObjectExpression') {
|
||||
return;
|
||||
if (node.arguments[0]?.type === 'ObjectExpression') {
|
||||
const recipeObject = node.arguments[0];
|
||||
|
||||
processRecipeProperties(context, recipeObject, (context, object) =>
|
||||
processStyleNode(context, object, enforceAlphabeticalCSSOrderInStyleObject),
|
||||
);
|
||||
}
|
||||
|
||||
const recipeObject = node.arguments[0];
|
||||
|
||||
processRecipeProperties(context, recipeObject, (context, object) =>
|
||||
processStyleNode(context, object, enforceAlphabeticalCSSOrderInStyleObject),
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue