diff --git a/.changeset/wet-fishes-flash.md b/.changeset/wet-fishes-flash.md new file mode 100644 index 000000000..2c9ac6d1f --- /dev/null +++ b/.changeset/wet-fishes-flash.md @@ -0,0 +1,5 @@ +--- +"@pandabox/prettier-plugin": patch +--- + +fix(prettier-plugin): sort compoundVariants/staticCss last for cva/recipes diff --git a/packages/prettier-plugin/src/pretty-panda.ts b/packages/prettier-plugin/src/pretty-panda.ts index 62f2a921e..79d73775c 100644 --- a/packages/prettier-plugin/src/pretty-panda.ts +++ b/packages/prettier-plugin/src/pretty-panda.ts @@ -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 {