From e14b43e66a77a31f65f662ee804bf21ad12a18b0 Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 15 Nov 2018 15:30:17 +0800 Subject: [PATCH] [improvement] update eslint rules (#2089) --- .eslintrc | 16 ++-- package.json | 2 +- packages/actionsheet/demo/index.vue | 11 ++- packages/actionsheet/index.vue | 40 ++++++-- packages/address-edit/Detail.vue | 10 +- packages/address-edit/index.vue | 26 +++++- .../test/__snapshots__/demo.spec.js.snap | 8 +- .../test/__snapshots__/index.spec.js.snap | 16 +++- packages/address-list/index.vue | 12 ++- .../test/__snapshots__/demo.spec.js.snap | 4 +- packages/area/demo/index.vue | 16 +++- .../area/test/__snapshots__/demo.spec.js.snap | 24 +++-- .../test/__snapshots__/index.spec.js.snap | 64 +++++++++---- packages/badge-group/index.vue | 5 +- packages/badge/demo/index.vue | 20 +++- packages/badge/index.vue | 5 +- .../test/__snapshots__/demo.spec.js.snap | 12 ++- packages/button/demo/index.vue | 52 +++++++++-- packages/button/index.vue | 11 ++- .../test/__snapshots__/demo.spec.js.snap | 24 +++-- packages/card/index.vue | 43 +++++++-- .../card/test/__snapshots__/demo.spec.js.snap | 28 ++++-- packages/cell/demo/index.vue | 78 +++++++++++++--- packages/cell/index.vue | 23 ++++- packages/checkbox/demo/index.vue | 29 +++++- packages/checkbox/index.vue | 21 ++++- .../test/__snapshots__/demo.spec.js.snap | 8 +- packages/circle/demo/index.vue | 14 ++- packages/circle/index.vue | 17 +++- packages/col/demo/index.vue | 34 +++++-- .../col/test/__snapshots__/demo.spec.js.snap | 8 +- packages/collapse-item/index.vue | 28 +++++- packages/collapse/demo/index.vue | 18 +++- packages/collapse/index.vue | 5 +- packages/contact-card/demo/index.vue | 20 ++-- .../test/__snapshots__/demo.spec.js.snap | 4 +- packages/contact-edit/index.vue | 18 +++- packages/contact-list/index.vue | 16 +++- packages/coupon-cell/index.vue | 5 +- packages/coupon-list/Item.vue | 13 ++- packages/coupon-list/demo/index.vue | 5 +- packages/coupon-list/index.vue | 26 +++++- .../test/__snapshots__/demo.spec.js.snap | 32 +++++-- packages/dialog/Dialog.vue | 27 +++++- packages/dialog/demo/index.vue | 32 ++++++- .../test/__snapshots__/demo.spec.js.snap | 16 +++- packages/field/demo/index.vue | 13 ++- packages/field/index.vue | 21 ++++- .../test/__snapshots__/demo.spec.js.snap | 4 +- packages/goods-action-mini-btn/index.vue | 12 ++- packages/goods-action/demo/index.vue | 53 +++++++++-- .../test/__snapshots__/demo.spec.js.snap | 4 +- packages/icon/demo/index.vue | 6 +- packages/icon/index.vue | 6 +- packages/image-preview/ImagePreview.vue | 12 ++- .../test/__snapshots__/index.spec.js.snap | 8 +- packages/info/index.vue | 7 +- packages/lazyload/demo/index.vue | 15 ++- packages/list/demo/index.vue | 11 ++- packages/list/index.vue | 5 +- packages/loading/demo/index.vue | 5 +- packages/loading/index.vue | 23 ++++- packages/nav-bar/demo/index.vue | 11 ++- packages/nav-bar/index.vue | 33 +++++-- packages/notice-bar/demo/index.vue | 15 ++- packages/notice-bar/index.vue | 10 +- packages/number-keyboard/index.vue | 23 ++++- packages/pagination/index.vue | 10 +- .../test/__snapshots__/demo.spec.js.snap | 5 - packages/panel/demo/index.vue | 19 +++- packages/panel/index.vue | 6 +- .../test/__snapshots__/demo.spec.js.snap | 4 +- packages/password-input/index.vue | 11 ++- packages/picker/demo/index.vue | 15 ++- packages/picker/index.vue | 44 +++++++-- .../test/__snapshots__/demo.spec.js.snap | 8 +- packages/popup/demo/index.vue | 21 ++++- packages/popup/index.vue | 6 +- packages/progress/demo/index.vue | 17 +++- packages/progress/index.vue | 14 ++- .../test/__snapshots__/demo.spec.js.snap | 20 +++- .../test/__snapshots__/index.spec.js.snap | 4 +- packages/pull-refresh/demo/index.vue | 5 +- packages/pull-refresh/index.vue | 20 +++- packages/radio/demo/index.vue | 23 ++++- packages/radio/index.vue | 11 ++- packages/rate/demo/index.vue | 5 +- packages/rate/index.vue | 5 +- packages/search/demo/index.vue | 7 +- packages/search/index.vue | 15 ++- .../test/__snapshots__/demo.spec.js.snap | 4 +- packages/sku/Sku.vue | 32 +++++-- packages/sku/components/SkuHeader.vue | 16 +++- packages/sku/components/SkuImgUploader.vue | 21 ++++- packages/sku/components/SkuStepper.vue | 14 ++- packages/sku/demo/index.vue | 49 ++++++++-- .../sku/test/__snapshots__/demo.spec.js.snap | 12 ++- packages/slider/demo/index.vue | 10 +- packages/slider/index.vue | 10 +- packages/step/index.vue | 21 ++++- packages/stepper/demo/index.vue | 5 +- packages/steps/demo/index.vue | 6 +- packages/steps/index.vue | 26 +++++- packages/style/demo/index.vue | 20 +++- packages/submit-bar/demo/index.vue | 8 +- packages/submit-bar/index.vue | 5 +- .../test/__snapshots__/demo.spec.js.snap | 5 +- packages/swipe-cell/demo/index.vue | 21 ++++- packages/swipe-cell/index.vue | 12 ++- packages/swipe-item/index.vue | 5 +- packages/swipe/demo/index.vue | 22 ++++- packages/switch-cell/demo/index.vue | 17 +++- packages/switch-cell/index.vue | 12 ++- packages/switch/demo/index.vue | 10 +- packages/switch/index.vue | 5 +- packages/tab/demo/index.vue | 58 ++++++++++-- packages/tab/index.vue | 10 +- .../tab/test/__snapshots__/index.spec.js.snap | 72 ++++++++++---- packages/tabbar-item/index.vue | 15 ++- packages/tabbar/demo/index.vue | 21 ++++- .../test/__snapshots__/demo.spec.js.snap | 24 +++-- packages/tabs/index.vue | 24 ++++- packages/tag/demo/index.vue | 93 ++++++++++++++++--- .../tag/test/__snapshots__/demo.spec.js.snap | 40 ++++++-- packages/toast/Toast.vue | 29 +++++- packages/tree-select/index.vue | 8 +- packages/uploader/demo/index.vue | 13 ++- packages/waterfall/demo/index.vue | 11 ++- yarn.lock | 6 +- 129 files changed, 1874 insertions(+), 456 deletions(-) diff --git a/.eslintrc b/.eslintrc index 64dba327a..c4b23b207 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,21 +3,19 @@ "env": { "jest": true }, - "extends": ["plugin:vue-libs/recommended", "plugin:vue/strongly-recommended"], + "extends": ["plugin:vue-libs/recommended", "plugin:vue/recommended"], "rules": { "semi": ["error", "always"], "space-before-function-paren": ["error", "never"], + "vue/attributes-order": 0, "vue/require-v-for-key": 0, "vue/require-default-prop": 0, - "vue/name-property-casing": 0, - "vue/max-attributes-per-line": [ - 2, + "vue/name-property-casing": ["error", "kebab-case"], + "vue/html-closing-bracket-newline": [ + "error", { - "singleline": 5, - "multiline": { - "max": 5, - "allowFirstLine": false - } + "singleline": "never", + "multiline": "always" } ] } diff --git a/package.json b/package.json index 01291d23b..7734431f2 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "cross-env": "^5.2.0", "css-loader": "^1.0.1", "dependency-tree": "^6.2.1", - "eslint": "^5.8.0", + "eslint": "^5.9.0", "eslint-plugin-vue-libs": "^3.0.0", "fast-glob": "^2.2.3", "fast-vue-md-loader": "^1.0.3", diff --git a/packages/actionsheet/demo/index.vue b/packages/actionsheet/demo/index.vue index 834dc456e..2136a089f 100644 --- a/packages/actionsheet/demo/index.vue +++ b/packages/actionsheet/demo/index.vue @@ -2,7 +2,11 @@ {{ $t('button1') }} - + @@ -18,7 +22,10 @@ {{ $t('button3') }} - +

{{ $t('content') }}

diff --git a/packages/actionsheet/index.vue b/packages/actionsheet/index.vue index 706d37a83..2791fb102 100644 --- a/packages/actionsheet/index.vue +++ b/packages/actionsheet/index.vue @@ -1,11 +1,25 @@