check eslint plugin

This commit is contained in:
XiaoDaiGua-Ray 2023-08-04 09:51:44 +08:00
parent 3e6109695e
commit d203ff9d95

View File

@ -16,6 +16,7 @@ import { visualizer } from 'rollup-plugin-visualizer' // 打包体积分析工
import viteCompression from 'vite-plugin-compression' // 压缩打包 import viteCompression from 'vite-plugin-compression' // 压缩打包
import { ViteEjsPlugin as viteEjsPlugin } from 'vite-plugin-ejs' import { ViteEjsPlugin as viteEjsPlugin } from 'vite-plugin-ejs'
import viteAutoImport from 'unplugin-auto-import/vite' import viteAutoImport from 'unplugin-auto-import/vite'
import viteEslint from 'vite-plugin-eslint'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers' // 模板自动导入组件并且按需打包 import { NaiveUiResolver } from 'unplugin-vue-components/resolvers' // 模板自动导入组件并且按需打包
import { VueHooksPlusResolver } from '@vue-hooks-plus/resolvers' import { VueHooksPlusResolver } from '@vue-hooks-plus/resolvers'
@ -107,13 +108,22 @@ export default defineConfig(async ({ mode }) => {
defaultImport: 'component', // 默认以 `componetn` 形式导入 `svg` defaultImport: 'component', // 默认以 `componetn` 形式导入 `svg`
}), }),
viteSVGIcon(), viteSVGIcon(),
viteEslintPlugin({ // viteEslintPlugin({
formatter: 'stylish', // formatter: 'stylish',
eslintOptions: { // eslintOptions: {
cache: true, // cache: true,
fix: true, // fix: true,
extensions: ['.vue', '.tsx', '.ts', '.js', '.jsx'], // extensions: ['.vue', '.tsx', '.ts', '.js', '.jsx'],
}, // },
// }),
viteEslint({
lintOnStart: true,
failOnError: true,
failOnWarning: true,
cache: true,
fix: true,
exclude: ['dist/**', '**/node_modules/**'],
include: ['src/**/*.{vue,js,jsx,ts,tsx}'],
}), }),
vitePluginImp({ vitePluginImp({
libList: [ libList: [