From 5d6fb89c92f19c1a44be7f0da809e0d06d0e0e83 Mon Sep 17 00:00:00 2001 From: Huang <596417202@qq.com> Date: Sun, 9 Oct 2022 17:32:23 +0800 Subject: [PATCH] =?UTF-8?q?perf-eslint=E9=85=8D=E7=BD=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 18 ++---------------- .prettierrc.js | 4 +++- pnpm-lock.yaml | 24 +++++++++++++++--------- 3 files changed, 20 insertions(+), 26 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 9856735..2634cb1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,10 +5,8 @@ module.exports = { }, parser: 'vue-eslint-parser', extends: [ - 'eslint:recommended', - 'plugin:vue/essential', - 'plugin:vue/vue3-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:vue/vue3-essential', 'prettier', ], parserOptions: { @@ -78,7 +76,6 @@ module.exports = { }, ], 'space-before-function-paren': 'off', - 'vue/attributes-order': 'off', 'vue/v-on-event-hyphenation': 'off', 'vue/multi-word-component-names': 'off', @@ -89,23 +86,12 @@ module.exports = { 'vue/singleline-html-element-content-newline': 'off', 'vue/attribute-hyphenation': 'off', 'vue/require-default-prop': 'off', - 'vue/html-self-closing': [ - 'error', - { - html: { - void: 'always', - normal: 'never', - component: 'always', - }, - svg: 'always', - math: 'always', - }, - ], }, globals: { defineProps: 'readonly', defineEmits: 'readonly', defineExpose: 'readonly', withDefaults: 'readonly', + uni: 'readonly', }, }; diff --git a/.prettierrc.js b/.prettierrc.js index 51f8d01..0189abf 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,5 +1,6 @@ module.exports = { - printWidth: 100, + extends: ['plugin:vue/vue3-essential', 'eslint:recommended', '@vue/prettier'], + printWidth: 80, semi: true, vueIndentScriptAndStyle: true, singleQuote: true, @@ -7,4 +8,5 @@ module.exports = { proseWrap: 'never', htmlWhitespaceSensitivity: 'strict', endOfLine: 'auto', + arrowParens: 'avoid', }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 76dede5..bc2167d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,6 +25,7 @@ specifiers: '@types/qs': ^6.9.7 '@typescript-eslint/eslint-plugin': ^5.39.0 '@typescript-eslint/parser': ^5.39.0 + '@vue/eslint-config-prettier': ^7.0.0 autoprefixer: ^10.4.12 crypto-js: ^4.1.1 echarts: ^5.4.0 @@ -85,6 +86,7 @@ devDependencies: '@types/qs': 6.9.7 '@typescript-eslint/eslint-plugin': 5.39.0_cfd7h3iktziq6hcwahu2qxhjhy '@typescript-eslint/parser': 5.39.0_z4bbprzjrhnsfa24uvmcbu7f5q + '@vue/eslint-config-prettier': 7.0.0_znq2sm4m5bonjw4qqm6mwhbe2q autoprefixer: 10.4.12_postcss@8.4.17 eslint: 8.25.0 eslint-config-prettier: 8.5.0_eslint@8.25.0 @@ -1416,6 +1418,18 @@ packages: resolution: {integrity: sha512-Ku31WzpOV/8cruFaXaEZKF81WkNnvCSlBY4eOGtz5WMSdJvX1v1WWlSMGZeqUwPtQ27ZZz7B62erEMq8JDjcXw==} dev: false + /@vue/eslint-config-prettier/7.0.0_znq2sm4m5bonjw4qqm6mwhbe2q: + resolution: {integrity: sha512-/CTc6ML3Wta1tCe1gUeO0EYnVXfo3nJXsIhZ8WJr3sov+cGASr6yuiibJTL6lmIBm7GobopToOuB3B6AWyV0Iw==} + peerDependencies: + eslint: '>= 7.28.0' + prettier: '>= 2.0.0' + dependencies: + eslint: 8.25.0 + eslint-config-prettier: 8.5.0_eslint@8.25.0 + eslint-plugin-prettier: 4.2.1_hvbqyfstm4urdpm6ffpwfka4e4 + prettier: 2.7.1 + dev: true + /@vue/reactivity-transform/3.2.40: resolution: {integrity: sha512-HQUCVwEaacq6fGEsg2NUuGKIhUveMCjOk8jGHqLXPI2w6zFoPrlQhwWEaINTv5kkZDXKEnCijAp+4gNEHG03yw==} dependencies: @@ -4492,14 +4506,6 @@ packages: optionalDependencies: fsevents: 2.3.2 - /rollup/2.79.1: - resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} - engines: {node: '>=10.0.0'} - hasBin: true - optionalDependencies: - fsevents: 2.3.2 - dev: true - /run-async/2.4.1: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} engines: {node: '>=0.12.0'} @@ -5180,7 +5186,7 @@ packages: '@rollup/pluginutils': 4.2.1 '@types/eslint': 8.4.6 eslint: 8.25.0 - rollup: 2.79.1 + rollup: 2.78.1 vite: 3.1.6_sass@1.55.0+terser@5.15.1 dev: true