From 61d2ad572a77cc4a717126f1ce42115603b3447c Mon Sep 17 00:00:00 2001 From: Stephen Zhou Date: Mon, 13 Jul 2026 18:30:52 +0800 Subject: [PATCH] chore: improve static check performance (#38866) --- .github/workflows/autofix.yml | 2 +- lint.config.ts | 18 --------- package.json | 1 - pnpm-lock.yaml | 38 ------------------- pnpm-workspace.yaml | 1 - vite.config.ts | 2 +- web/app/components/plugins/card/index.tsx | 1 - .../workflow/block-selector/tabs.tsx | 3 +- 8 files changed, 3 insertions(+), 63 deletions(-) diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index e1f6fbe7c46..d05ebed87d5 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -13,7 +13,7 @@ permissions: jobs: autofix: if: github.repository == 'langgenius/dify' - runs-on: depot-ubuntu-24.04 + runs-on: depot-ubuntu-24.04-4 steps: - name: Complete merge group check if: github.event_name == 'merge_group' diff --git a/lint.config.ts b/lint.config.ts index bd70c6f5156..25eac7767de 100644 --- a/lint.config.ts +++ b/lint.config.ts @@ -2,8 +2,6 @@ import type { OxlintConfig } from 'vite-plus/lint' import path from 'node:path' const rootDir = import.meta.dirname -const webDir = path.resolve(rootDir, 'web') -const webTailwindEntry = path.resolve(webDir, 'app/styles/globals.css') const difyUiPackageJson = path.resolve(rootDir, 'packages/dify-ui/package.json') /** @@ -81,10 +79,6 @@ export const lintConfig = { 'eslint-plugin-no-barrel-files', '@tanstack/eslint-plugin-query', 'eslint-plugin-storybook', - { - name: 'tailwindcss', - specifier: 'eslint-plugin-better-tailwindcss', - }, 'eslint-plugin-hyoban', ], options: { @@ -94,10 +88,6 @@ export const lintConfig = { typeCheck: true, }, settings: { - 'better-tailwindcss': { - cwd: webDir, - entryPoint: webTailwindEntry, - }, 'react-x': { additionalStateHooks: '/^use\\w*State(?:s)?|useAtom$/u', }, @@ -830,14 +820,6 @@ export const lintConfig = { 'storybook/no-uninstalled-addons': 'error', }, }, - { - files: ['web/**/*.{ts,cts,mts}', 'web/**/*.tsx'], - rules: { - 'tailwindcss/no-duplicate-classes': 'error', - 'tailwindcss/no-unknown-classes': 'warn', - }, - excludeFiles: ['web/**/__tests__/**', 'web/**/*.spec.{ts,tsx}', 'web/**/*.test.{ts,tsx}'], - }, { files: ['web/**/*.tsx'], rules: { diff --git a/package.json b/package.json index f3a537aaaef..68ae579a854 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "eslint": "catalog:", "eslint-markdown": "catalog:", "eslint-plugin-antfu": "catalog:", - "eslint-plugin-better-tailwindcss": "catalog:", "eslint-plugin-command": "catalog:", "eslint-plugin-erasable-syntax-only": "catalog:", "eslint-plugin-hyoban": "catalog:", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 09a23c60978..eac4458965b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -336,9 +336,6 @@ catalogs: eslint-plugin-antfu: specifier: 3.2.3 version: 3.2.3 - eslint-plugin-better-tailwindcss: - specifier: 4.6.1 - version: 4.6.1 eslint-plugin-command: specifier: 3.5.2 version: 3.5.2 @@ -707,9 +704,6 @@ importers: eslint-plugin-antfu: specifier: 'catalog:' version: 3.2.3(eslint@10.6.0(jiti@2.7.0)(supports-color@10.2.2)) - eslint-plugin-better-tailwindcss: - specifier: 'catalog:' - version: 4.6.1(@typescript/typescript6@6.0.2)(eslint@10.6.0(jiti@2.7.0)(supports-color@10.2.2))(oxlint@1.72.0(oxlint-tsgolint@0.24.0)(vite-plus@0.2.4(@types/node@26.0.1)(@typescript/typescript6@6.0.2)(@vitest/browser-playwright@4.1.10)(@vitest/coverage-v8@4.1.10)(@voidzero-dev/vite-plus-core@0.2.4(@types/node@26.0.1)(@typescript/typescript6@6.0.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.0)(yaml@2.9.0))(esbuild@0.28.1)(happy-dom@20.10.6)(jiti@2.7.0)(tsx@4.23.0)(yaml@2.9.0)))(tailwindcss@4.3.2) eslint-plugin-command: specifier: 'catalog:' version: 3.5.2(@typescript-eslint/typescript-estree@8.63.0(@typescript/typescript6@6.0.2))(@typescript-eslint/utils@8.63.0(@typescript/typescript6@6.0.2)(eslint@10.6.0(jiti@2.7.0)(supports-color@10.2.2)))(eslint@10.6.0(jiti@2.7.0)(supports-color@10.2.2)) @@ -6374,19 +6368,6 @@ packages: peerDependencies: eslint: '*' - eslint-plugin-better-tailwindcss@4.6.1: - resolution: {integrity: sha512-Lr8mPyuaZ+dS6ATuJaPwcOFOpOUsRBs5TXyOPqiTzLy0SvK4+0G6usbklCuQn4QabwFtNKdSXwl2WxOIPvu0lQ==} - engines: {node: ^20.19.0 || ^22.12.0 || >=23.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 - oxlint: ^1.35.0 - tailwindcss: ^3.3.0 || ^4.1.17 - peerDependenciesMeta: - eslint: - optional: true - oxlint: - optional: true - eslint-plugin-command@3.5.2: resolution: {integrity: sha512-PA59QAkQDwvcCMEt5lYLJLI3zDGVKJeC4id/pcRY2XdRYhSGW7iyYT1VC1N3bmpuvu6Qb/9QptiS3GJMjeGTJg==} peerDependencies: @@ -14628,24 +14609,6 @@ snapshots: dependencies: eslint: 10.6.0(jiti@2.7.0)(supports-color@10.2.2) - eslint-plugin-better-tailwindcss@4.6.1(@typescript/typescript6@6.0.2)(eslint@10.6.0(jiti@2.7.0)(supports-color@10.2.2))(oxlint@1.72.0(oxlint-tsgolint@0.24.0)(vite-plus@0.2.4(@types/node@26.0.1)(@typescript/typescript6@6.0.2)(@vitest/browser-playwright@4.1.10)(@vitest/coverage-v8@4.1.10)(@voidzero-dev/vite-plus-core@0.2.4(@types/node@26.0.1)(@typescript/typescript6@6.0.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.0)(yaml@2.9.0))(esbuild@0.28.1)(happy-dom@20.10.6)(jiti@2.7.0)(tsx@4.23.0)(yaml@2.9.0)))(tailwindcss@4.3.2): - dependencies: - '@eslint/css-tree': 4.0.4 - '@valibot/to-json-schema': 1.7.1(valibot@1.4.2(@typescript/typescript6@6.0.2)) - enhanced-resolve: 5.24.1 - jiti: 2.7.0 - synckit: 0.11.13 - tailwind-csstree: 0.3.3 - tailwindcss: 4.3.2 - tsconfig-paths-webpack-plugin: 4.2.0 - valibot: 1.4.2(@typescript/typescript6@6.0.2) - optionalDependencies: - eslint: 10.6.0(jiti@2.7.0)(supports-color@10.2.2) - oxlint: 1.72.0(oxlint-tsgolint@0.24.0)(vite-plus@0.2.4(@types/node@26.0.1)(@typescript/typescript6@6.0.2)(@vitest/browser-playwright@4.1.10)(@vitest/coverage-v8@4.1.10)(@voidzero-dev/vite-plus-core@0.2.4(@types/node@26.0.1)(@typescript/typescript6@6.0.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.0)(yaml@2.9.0))(esbuild@0.28.1)(happy-dom@20.10.6)(jiti@2.7.0)(tsx@4.23.0)(yaml@2.9.0)) - transitivePeerDependencies: - - '@eslint/css' - - typescript - eslint-plugin-command@3.5.2(@typescript-eslint/typescript-estree@8.63.0(@typescript/typescript6@6.0.2))(@typescript-eslint/utils@8.63.0(@typescript/typescript6@6.0.2)(eslint@10.6.0(jiti@2.7.0)(supports-color@10.2.2)))(eslint@10.6.0(jiti@2.7.0)(supports-color@10.2.2)): dependencies: '@es-joy/jsdoccomment': 0.84.0 @@ -19339,7 +19302,6 @@ time: es-toolkit@1.49.0: '2026-06-26T00:26:01.050Z' eslint-markdown@0.12.1: '2026-07-10T23:35:26.055Z' eslint-plugin-antfu@3.2.3: '2026-05-11T02:24:38.348Z' - eslint-plugin-better-tailwindcss@4.6.1: '2026-07-03T15:13:24.013Z' eslint-plugin-command@3.5.2: '2026-02-25T04:29:02.155Z' eslint-plugin-erasable-syntax-only@0.4.2: '2026-06-18T00:56:01.038Z' eslint-plugin-hyoban@0.14.1: '2026-03-08T02:51:00.805Z' diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index f7fac5c2b70..7ff647bd079 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -161,7 +161,6 @@ catalog: eslint: 10.6.0 eslint-markdown: 0.12.1 eslint-plugin-antfu: 3.2.3 - eslint-plugin-better-tailwindcss: 4.6.1 eslint-plugin-command: 3.5.2 eslint-plugin-erasable-syntax-only: 0.4.2 eslint-plugin-hyoban: 0.14.1 diff --git a/vite.config.ts b/vite.config.ts index 6baf45aa69e..5165e58bafe 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -71,7 +71,7 @@ export default defineConfig({ sortPackageJson: true, sortTailwindcss: { functions: ['cn', 'clsx', 'cva', 'tw', 'twMerge'], - preserveDuplicates: true, + preserveDuplicates: false, stylesheet: 'web/app/styles/globals.css', }, }, diff --git a/web/app/components/plugins/card/index.tsx b/web/app/components/plugins/card/index.tsx index e8354d4055f..21f9f6485b3 100644 --- a/web/app/components/plugins/card/index.tsx +++ b/web/app/components/plugins/card/index.tsx @@ -77,7 +77,6 @@ const Card = ({ const cornerMarkText = categoriesMap[type === 'bundle' ? type : category]?.label ?? '' const wrapClassName = cn( - // oxlint-disable-next-line tailwindcss/no-unknown-classes -- Used by page feedback tooling to identify plugin cards. 'hover-bg-components-panel-on-panel-item-bg relative overflow-hidden rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-on-panel-item-bg shadow-xs', isMarketplaceVariant && 'h-[148px] transition-all group-hover:bg-components-panel-on-panel-item-bg-hover group-hover:shadow-md', diff --git a/web/app/components/workflow/block-selector/tabs.tsx b/web/app/components/workflow/block-selector/tabs.tsx index 28af9064063..d2b70361b85 100644 --- a/web/app/components/workflow/block-selector/tabs.tsx +++ b/web/app/components/workflow/block-selector/tabs.tsx @@ -123,8 +123,7 @@ const TabHeaderItem = ({ tab.disabled ? 'cursor-not-allowed text-text-disabled opacity-60' : activeTab === tab.key - ? // oxlint-disable-next-line tailwindcss/no-unknown-classes - 'sm-no-bottom cursor-default bg-components-panel-bg text-text-accent' + ? 'sm-no-bottom cursor-default bg-components-panel-bg text-text-accent' : 'cursor-pointer text-text-tertiary', )