diff --git a/.eslintrc.json b/.eslintrc.json index 81d8125..abfb881 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,4 +6,4 @@ "plugins": [ "@unocss" ] -} \ No newline at end of file +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0fdbe7d..dc4448d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,9 +1,9 @@ version: 2 updates: - - package-ecosystem: "npm" - directory: "/" + - package-ecosystem: npm + directory: / schedule: - interval: "weekly" + interval: weekly commit-message: - prefix: 'build' + prefix: build include: scope diff --git a/.husky/pre-commit b/.husky/pre-commit index 5d1d974..2c86cc6 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -npx eslint --ext .js,.vue,.ts src +npx eslint --fix . diff --git a/package.json b/package.json index 927f879..8479463 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vue3-vite-alova-ts-vitest", - "version": "0.0.1", "type": "module", + "version": "0.0.1", "packageManager": "pnpm@8.7.6", "scripts": { "dev": "vite --mode dev", @@ -23,12 +23,6 @@ "path": "./node_modules/cz-emoji" } }, - "lint-staged": { - "src/**/*.{js,vue,ts}": [ - "eslint --fix", - "git add ." - ] - }, "dependencies": { "@vueuse/core": "^10.4.1", "alova": "^2.13.1", @@ -71,5 +65,11 @@ "vite": "^4.4.5", "vitest": "^0.34.6", "vue-tsc": "^1.8.5" + }, + "lint-staged": { + "src/**/*.{js,vue,ts}": [ + "eslint --fix", + "git add ." + ] } } diff --git a/shims.d.ts b/shims.d.ts index 1fd9b73..8e7d121 100644 --- a/shims.d.ts +++ b/shims.d.ts @@ -1,5 +1,6 @@ declare module '*.vue' { - import type { DefineComponent } from 'vue' - const vueComponent: DefineComponent - export default vueComponent -} \ No newline at end of file + import type { DefineComponent } from 'vue' + + const vueComponent: DefineComponent + export default vueComponent +} diff --git a/vite.config.ts b/vite.config.ts index 1afb663..a3b8d1b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,17 +1,18 @@ /// import path from 'node:path' -import { ConfigEnv, defineConfig } from 'vite' +import { defineConfig } from 'vite' +import type { ConfigEnv } from 'vite' import Vue from '@vitejs/plugin-vue' import UnoCSS from 'unocss/vite' import AutoImport from 'unplugin-auto-import/vite' import Components from 'unplugin-vue-components/vite' -import { ElementPlusResolver } from "unplugin-vue-components/resolvers"; +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' import VueRouter from 'unplugin-vue-router/vite' import { VueRouterAutoImports } from 'unplugin-vue-router' import VueMacros from 'unplugin-vue-macros/vite' -import IconsResolver from "unplugin-icons/resolver"; -import Icons from "unplugin-icons/vite"; +import IconsResolver from 'unplugin-icons/resolver' +import Icons from 'unplugin-icons/vite' // https://vitejs.dev/config/ export default defineConfig((_mode: ConfigEnv)=>{ @@ -56,15 +57,15 @@ export default defineConfig((_mode: ConfigEnv)=>{ '@vueuse/core', VueRouterAutoImports, { - 'vue-router/auto': ['useLink'] + 'vue-router/auto': ['useLink'], }, { - 'alova': [ + alova: [ 'useRequest', 'useWatcher', 'useFetcher', - ] - } + ], + }, ], resolvers: [ ElementPlusResolver(), @@ -83,7 +84,7 @@ export default defineConfig((_mode: ConfigEnv)=>{ enabled: false, // Default `false` filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json` globalsPropValue: true, // Default `true`, (true | false | 'readonly' | 'readable' | 'writable' | 'writeable') - } + }, }), @@ -93,11 +94,11 @@ export default defineConfig((_mode: ConfigEnv)=>{ // Auto register icon components // 自动注册图标组件 IconsResolver({ - enabledCollections: ["ep"] + enabledCollections: ['ep'], }), // Auto register Element Plus components // 自动导入 Element Plus 组件 - ElementPlusResolver() + ElementPlusResolver(), ], dts: true, include: [/\.vue$/, /\.vue\?vue/, /\.md$/], @@ -108,8 +109,8 @@ export default defineConfig((_mode: ConfigEnv)=>{ UnoCSS(), Icons({ - autoInstall: true - }) + autoInstall: true, + }), ], // https://github.com/vitest-dev/vitest