chore: 优化 eslint 与 prettier 配合使用
This commit is contained in:
parent
8084bf05ac
commit
1da0c6ca6b
@ -15,12 +15,12 @@ module.exports = {
|
|||||||
ecmaVersion: 2020
|
ecmaVersion: 2020
|
||||||
},
|
},
|
||||||
extends: [
|
extends: [
|
||||||
'plugin:prettier/recommended', // 添加 prettier 插件
|
|
||||||
'plugin:vue/vue3-recommended',
|
'plugin:vue/vue3-recommended',
|
||||||
'plugin:vue/vue3-strongly-recommended',
|
'plugin:vue/vue3-strongly-recommended',
|
||||||
'plugin:@typescript-eslint/recommended',
|
'plugin:@typescript-eslint/recommended',
|
||||||
'@vue/standard',
|
'@vue/standard',
|
||||||
'@vue/typescript/recommended'
|
'@vue/typescript/recommended',
|
||||||
|
'plugin:prettier/recommended' // 添加 prettier 插件,必须放在数组最后
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
'vue/multi-word-component-names': 'off',
|
'vue/multi-word-component-names': 'off',
|
||||||
|
@ -8,7 +8,9 @@
|
|||||||
"build:prod": "vue-tsc --noEmit && vite build",
|
"build:prod": "vue-tsc --noEmit && vite build",
|
||||||
"preview:stage": "pnpm build:stage && vite preview",
|
"preview:stage": "pnpm build:stage && vite preview",
|
||||||
"preview:prod": "pnpm build:prod && vite preview",
|
"preview:prod": "pnpm build:prod && vite preview",
|
||||||
"lint": "eslint \"{src,mock}/**/*.{vue,ts,tsx}\" --fix"
|
"lint:eslint": "eslint \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
|
||||||
|
"lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
|
||||||
|
"lint": "pnpm lint:eslint && pnpm lint:prettier"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "^1.1.4",
|
"@element-plus/icons-vue": "^1.1.4",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user