From 97bd47efca504b8fc5b2375e7d5fa178aa81dcb4 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Tue, 9 Dec 2025 09:59:08 +0800 Subject: [PATCH] chore: add `better-tailwindcss/enforce-canonical-classes` --- eslint.config.js | 3 +- package.json | 2 +- pnpm-lock.yaml | 67 +++++++++---------- src/layout/components/lay-navbar/index.vue | 2 +- .../lay-notice/components/NoticeItem.vue | 2 +- src/layout/components/lay-panel/index.vue | 4 +- src/views/able/excel.vue | 2 +- .../components/AccountManagement.vue | 5 +- .../components/Preferences.vue | 5 +- .../account-settings/components/Profile.vue | 5 +- .../components/SecurityLog.vue | 5 +- src/views/account-settings/index.vue | 2 +- src/views/components/upload/index.vue | 2 +- src/views/login/index.vue | 2 +- 14 files changed, 47 insertions(+), 61 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 31bfa31b4..c4e887e52 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -180,7 +180,8 @@ export default defineConfig([ "better-tailwindcss": eslintPluginBetterTailwindcss }, rules: { - "better-tailwindcss/enforce-consistent-variable-syntax": "warn" + "better-tailwindcss/enforce-consistent-variable-syntax": "warn", + "better-tailwindcss/enforce-canonical-classes": "warn" }, settings: { "better-tailwindcss": { diff --git a/package.json b/package.json index e1ca09258..a8009c3fe 100644 --- a/package.json +++ b/package.json @@ -141,7 +141,7 @@ "dagre": "^0.8.5", "eslint": "^9.39.1", "eslint-config-prettier": "^10.1.8", - "eslint-plugin-better-tailwindcss": "^3.8.0", + "eslint-plugin-better-tailwindcss": "4.0.0-beta.6", "eslint-plugin-prettier": "^5.5.4", "eslint-plugin-vue": "^10.6.2", "gradient-string": "^3.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9c4999e45..69a4fb095 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -286,8 +286,8 @@ importers: specifier: ^10.1.8 version: 10.1.8(eslint@9.39.1(jiti@2.6.1)) eslint-plugin-better-tailwindcss: - specifier: ^3.8.0 - version: 3.8.0(eslint@9.39.1(jiti@2.6.1))(tailwindcss@4.1.17) + specifier: 4.0.0-beta.6 + version: 4.0.0-beta.6(eslint@9.39.1(jiti@2.6.1))(tailwindcss@4.1.17)(typescript@5.9.3) eslint-plugin-prettier: specifier: ^5.5.4 version: 5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.1(jiti@2.6.1)))(eslint@9.39.1(jiti@2.6.1))(prettier@3.7.3) @@ -1921,6 +1921,11 @@ packages: peerDependencies: '@uppy/core': ^2.3.3 + '@valibot/to-json-schema@1.4.0': + resolution: {integrity: sha512-xziHfrrB6al8uoUI876eAYU5x+nZFYifCssYnxS/P7JYe9LjzeKWnqwb8Yno7ulL84Gp0ZNj2GUR+3GXtU8CZQ==} + peerDependencies: + valibot: ^1.2.0 + '@vitejs/plugin-vue-jsx@5.1.2': resolution: {integrity: sha512-3a2BOryRjG/Iih87x87YXz5c8nw27eSlHytvSKYfp8ZIsp5+FgFQoKeA7k2PnqWpjJrv6AoVTMnvmuKUXb771A==} engines: {node: ^20.19.0 || >=22.12.0} @@ -2950,12 +2955,12 @@ packages: peerDependencies: eslint: '>=7.0.0' - eslint-plugin-better-tailwindcss@3.8.0: - resolution: {integrity: sha512-bRJVOb47d3ONK4Qb6Zt58ra37E8rMCexWy7RuNgLQZS/Ch92oLRFBupa/s+FB1O9XRdph9ZMCXBiEFKc4gAGTQ==} - engines: {node: ^20.11.0 || >=21.2.0} + eslint-plugin-better-tailwindcss@4.0.0-beta.6: + resolution: {integrity: sha512-DBtvXwoDLM7xve7/HsT8Y6B1h5DsyUPoUo0eEHRxTCnsXiC7b/CM4JIOHOV7T1lEcQ+KxW6VwYh82w6t0m96sg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=23.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 - tailwindcss: ^3.3.0 || ^4.1.6 + tailwindcss: ^3.3.0 || ^4.1.15 eslint-plugin-prettier@5.5.4: resolution: {integrity: sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg==} @@ -4269,10 +4274,6 @@ packages: engines: {node: '>=0.10'} hasBin: true - pify@2.3.0: - resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} - engines: {node: '>=0.10.0'} - pinia@3.0.4: resolution: {integrity: sha512-l7pqLUFTI/+ESXn6k3nu30ZIzW5E2WZF/LaHJEpoq6ElcLD+wduZoB2kBN19du6K/4FDpPMazY2wJr+IndBtQw==} peerDependencies: @@ -4362,12 +4363,6 @@ packages: resolution: {integrity: sha512-5mMeb1TgLWoRKxZ0Xh9RZDfwUUIqRrcxO2uXO+Ezl1N5lqpCiSU5Gk6+1kZediBfBHFtPCdopr2UZ2SgUsKcgQ==} engines: {node: ^12 || >=14} - postcss-import@16.1.1: - resolution: {integrity: sha512-2xVS1NCZAfjtVdvXiyegxzJ447GyqCeEI5V7ApgQVOWnros1p5lGNovJNapwPpMombyFBfqDwt7AD3n2l0KOfQ==} - engines: {node: '>=18.0.0'} - peerDependencies: - postcss: ^8.0.0 - postcss-load-config@6.0.1: resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} engines: {node: '>= 18'} @@ -4618,9 +4613,6 @@ packages: react-is@17.0.2: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} - read-cache@1.0.0: - resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} - readable-stream@3.6.2: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} engines: {node: '>= 6'} @@ -5272,6 +5264,14 @@ packages: resolution: {integrity: sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w==} engines: {node: '>=10.12.0'} + valibot@1.2.0: + resolution: {integrity: sha512-mm1rxUsmOxzrwnX5arGS+U4T25RdvpPjPN4yR0u9pUBov9+zGVtO84tif1eY4r6zWxVxu3KzIyknJy3rxfRZZg==} + peerDependencies: + typescript: '>=5' + peerDependenciesMeta: + typescript: + optional: true + vditor@3.11.2: resolution: {integrity: sha512-8QguQQUPWbBFocnfQmWjz4jiykQnvsmCuhOomGIVVK7vc+dQq2h8w9qQQuEjUTZpnZT5fEdYbj4aLr1NGdAZaA==} @@ -7173,6 +7173,10 @@ snapshots: '@uppy/utils': 4.1.3 nanoid: 3.3.11 + '@valibot/to-json-schema@1.4.0(valibot@1.2.0(typescript@5.9.3))': + dependencies: + valibot: 1.2.0(typescript@5.9.3) + '@vitejs/plugin-vue-jsx@5.1.2(vite@7.2.4(@types/node@20.19.25)(jiti@2.6.1)(lightningcss@1.30.2)(sass@1.94.2)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3))': dependencies: '@babel/core': 7.28.5 @@ -8419,18 +8423,20 @@ snapshots: dependencies: eslint: 9.39.1(jiti@2.6.1) - eslint-plugin-better-tailwindcss@3.8.0(eslint@9.39.1(jiti@2.6.1))(tailwindcss@4.1.17): + eslint-plugin-better-tailwindcss@4.0.0-beta.6(eslint@9.39.1(jiti@2.6.1))(tailwindcss@4.1.17)(typescript@5.9.3): dependencies: '@eslint/css-tree': 3.6.8 + '@valibot/to-json-schema': 1.4.0(valibot@1.2.0(typescript@5.9.3)) enhanced-resolve: 5.18.3 eslint: 9.39.1(jiti@2.6.1) jiti: 2.6.1 - postcss: 8.5.6 - postcss-import: 16.1.1(postcss@8.5.6) synckit: 0.11.11 tailwind-csstree: 0.1.4 tailwindcss: 4.1.17 tsconfig-paths-webpack-plugin: 4.2.0 + valibot: 1.2.0(typescript@5.9.3) + transitivePeerDependencies: + - typescript eslint-plugin-prettier@5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.1(jiti@2.6.1)))(eslint@9.39.1(jiti@2.6.1))(prettier@3.7.3): dependencies: @@ -9934,8 +9940,6 @@ snapshots: pidtree@0.6.0: {} - pify@2.3.0: {} - pinia@3.0.4(typescript@5.9.3)(vue@3.5.25(typescript@5.9.3)): dependencies: '@vue/devtools-api': 7.7.9 @@ -10031,13 +10035,6 @@ snapshots: postcss: 8.5.6 postcss-safe-parser: 6.0.0(postcss@8.5.6) - postcss-import@16.1.1(postcss@8.5.6): - dependencies: - postcss: 8.5.6 - postcss-value-parser: 4.2.0 - read-cache: 1.0.0 - resolve: 1.22.11 - postcss-load-config@6.0.1(jiti@2.6.1)(postcss@8.5.6)(yaml@2.8.2): dependencies: lilconfig: 3.1.3 @@ -10257,10 +10254,6 @@ snapshots: react-is@17.0.2: {} - read-cache@1.0.0: - dependencies: - pify: 2.3.0 - readable-stream@3.6.2: dependencies: inherits: 2.0.4 @@ -10936,6 +10929,10 @@ snapshots: convert-source-map: 1.9.0 source-map: 0.7.6 + valibot@1.2.0(typescript@5.9.3): + optionalDependencies: + typescript: 5.9.3 + vditor@3.11.2: dependencies: diff-match-patch: 1.0.5 diff --git a/src/layout/components/lay-navbar/index.vue b/src/layout/components/lay-navbar/index.vue index 29a5d10ac..967a50918 100644 --- a/src/layout/components/lay-navbar/index.vue +++ b/src/layout/components/lay-navbar/index.vue @@ -33,7 +33,7 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();