From 411314e1f86e8ea0e512ec76ce9d3e779900e67b Mon Sep 17 00:00:00 2001 From: Hooray <304327508@qq.com> Date: Tue, 28 Mar 2023 01:15:22 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9lint=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 2 + .eslintrc | 1 + .lintstagedrc | 5 +-- .stylelintignore | 6 +-- package.json | 12 +++--- pnpm-lock.yaml | 94 ++++++++++++++++++++++++++----------------- src/types/global.d.ts | 5 +-- src/views/login.vue | 4 +- 8 files changed, 75 insertions(+), 54 deletions(-) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..de4d1f00 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +dist +node_modules diff --git a/.eslintrc b/.eslintrc index cff738ea..5e3553a6 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,7 @@ { "extends": "@antfu", "rules": { + "eslint-comments/no-unlimited-disable": "off", "curly": ["error", "all"], "vue/component-tags-order": ["error", { "order": ["route", "script", "template", "style"] diff --git a/.lintstagedrc b/.lintstagedrc index 541fa592..3141742e 100644 --- a/.lintstagedrc +++ b/.lintstagedrc @@ -1,5 +1,4 @@ { - "src/**/*.{js,jsx,ts,tsx}": "eslint --cache --fix", - "src/**/*.{css,scss}": "stylelint --cache --fix --allow-empty-input", - "src/**/*.vue": ["eslint --cache --fix", "stylelint --cache --fix --allow-empty-input"] + "src/**/*.{ts,tsx,vue}": "eslint --cache --fix --no-ignore --no-error-on-unmatched-pattern", + "src/**/*.{css,scss,vue}": "stylelint --cache --fix --allow-empty-input" } diff --git a/.stylelintignore b/.stylelintignore index a1d18c49..d6815c86 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -1,3 +1,3 @@ -dist/ -node_modules/ -src/assets/sprites/ +dist +node_modules +src/assets/sprites diff --git a/package.json b/package.json index 6e542655..ddc1f904 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "new": "plop", "lint": "npm-run-all -s lint:tsc lint:eslint lint:stylelint", "lint:tsc": "vue-tsc --noEmit", - "lint:eslint": "eslint src/**/*.{ts,tsx,vue} --cache --fix", - "lint:stylelint": "stylelint src/**/*.{css,scss,vue} --cache --fix", + "lint:eslint": "eslint src/**/*.{ts,tsx,vue} --cache --fix --no-ignore --no-error-on-unmatched-pattern", + "lint:stylelint": "stylelint src/**/*.{css,scss,vue} --cache --fix --allow-empty-input", "postinstall": "simple-git-hooks && esno scripts/prepare.js", "preinstall": "npx only-allow pnpm", "commit": "git cz", @@ -59,17 +59,17 @@ "npm-run-all": "^4.1.5", "plop": "^3.1.2", "postcss-html": "^1.5.0", - "sass": "^1.59.3", + "sass": "^1.60.0", "simple-git-hooks": "^2.8.1", "stylelint": "^15.3.0", "stylelint-config-standard": "^31.0.0", "stylelint-config-standard-scss": "^7.0.1", "stylelint-config-standard-vue": "^1.0.0", - "stylelint-scss": "^4.5.0", + "stylelint-scss": "^4.6.0", "svgo": "^3.0.2", - "terser": "^5.16.6", + "terser": "^5.16.8", "typescript": "^5.0.2", - "unplugin-auto-import": "^0.15.1", + "unplugin-auto-import": "^0.15.2", "unplugin-vue-components": "^0.24.1", "vite": "^4.2.1", "vite-plugin-banner": "^0.7.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9d96e2eb..892a767c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,18 +36,18 @@ specifiers: plop: ^3.1.2 postcss-html: ^1.5.0 qs: ^6.11.1 - sass: ^1.59.3 + sass: ^1.60.0 simple-git-hooks: ^2.8.1 stylelint: ^15.3.0 stylelint-config-standard: ^31.0.0 stylelint-config-standard-scss: ^7.0.1 stylelint-config-standard-vue: ^1.0.0 - stylelint-scss: ^4.5.0 + stylelint-scss: ^4.6.0 svgo: ^3.0.2 - terser: ^5.16.6 + terser: ^5.16.8 tinymce: ^6.4.0 typescript: ^5.0.2 - unplugin-auto-import: ^0.15.1 + unplugin-auto-import: ^0.15.2 unplugin-vue-components: ^0.24.1 vconsole: ^3.15.0 vite: ^4.2.1 @@ -106,19 +106,19 @@ devDependencies: npm-run-all: 4.1.5 plop: 3.1.2 postcss-html: 1.5.0 - sass: 1.59.3 + sass: 1.60.0 simple-git-hooks: 2.8.1 stylelint: 15.3.0 stylelint-config-standard: 31.0.0_stylelint@15.3.0 stylelint-config-standard-scss: 7.0.1_stylelint@15.3.0 stylelint-config-standard-vue: 1.0.0_o7z2z2yv565o3a3uaodintvte4 - stylelint-scss: 4.5.0_stylelint@15.3.0 + stylelint-scss: 4.6.0_stylelint@15.3.0 svgo: 3.0.2 - terser: 5.16.6 + terser: 5.16.8 typescript: 5.0.2 - unplugin-auto-import: 0.15.1_@vueuse+core@9.13.0 + unplugin-auto-import: 0.15.2_@vueuse+core@9.13.0 unplugin-vue-components: 0.24.1_vue@3.2.47 - vite: 4.2.1_sass@1.59.3+terser@5.16.6 + vite: 4.2.1_sass@1.60.0+terser@5.16.8 vite-plugin-banner: 0.7.0 vite-plugin-compression: 0.5.1_vite@4.2.1 vite-plugin-mock: 2.9.6_mockjs@1.1.0+vite@4.2.1 @@ -1328,7 +1328,7 @@ packages: '@babel/core': 7.21.3 '@babel/plugin-transform-typescript': 7.21.3_@babel+core@7.21.3 '@vue/babel-plugin-jsx': 1.1.1_@babel+core@7.21.3 - vite: 4.2.1_sass@1.59.3+terser@5.16.6 + vite: 4.2.1_sass@1.60.0+terser@5.16.8 vue: 3.2.47 transitivePeerDependencies: - supports-color @@ -1341,7 +1341,7 @@ packages: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.2.1_sass@1.59.3+terser@5.16.6 + vite: 4.2.1_sass@1.60.0+terser@5.16.8 vue: 3.2.47 dev: true @@ -2712,6 +2712,10 @@ packages: path-type: 4.0.0 dev: true + /dlv/1.1.3: + resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} + dev: true + /doctrine/2.1.0: resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} engines: {node: '>=0.10.0'} @@ -5605,6 +5609,13 @@ packages: brace-expansion: 2.0.1 dev: true + /minimatch/7.4.3: + resolution: {integrity: sha512-5UB4yYusDtkRPbRiy1cqZ1IpGNcJCGlEMG17RKzPddpyiPKoCdwohbED8g4QXT0ewCt8LTkQXuljsUfQ3FKM4A==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist-options/4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} engines: {node: '>= 6'} @@ -6845,8 +6856,8 @@ packages: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true - /sass/1.59.3: - resolution: {integrity: sha512-QCq98N3hX1jfTCoUAsF3eyGuXLsY7BCnCEg9qAact94Yc21npG2/mVOqoDvE0fCbWDqiM4WlcJQla0gWG2YlxQ==} + /sass/1.60.0: + resolution: {integrity: sha512-updbwW6fNb5gGm8qMXzVO7V4sWf7LMXnMly/JEyfbfERbVH46Fn6q02BX7/eHTdKpE7d+oTkMMQpFWNUMfFbgQ==} engines: {node: '>=12.0.0'} hasBin: true dependencies: @@ -7349,7 +7360,7 @@ packages: postcss-scss: 4.0.6 stylelint: 15.3.0 stylelint-config-recommended: 10.0.1_stylelint@15.3.0 - stylelint-scss: 4.5.0_stylelint@15.3.0 + stylelint-scss: 4.6.0_stylelint@15.3.0 dev: true /stylelint-config-recommended-vue/1.4.0_o7z2z2yv565o3a3uaodintvte4: @@ -7428,12 +7439,12 @@ packages: stylelint-config-recommended: 11.0.0_stylelint@15.3.0 dev: true - /stylelint-scss/4.5.0_stylelint@15.3.0: - resolution: {integrity: sha512-/+rQ8FePOiwT5xblOHkujYzRYfSjmE6HYhLpqJShL+9wH6/HaAVj4mWpXlpEsM3ZgIpOblG9Y+/BycSJzWgjNw==} + /stylelint-scss/4.6.0_stylelint@15.3.0: + resolution: {integrity: sha512-M+E0BQim6G4XEkaceEhfVjP/41C9Klg5/tTPTCQVlgw/jm2tvB+OXJGaU0TDP5rnTCB62aX6w+rT+gqJW/uwjA==} peerDependencies: stylelint: ^14.5.1 || ^15.0.0 dependencies: - lodash: 4.17.21 + dlv: 1.1.3 postcss-media-query-parser: 0.2.3 postcss-resolve-nested-selector: 0.1.1 postcss-selector-parser: 6.0.11 @@ -7593,8 +7604,8 @@ packages: strip-ansi: 6.0.1 dev: true - /terser/5.16.6: - resolution: {integrity: sha512-IBZ+ZQIA9sMaXmRZCUMDjNH0D5AQQfdn4WUjHL0+1lF4TP1IHRJbrhb6fNaXWikrYQTSkb7SLxkeXAiy1p7mbg==} + /terser/5.16.8: + resolution: {integrity: sha512-QI5g1E/ef7d+PsDifb+a6nnVgC4F22Bg6T0xrBrz6iloVB4PUkkunp6V8nzoOOZJIzjWVdAGqCdlKlhLq/TbIA==} engines: {node: '>=10'} hasBin: true dependencies: @@ -7828,8 +7839,8 @@ packages: resolution: {integrity: sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==} dev: true - /unimport/3.0.2: - resolution: {integrity: sha512-OQ0hShpcerS1PSsISsyn/NV2dGe5xfdUn4p5nwOodq0iqq5xxYQrTidHqlFGjxIliPDtDJp80OeySzyPTjYHmA==} + /unimport/3.0.4: + resolution: {integrity: sha512-eoof/HLiNJcIkVpnqc7sJbzKSLx39J6xTaP7E4ElgVQKeq2t9fPTkvJKcA55IJTaRPkEkDq8kcc/IZPmrypnFg==} dependencies: '@rollup/pluginutils': 5.0.2 escape-string-regexp: 5.0.0 @@ -7841,7 +7852,7 @@ packages: pkg-types: 1.0.2 scule: 1.0.0 strip-literal: 1.0.1 - unplugin: 1.2.0 + unplugin: 1.3.1 transitivePeerDependencies: - rollup dev: true @@ -7883,8 +7894,8 @@ packages: engines: {node: '>= 0.8'} dev: true - /unplugin-auto-import/0.15.1_@vueuse+core@9.13.0: - resolution: {integrity: sha512-xLS+BfVNy00Y3IkqBmEd0IThvjx8kSGIgSuf/1kETttiENK8sHrDA+poKkQxRCPTKYH4yWM6txGQANPTzwpUWQ==} + /unplugin-auto-import/0.15.2_@vueuse+core@9.13.0: + resolution: {integrity: sha512-Wivfu+xccgvEZG8QtZcIvt6napfX9wyOFqM//7FHOtev8+k+dp3ykiqsEl6TODgHmqTTBeQX4Ah1JvRgUNjlkg==} engines: {node: '>=14'} peerDependencies: '@nuxt/kit': ^3.2.2 @@ -7900,9 +7911,9 @@ packages: '@vueuse/core': 9.13.0_vue@3.2.47 local-pkg: 0.4.3 magic-string: 0.30.0 - minimatch: 7.4.2 - unimport: 3.0.2 - unplugin: 1.2.0 + minimatch: 7.4.3 + unimport: 3.0.4 + unplugin: 1.3.1 transitivePeerDependencies: - rollup dev: true @@ -7945,6 +7956,15 @@ packages: webpack-virtual-modules: 0.5.0 dev: true + /unplugin/1.3.1: + resolution: {integrity: sha512-h4uUTIvFBQRxUKS2Wjys6ivoeofGhxzTe2sRWlooyjHXVttcVfV/JiavNd3d4+jty0SVV0dxGw9AkY9MwiaCEw==} + dependencies: + acorn: 8.8.2 + chokidar: 3.5.3 + webpack-sources: 3.2.3 + webpack-virtual-modules: 0.5.0 + dev: true + /unset-value/1.0.0: resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==} engines: {node: '>=0.10.0'} @@ -8081,7 +8101,7 @@ packages: chalk: 4.1.2 debug: 4.3.4 fs-extra: 10.1.0 - vite: 4.2.1_sass@1.59.3+terser@5.16.6 + vite: 4.2.1_sass@1.60.0+terser@5.16.8 transitivePeerDependencies: - supports-color dev: true @@ -8103,7 +8123,7 @@ packages: fast-glob: 3.2.12 mockjs: 1.1.0 path-to-regexp: 6.2.1 - vite: 4.2.1_sass@1.59.3+terser@5.16.6 + vite: 4.2.1_sass@1.60.0+terser@5.16.8 transitivePeerDependencies: - rollup - supports-color @@ -8126,7 +8146,7 @@ packages: json5: 2.2.3 local-pkg: 0.4.3 picocolors: 1.0.0 - vite: 4.2.1_sass@1.59.3+terser@5.16.6 + vite: 4.2.1_sass@1.60.0+terser@5.16.8 yaml: 2.2.1 transitivePeerDependencies: - supports-color @@ -8156,7 +8176,7 @@ packages: pathe: 0.2.0 svg-baker: 1.7.0 svgo: 2.8.0 - vite: 4.2.1_sass@1.59.3+terser@5.16.6 + vite: 4.2.1_sass@1.60.0+terser@5.16.8 transitivePeerDependencies: - supports-color dev: true @@ -8175,7 +8195,7 @@ packages: kolorist: 1.7.0 magic-string: 0.30.0 shell-quote: 1.8.0 - vite: 4.2.1_sass@1.59.3+terser@5.16.6 + vite: 4.2.1_sass@1.60.0+terser@5.16.8 transitivePeerDependencies: - supports-color dev: true @@ -8190,7 +8210,7 @@ packages: '@vue/compiler-sfc': 3.2.47 debug: 4.3.4 fast-glob: 3.2.12 - vite: 4.2.1_sass@1.59.3+terser@5.16.6 + vite: 4.2.1_sass@1.60.0+terser@5.16.8 vue: 3.2.47 vue-router: 4.1.6_vue@3.2.47 transitivePeerDependencies: @@ -8204,10 +8224,10 @@ packages: dependencies: '@vue/compiler-sfc': 3.2.41 magic-string: 0.25.9 - vite: 4.2.1_sass@1.59.3+terser@5.16.6 + vite: 4.2.1_sass@1.60.0+terser@5.16.8 dev: true - /vite/4.2.1_sass@1.59.3+terser@5.16.6: + /vite/4.2.1_sass@1.60.0+terser@5.16.8: resolution: {integrity: sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -8236,8 +8256,8 @@ packages: postcss: 8.4.21 resolve: 1.22.1 rollup: 3.20.0 - sass: 1.59.3 - terser: 5.16.6 + sass: 1.60.0 + terser: 5.16.8 optionalDependencies: fsevents: 2.3.2 dev: true diff --git a/src/types/global.d.ts b/src/types/global.d.ts index bb0b5059..b702ccf8 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -1,5 +1,4 @@ -import type { StyleValue } from "vue" -import type { RouteRecordRaw, RouteMeta, NavigationGuard } from 'vue-router' +import type { RouteRecordRaw } from 'vue-router' type RecursiveRequired = { [P in keyof T]-?: RecursiveRequired @@ -234,7 +233,7 @@ declare namespace Route { icon?: string auth?: string | string[] } - children: recordRaw[] + children: RouteRecordRaw[] } interface breadcrumb { path: string diff --git a/src/views/login.vue b/src/views/login.vue index e308f679..375969cb 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -220,7 +220,7 @@ function testAccount(account: string) { - +