Skip to content

Commit

Permalink
feat: 添加vite-plugin-checker插件,更严格的类型和eslint校验
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxian521 committed Jul 3, 2024
1 parent 37e9d8a commit bae1122
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { pathResolve } from "./utils";
import { viteBuildInfo } from "./info";
import svgLoader from "vite-svg-loader";
import type { PluginOption } from "vite";
import checker from "vite-plugin-checker";
import vueJsx from "@vitejs/plugin-vue-jsx";
import Inspector from "vite-plugin-vue-inspector";
import { configCompressPlugin } from "./compress";
Expand All @@ -28,6 +29,16 @@ export function getPluginsList(
jitCompilation: false,
include: [pathResolve("../locales/**")]
}),
checker({
typescript: true,
vueTsc: true,
eslint: {
lintCommand: `eslint ${pathResolve("../{src,mock,build}/**/*.{vue,js,ts,tsx}")}`,
useFlatConfig: true
},
terminal: false,
enableBuild: false
}),
// 按下Command(⌘)+Shift(⇧),然后点击页面元素会自动打开本地IDE并跳转到对应的代码位置
Inspector(),
viteBuildInfo(),
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
"typescript": "^5.5.3",
"vite": "^5.3.2",
"vite-plugin-cdn-import": "^1.0.1",
"vite-plugin-checker": "^0.7.0",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-fake-server": "^2.1.1",
"vite-plugin-remove-console": "^2.2.0",
Expand Down
133 changes: 133 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bae1122

Please sign in to comment.