Skip to content

Commit

Permalink
🐛 Fixes bugs detected by eslint lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ileostar committed Oct 5, 2023
1 parent 6f10932 commit eb335e5
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"plugins": [
"@unocss"
]
}
}
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx eslint --ext .js,.vue,.ts src
npx eslint --fix .
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue3-vite-alova-ts-vitest",
"version": "0.0.1",
"type": "module",
"version": "0.0.1",
"packageManager": "[email protected]",
"scripts": {
"dev": "vite --mode dev",
Expand All @@ -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",
Expand Down Expand Up @@ -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 ."
]
}
}
9 changes: 5 additions & 4 deletions shims.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const vueComponent: DefineComponent<object, object, unknown>
export default vueComponent
}
import type { DefineComponent } from 'vue'

const vueComponent: DefineComponent<object, object, unknown>
export default vueComponent
}
27 changes: 14 additions & 13 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
/// <reference types="vitest" />

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)=>{
Expand Down Expand Up @@ -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(),
Expand All @@ -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')
}
},

}),

Expand All @@ -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$/],
Expand All @@ -108,8 +109,8 @@ export default defineConfig((_mode: ConfigEnv)=>{
UnoCSS(),

Icons({
autoInstall: true
})
autoInstall: true,
}),
],

// https://github.com/vitest-dev/vitest
Expand Down

0 comments on commit eb335e5

Please sign in to comment.