From 87f3c8dd2b57f9586e1b8eb96ac258febb64c735 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Sat, 28 Feb 2026 14:45:00 +0800 Subject: [PATCH] lint --- web/package.json | 2 +- web/pnpm-lock.yaml | 11 ++++++----- web/tailwind-common-config.ts | 10 ++++++++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/web/package.json b/web/package.json index 9e344414dd..9478b4067f 100644 --- a/web/package.json +++ b/web/package.json @@ -222,7 +222,7 @@ "cross-env": "10.1.0", "esbuild": "0.27.2", "eslint": "10.0.2", - "eslint-plugin-better-tailwindcss": "4.3.1", + "eslint-plugin-better-tailwindcss": "https://pkg.pr.new/hyoban/eslint-plugin-better-tailwindcss@a520d15", "eslint-plugin-hyoban": "0.11.2", "eslint-plugin-react-hooks": "7.0.1", "eslint-plugin-react-refresh": "0.5.2", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index a869b21f40..a754e0aa7a 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -533,8 +533,8 @@ importers: specifier: 10.0.2 version: 10.0.2(jiti@1.21.7) eslint-plugin-better-tailwindcss: - specifier: 4.3.1 - version: 4.3.1(eslint@10.0.2(jiti@1.21.7))(tailwindcss@3.4.19(tsx@4.21.0)(yaml@2.8.2))(typescript@5.9.3) + specifier: https://pkg.pr.new/hyoban/eslint-plugin-better-tailwindcss@a520d15 + version: https://pkg.pr.new/hyoban/eslint-plugin-better-tailwindcss@a520d15(eslint@10.0.2(jiti@1.21.7))(tailwindcss@3.4.19(tsx@4.21.0)(yaml@2.8.2))(typescript@5.9.3) eslint-plugin-hyoban: specifier: 0.11.2 version: 0.11.2(eslint@10.0.2(jiti@1.21.7)) @@ -4677,8 +4677,9 @@ packages: peerDependencies: eslint: '*' - eslint-plugin-better-tailwindcss@4.3.1: - resolution: {integrity: sha512-b6xM31GukKz0WlgMD0tQdY/rLjf/9mWIk8EcA45ngOKJPPQf1C482xZtBlT357jyunQE2mOk4NlPcL4i9Pr85A==} + eslint-plugin-better-tailwindcss@https://pkg.pr.new/hyoban/eslint-plugin-better-tailwindcss@a520d15: + resolution: {integrity: sha512-hbxpqInIW0Q5UIwXEuQxSBjrMd5bYttXeSPU6dfK2zpECKNIzGR+KXZZEdZaPagEMDJosSyQ9RKievmBcCAxfA==, tarball: https://pkg.pr.new/hyoban/eslint-plugin-better-tailwindcss@a520d15} + version: 4.3.1 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 @@ -12345,7 +12346,7 @@ snapshots: dependencies: eslint: 10.0.2(jiti@1.21.7) - eslint-plugin-better-tailwindcss@4.3.1(eslint@10.0.2(jiti@1.21.7))(tailwindcss@3.4.19(tsx@4.21.0)(yaml@2.8.2))(typescript@5.9.3): + eslint-plugin-better-tailwindcss@https://pkg.pr.new/hyoban/eslint-plugin-better-tailwindcss@a520d15(eslint@10.0.2(jiti@1.21.7))(tailwindcss@3.4.19(tsx@4.21.0)(yaml@2.8.2))(typescript@5.9.3): dependencies: '@eslint/css-tree': 3.6.9 '@valibot/to-json-schema': 1.5.0(valibot@1.2.0(typescript@5.9.3)) diff --git a/web/tailwind-common-config.ts b/web/tailwind-common-config.ts index a1898fbcef..cbd58e2809 100644 --- a/web/tailwind-common-config.ts +++ b/web/tailwind-common-config.ts @@ -13,6 +13,14 @@ const _dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)) +const disableSVGOptimize = process.env.TAILWIND_MODE === 'ESLINT' +const svgOptimizeConfig = { + cleanupSVG: !disableSVGOptimize, + deOptimisePaths: !disableSVGOptimize, + runSVGO: !disableSVGOptimize, + parseColors: !disableSVGOptimize, +} + const config = { theme: { typography, @@ -167,11 +175,13 @@ const config = { source: path.resolve(_dirname, 'app/components/base/icons/assets/public'), prefix: 'custom-public', ignoreImportErrors: true, + ...svgOptimizeConfig, }), ...importSvgCollections({ source: path.resolve(_dirname, 'app/components/base/icons/assets/vender'), prefix: 'custom-vender', ignoreImportErrors: true, + ...svgOptimizeConfig, }), }, extraProperties: {