Skip to content

Commit

Permalink
fix(prettier-plugin): sort compoundVariants/staticCss last for cva/re…
Browse files Browse the repository at this point in the history
…cipes
  • Loading branch information
astahmer committed Apr 3, 2024
1 parent 8176eb6 commit 581c38c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wet-fishes-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pandabox/prettier-plugin": patch
---

fix(prettier-plugin): sort compoundVariants/staticCss last for cva/recipes
11 changes: 10 additions & 1 deletion packages/prettier-plugin/src/pretty-panda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ import type { PluginOptions } from './options'

const NodeType = TSESTree.AST_NODE_TYPES
const recipeFnNames = ['cva', 'sva', 'defineRecipe', 'defineSlotRecipe']
const cvaOrder = ['className', 'description', 'slots', 'base', 'variants', 'defaultVariants']
const cvaOrder = [
'className',
'description',
'slots',
'base',
'variants',
'defaultVariants',
'compoundVariants',
'staticCss',
]
const pandaConfigFns = ['defineStyles', 'defineRecipe', 'defineSlotRecipe']

export class PrettyPanda {
Expand Down

0 comments on commit 581c38c

Please sign in to comment.