diff --git a/.prettierrc.js b/.prettierrc.js index 944d762..473586a 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,11 +1,11 @@ module.exports = { - "printWidth": 80, // 每行代码长度(默认80) - "tabWidth": 2, // 每个tab相当于多少个空格(默认2) - "useTabs": false, // 是否使用tab进行缩进(默认false) - "singleQuote": true, // 使用单引号(默认false) - "semi": false, // 声明结尾使用分号(默认true) - "trailingComma": "es5", // 多行使用拖尾逗号(默认none) - "bracketSpacing": true, // 对象字面量的大括号间使用空格(默认true) - "jsxBracketSameLine": false, // 多行JSX中的>放置在最后一行的结尾,而不是另起一行(默认false) - "arrowParens": "avoid", // 只有一个参数的箭头函数的参数是否带括号(默认avoid) -} \ No newline at end of file + printWidth: 80, // 每行代码长度(默认80) + tabWidth: 2, // 每个tab相当于多少个空格(默认2) + useTabs: false, // 是否使用tab进行缩进(默认false) + singleQuote: true, // 使用单引号(默认false) + semi: false, // 声明结尾使用分号(默认true) + trailingComma: 'es5', // 多行使用拖尾逗号(默认none) + bracketSpacing: true, // 对象字面量的大括号间使用空格(默认true) + jsxBracketSameLine: false, // 多行JSX中的>放置在最后一行的结尾,而不是另起一行(默认false) + arrowParens: 'avoid', // 只有一个参数的箭头函数的参数是否带括号(默认avoid) +} diff --git a/package.json b/package.json index 85868e1..280b230 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,6 @@ "prettier": "^1.19.1", "sass": "^1.32.8", "vite": "^2.1.0", - "vite-plugin-eslint": "^1.1.0", "vite-plugin-mock": "^2.3.0", "vite-plugin-svg-icons": "^0.4.0" }, @@ -51,6 +50,11 @@ "git add" ] }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, "repository": { "type": "git", "url": "git+https://github.com/huzhushan/vue3-element-admin.git" diff --git a/vite.config.js b/vite.config.js index 2623755..578b113 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,7 +3,6 @@ import vue from '@vitejs/plugin-vue' import path from 'path' import { viteMockServe } from 'vite-plugin-mock' import viteSvgIcons from 'vite-plugin-svg-icons' -import viteEslint from 'vite-plugin-eslint' // https://vitejs.dev/config/ export default env => { @@ -30,7 +29,6 @@ export default env => { // 指定symbolId格式 symbolId: 'icon-[dir]-[name]', }), - viteEslint(), ], css: { preprocessorOptions: {