From bbd5cc03231b8b831b44bdbd6e62bf736391cb1f Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Tue, 22 Sep 2026 12:22:12 -0700 Subject: [PATCH] chore(lint): exempt CollapsibleTrigger from no-restyle (#13024) Co-authored-by: Claude Fable 5 --- scripts/lint-restyle-ceiling.ts | 2 +- vite.config.ts | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/lint-restyle-ceiling.ts b/scripts/lint-restyle-ceiling.ts index 353481ac6477406645707940b74392ee63cb32ca..65177192cbd0f08925a1b025db9964645c489710 100644 --- a/scripts/lint-restyle-ceiling.ts +++ b/scripts/lint-restyle-ceiling.ts @@ -8,7 +8,7 @@ import * as NodeURL from "node:url"; // components/ui exports are migrated to variants (see vite.config.ts). This gate keeps the // count from growing: CI fails when findings exceed the ceiling. Lower the ceiling when you // migrate a file, and delete this script when the rule becomes an error. -export const RESTYLE_CEILING = 1143; +export const RESTYLE_CEILING = 1074; const RULE = "shadcn(no-restyle)"; diff --git a/vite.config.ts b/vite.config.ts index 038116709942e90b271b1850c6a3a1f255c6635f..6119c6f38bc93369c735fb3d372fc2ce9cabe5ed 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -178,7 +178,21 @@ export default defineConfig({ files: ["apps/web/src/**"], excludeFiles: ["apps/web/src/components/ui/**"], rules: { - "shadcn/no-restyle": ["warn", { allow: ["layout"] }], + "shadcn/no-restyle": [ + "warn", + { + allow: ["layout"], + contracts: [ + { + // CollapsibleTrigger is a bare button with no styled counterpart + // (a disclosure row is not a Button), so its className is the API. + // Every other trigger has one: style them with render={