π OpenHands: AI-Driven Development
chore(lint): update shadcn lint to 0.2.1 (#18315)
Engel Nyst0f1b6f62507f
diff --git a/__tests__/scripts/raw-colors-lint.test.ts b/__tests__/scripts/raw-colors-lint.test.tsindex ff75fcea6c..3ab8d93d7d 100644--- a/__tests__/scripts/raw-colors-lint.test.ts+++ b/__tests__/scripts/raw-colors-lint.test.ts@@ -26,6 +26,20 @@ export function Probe() {`;describe("Canvas raw color rollout", () => {+ it("accepts SVG classes that disable paint", async () => {+ const [result] = await eslint.lintText(+ 'export function Probe() { return <svg className="fill-none stroke-none" />; }',+ { filePath: "src/routes/paint-probe.tsx" },+ );++ expect(result.fatalErrorCount).toBe(0);+ expect(+ result.messages.filter(+ (message) => message.ruleId === "shadcn/no-raw-colors",+ ),+ ).toEqual([]);+ });+it.each(["src/routes/color-probe.tsx", "src/ui/color-probe.tsx"])("warns on raw colors and unknown tokens while accepting verified tokens in %s",async (filePath) => {diff --git a/eslint.config.js b/eslint.config.jsindex 517c22ea83..4c0654ab04 100644--- a/eslint.config.js+++ b/eslint.config.js@@ -73,9 +73,7 @@ function createNoDirectAgentServerFetchRule() {return node.value;}if (node.type === "TemplateLiteral") {- return node.quasis- .map((q) => q.value.raw)- .join("");+ return node.quasis.map((q) => q.value.raw).join("");}return null;}@@ -168,8 +166,7 @@ export default [// @openhands/typescript-client clients instead of a raw `fetch`.local: {rules: {- "no-direct-agent-server-fetch":- createNoDirectAgentServerFetchRule(),+ "no-direct-agent-server-fetch": createNoDirectAgentServerFetchRule(),},},},@@ -398,8 +395,8 @@ export default [// Class existence does not need component contracts. With no remaining// unknown utilities, new findings fail lint; styling policy remains opt-in.// Canvas primitives use #/ui, not the plugin's default components/ui path.- // require-static-classes is enabled for those consumers; 0.2.0 still cannot- // read imported constants, so its documented narrow exceptions remain.+ // require-static-classes is enabled for those consumers; imported class+ // constants remain opaque, so its documented narrow exceptions remain.// no-raw-colors starts at warn while existing palette colors are migrated// and checked across themes (#18004). Keep verified plugin/config tokens exempt below.// no-restyle first protects divider/toggle appearances; layout remains public,@@ -410,7 +407,9 @@ export default [// for the remaining UI primitives and audit dynamic styles for no-inline-styles.// 0.2.0 also improves render-prop, destructuring, barrel-export, and custom// animation recognition. Vue/Svelte support adds no new rule names or parsers- // to this React project; keep this upgrade separate from rule activation.+ // to this React project. 0.2.1 uses Tailwind's JS-config loader and recognizes+ // module-defined font sizes, custom theme scales, and SVG paint-clearing classes.+ // Keep dependency upgrades separate from rule activation.{files: ["src/**/*.{ts,tsx}"],plugins: { shadcn: shadcnPlugin },@@ -423,7 +422,7 @@ export default [// Typography, menus, and Pre need a separate design audit.componentImports: ["^#/ui/(divider|toggle-switch|combobox-caret)$",- // 0.2.0 needs the existing re-export path matched explicitly too.+ // Match the existing re-export path explicitly too."^#/components/features/automations/toggle-switch$",],allow: ["layout"],@@ -450,7 +449,7 @@ export default ["shadcn/no-raw-colors": ["warn",{- // 0.2.0 reads CSS @theme tokens, but not these JS-config/plugin tokens.+ // Retain existing JS-config/plugin exceptions for a separate token audit.// Exact classes only: do not exempt raw palettes or whole namespaces.allow: [// hero.ts / @heroui/theme: semantic colors and the medium font size.diff --git a/package-lock.json b/package-lock.jsonindex 2d4b1a8b62..181c316244 100644--- a/package-lock.json+++ b/package-lock.json@@ -69,7 +69,7 @@"@eslint/js": "9.39.4","@playwright/test": "1.63.0","@react-router/dev": "7.18.2",- "@shadcn/lint": "0.2.0",+ "@shadcn/lint": "0.2.1","@stryker-mutator/core": "9.6.1","@stryker-mutator/vitest-runner": "9.6.1","@tailwindcss/node": "4.3.3",@@ -6932,14 +6932,14 @@"license": "MIT"},"node_modules/@shadcn/lint": {- "version": "0.2.0",- "resolved": "https://registry.npmjs.org/@shadcn/lint/-/lint-0.2.0.tgz",- "integrity": "sha512-DTYr427BR8cDc0J0Y++u1Uh12NAYGmdPiqgy4wKSogi7RNEhFanIcfBMPRPUvkunt9QiJUfI7B28TW39MrPCFA==",+ "version": "0.2.1",+ "resolved": "https://registry.npmjs.org/@shadcn/lint/-/lint-0.2.1.tgz",+ "integrity": "sha512-sDgmh/lb4yiPJMJZe5/jE6Vq5mgBzaIvKcdQ98faZk4c99WKTqASEhUqR6XCp7DDc29LwqTRIsula7kfhhDQnQ==","dev": true,"license": "MIT","dependencies": {"@eslint/core": "^0.17.0",- "cn": "0.3.2"+ "cn": "0.4.0"},"engines": {"node": ">=20.19"@@ -10492,9 +10492,9 @@}},"node_modules/cn": {- "version": "0.3.2",- "resolved": "https://registry.npmjs.org/cn/-/cn-0.3.2.tgz",- "integrity": "sha512-RKzY5Edavc8B2Ka6tjJecKFC4nm0p7lADY72xzICmiJSf4TkaxWXt0fHsib2P2G4FkFyXfSDi9oDtIBuCZvY2g==",+ "version": "0.4.0",+ "resolved": "https://registry.npmjs.org/cn/-/cn-0.4.0.tgz",+ "integrity": "sha512-qOAeUhPwPzBxx6jaeQdo646XIKliKHc2j1ZF7Ngb1o0pJZKH5gq8FkA0aVdUdPFUDXNXyUCXpCtoJISo6dhizg==","dev": true,"license": "MIT","bin": {diff --git a/package.json b/package.jsonindex 685f4a6779..85f63781bf 100644--- a/package.json+++ b/package.json@@ -131,7 +131,7 @@"@eslint/js": "9.39.4","@playwright/test": "1.63.0","@react-router/dev": "7.18.2",- "@shadcn/lint": "0.2.0",+ "@shadcn/lint": "0.2.1","@stryker-mutator/core": "9.6.1","@stryker-mutator/vitest-runner": "9.6.1","@tailwindcss/node": "4.3.3",