From f1887a28907af09a1751561bfda731471385510e Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Thu, 2 Apr 2020 16:00:35 +0800 Subject: [PATCH] chore(stylelint-config): add stylelint-config-prettier --- packages/vant-stylelint-config/index.js | 11 +++++------ packages/vant-stylelint-config/package.json | 3 ++- packages/vant-stylelint-config/yarn.lock | 5 +++++ src/dropdown-item/index.less | 10 +++++----- src/picker/index.less | 8 ++++++-- src/steps/demo/index.vue | 8 ++++---- src/style/normalize.less | 14 +++++++------- src/tag/demo/index.vue | 8 ++++---- yarn.lock | 12 +++++++++--- 9 files changed, 47 insertions(+), 32 deletions(-) diff --git a/packages/vant-stylelint-config/index.js b/packages/vant-stylelint-config/index.js index 16b0a1a46..d7d458884 100644 --- a/packages/vant-stylelint-config/index.js +++ b/packages/vant-stylelint-config/index.js @@ -1,12 +1,11 @@ module.exports = { - extends: ['stylelint-config-standard', 'stylelint-config-rational-order'], + extends: [ + 'stylelint-config-standard', + 'stylelint-config-rational-order', + 'stylelint-config-prettier', + ], rules: { - 'order/properties-order': [], - 'at-rule-no-unknown': null, - 'number-leading-zero': null, 'no-descending-specificity': null, - 'declaration-colon-newline-after': null, - 'font-family-no-missing-generic-family-keyword': null, 'selector-pseudo-element-no-unknown': [ true, { diff --git a/packages/vant-stylelint-config/package.json b/packages/vant-stylelint-config/package.json index 87ca9c0b3..cc6a19015 100644 --- a/packages/vant-stylelint-config/package.json +++ b/packages/vant-stylelint-config/package.json @@ -1,6 +1,6 @@ { "name": "@vant/stylelint-config", - "version": "1.2.1", + "version": "1.3.0", "description": "stylelint config of vant.", "main": "index.js", "publishConfig": { @@ -12,6 +12,7 @@ "stylelint": "^13.0.0" }, "dependencies": { + "stylelint-config-prettier": "^8.0.1", "stylelint-config-rational-order": "^0.1.2", "stylelint-config-standard": "^20.0.0", "stylelint-order": "^4.0.0" diff --git a/packages/vant-stylelint-config/yarn.lock b/packages/vant-stylelint-config/yarn.lock index ba8740d45..037f17894 100644 --- a/packages/vant-stylelint-config/yarn.lock +++ b/packages/vant-stylelint-config/yarn.lock @@ -2093,6 +2093,11 @@ style-search@^0.1.0: resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902" integrity sha1-eVjHk+R+MuB9K1yv5cC/jhLneQI= +stylelint-config-prettier@^8.0.1: + version "8.0.1" + resolved "https://registry.npm.taobao.org/stylelint-config-prettier/download/stylelint-config-prettier-8.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstylelint-config-prettier%2Fdownload%2Fstylelint-config-prettier-8.0.1.tgz#ec7cdd7faabaff52ebfa56c28fed3d995ebb8cab" + integrity sha1-7Hzdf6q6/1Lr+lbCj+09mV67jKs= + stylelint-config-rational-order@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/stylelint-config-rational-order/-/stylelint-config-rational-order-0.1.2.tgz#4e98e390783d437f0ec41fb73bc41992e78d02a0" diff --git a/src/dropdown-item/index.less b/src/dropdown-item/index.less index 71653d91e..893fc66d5 100644 --- a/src/dropdown-item/index.less +++ b/src/dropdown-item/index.less @@ -7,6 +7,11 @@ z-index: @dropdown-item-z-index; overflow: hidden; + &__icon { + display: block; + line-height: inherit; + } + &__option { text-align: left; @@ -31,9 +36,4 @@ position: absolute; max-height: @dropdown-menu-content-max-height; } - - &__icon { - display: block; - line-height: inherit; - } } diff --git a/src/picker/index.less b/src/picker/index.less index b5d115438..b455640a4 100644 --- a/src/picker/index.less +++ b/src/picker/index.less @@ -71,8 +71,12 @@ z-index: 2; width: 100%; height: 100%; - background-image: linear-gradient(180deg, hsla(0, 0%, 100%, .9), hsla(0, 0%, 100%, .4)), - linear-gradient(0deg, hsla(0, 0%, 100%, .9), hsla(0, 0%, 100%, .4)); + background-image: linear-gradient( + 180deg, + hsla(0, 0%, 100%, 0.9), + hsla(0, 0%, 100%, 0.4) + ), + linear-gradient(0deg, hsla(0, 0%, 100%, 0.9), hsla(0, 0%, 100%, 0.4)); background-repeat: no-repeat; background-position: top, bottom; backface-visibility: hidden; diff --git a/src/steps/demo/index.vue b/src/steps/demo/index.vue index 29ad78eac..1d0a6236b 100644 --- a/src/steps/demo/index.vue +++ b/src/steps/demo/index.vue @@ -102,15 +102,15 @@ export default { margin: @padding-md 0 0 @padding-md; } - .van-steps__message + p { - margin-bottom: 10px; - } - p, h3 { margin: 0; font-weight: normal; font-size: inherit; } + + .van-steps__message + p { + margin-bottom: 10px; + } } diff --git a/src/style/normalize.less b/src/style/normalize.less index 15758cc06..4c6254902 100644 --- a/src/style/normalize.less +++ b/src/style/normalize.less @@ -14,6 +14,13 @@ a { text-decoration: none; } +input, +button, +textarea { + color: inherit; + font: inherit; +} + a, input, button, @@ -30,10 +37,3 @@ ul { padding: 0; list-style: none; } - -input, -button, -textarea { - color: inherit; - font: inherit; -} diff --git a/src/tag/demo/index.vue b/src/tag/demo/index.vue index 6669b2ad7..0ea06aeba 100644 --- a/src/tag/demo/index.vue +++ b/src/tag/demo/index.vue @@ -113,14 +113,14 @@ export default { .demo-tag { background-color: @white; - .van-tag + .van-tag { - margin-left: @padding-xs; - } - .van-tag { &:first-of-type { margin-left: @padding-md; } } + + .van-tag + .van-tag { + margin-left: @padding-xs; + } } diff --git a/yarn.lock b/yarn.lock index 5284d53b9..d80a126dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1708,10 +1708,11 @@ fs-extra "^9.0.0" "@vant/stylelint-config@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@vant/stylelint-config/-/stylelint-config-1.2.1.tgz#3ed9584053f70b1d8461d91dc614d7ec2c9950c1" - integrity sha512-N0M5LJNU3XzjFWA6PhsseQnkLYobzKBEBbYG9+9OnrFdRqweN+jYdDIdDLu5GD5clEEAyFsCabLMPdfBbISPcw== + version "1.3.0" + resolved "https://registry.yarnpkg.com/@vant/stylelint-config/-/stylelint-config-1.3.0.tgz#702cb87a8698185904aea56ada967064e6821aa4" + integrity sha512-XxU8lDPjKnmVkvYPfygH9SyB0nJdpuUgISSkWO6CrlaDdDekYQPSGpBJu+9SWGCxsa7F0sjAYVkyDmij9c53kg== dependencies: + stylelint-config-prettier "^8.0.1" stylelint-config-rational-order "^0.1.2" stylelint-config-standard "^20.0.0" stylelint-order "^4.0.0" @@ -10705,6 +10706,11 @@ style-search@^0.1.0: resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902" integrity sha1-eVjHk+R+MuB9K1yv5cC/jhLneQI= +stylelint-config-prettier@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/stylelint-config-prettier/-/stylelint-config-prettier-8.0.1.tgz#ec7cdd7faabaff52ebfa56c28fed3d995ebb8cab" + integrity sha512-RcjNW7MUaNVqONhJH4+rtlAE3ow/9SsAM0YWV0Lgu3dbTKdWTa/pQXRdFWgoHWpzUKn+9oBKR5x8JdH+20wmgw== + stylelint-config-rational-order@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/stylelint-config-rational-order/-/stylelint-config-rational-order-0.1.2.tgz#4e98e390783d437f0ec41fb73bc41992e78d02a0"