From 544c790431848e80726e8baa15e018d1a22b98ee Mon Sep 17 00:00:00 2001 From: xuan Date: Mon, 5 Dec 2022 17:22:54 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20chore(prettier):=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8prettier=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierrc | 10 +++ .vscode/settings.json | 10 +++ package.json | 1 + src/app.scss | 7 +- src/components/address/index.module.scss | 105 +++++++++++------------ yarn.lock | 5 ++ 6 files changed, 81 insertions(+), 57 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..1a3ecc7 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,10 @@ +{ + "printWidth": 160, + "tabWidth": 2, + "useTabs": false, + "semi": false, + "singleQuote": true, + "jsxSingleQuote": true, + "jsxBracketSameLine": true, + "trailingComma": "all" +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 6878a8c..2e4517d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,7 @@ { "editor.defaultFormatter": "dbaeumer.vscode-eslint", + // Set the default + "editor.formatOnSave": true, // Enable per-language "[javascript]": { "editor.formatOnSave": true, @@ -17,4 +19,12 @@ "editor.formatOnSave": true, "editor.defaultFormatter": "dbaeumer.vscode-eslint" }, + "[css]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[scss]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, } diff --git a/package.json b/package.json index bd82bf6..3af78c0 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,7 @@ "cross-env": "^7.0.3", "eslint": "^8.29.0", "eslint-config-taro": "3.5.8", + "prettier": "^2.8.0", "react-refresh": "0.14.0", "stylelint": "14.16.0", "typescript": "^4.9.3", diff --git a/src/app.scss b/src/app.scss index c393d5e..97a024e 100644 --- a/src/app.scss +++ b/src/app.scss @@ -1,6 +1,5 @@ @import './styles/common.scss'; @import './styles/iconfont.scss'; -page{ - height: 100%; - -} \ No newline at end of file +page { + height: 100%; +} diff --git a/src/components/address/index.module.scss b/src/components/address/index.module.scss index 854206d..e1a118f 100644 --- a/src/components/address/index.module.scss +++ b/src/components/address/index.module.scss @@ -1,59 +1,58 @@ -.address_main{ - width: 100%; - box-sizing: border-box; - .address_title{ +.address_main { + width: 100%; + box-sizing: border-box; + .address_title { + display: flex; + justify-content: space-between; + font-size: $font_size; + padding: 20px; + padding-bottom: 0; + } + .address_select { + display: flex; + padding: 30px 0; + margin-top: 10px; + font-size: $font_size_medium; + border-bottom: 1px solid #eaeaea; + color: $color_font_two; + position: relative; + .address_item { + padding: 0 20px; + max-width: 200px; + @include common_ellipsis(); + } + .bottom_index { + width: 100px; + height: 2px; + border-radius: 50px; + background-color: $color_main; + position: absolute; + bottom: 0; + left: 0; + transition: left 0.1s; + } + } + .address_scroll { + height: 600px; + .address_scroll_list { + padding: 0 20px; + font-size: $font_size; + .address_list_item { + padding: 20px 0; display: flex; justify-content: space-between; - font-size: $font_size; - padding: 20px; - padding-bottom: 0; - } - .address_select{ - display: flex; - padding: 30px 0; - margin-top: 10px; - font-size: $font_size_medium; - border-bottom: 1px solid #eaeaea; - color: $color_font_two; - position: relative; - .address_item{ - padding: 0 20px; - max-width: 200px; - @include common_ellipsis() + align-items: center; + .address_list_item_name { + @include common_ellipsis(); } - .bottom_index{ - width: 100px; - height: 2px; - border-radius: 50px; - background-color:$color_main; - position: absolute; - bottom: 0; - left: 0; - transition: left 0.1s; + .address_iconfont { + font-size: 30px !important; + color: $color_main; } + } } - .address_scroll{ - height: 600px; - .address_scroll_list{ - padding: 0 20px; - font-size: $font_size; - .address_list_item{ - padding: 20px 0; - display: flex; - justify-content: space-between; - align-items: center; - .address_list_item_name{ - @include common_ellipsis() - } - .address_iconfont{ - font-size: 30px !important; - color: $color_main; - } - } - } - - } - .addresst_select{ - color:$color_font_one; - } + } + .addresst_select { + color: $color_font_one; + } } diff --git a/yarn.lock b/yarn.lock index 557a9f6..244f206 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10977,6 +10977,11 @@ prepend-http@^2.0.0: resolved "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA== +prettier@^2.8.0: + version "2.8.0" + resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz#c7df58393c9ba77d6fba3921ae01faf994fb9dc9" + integrity sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA== + pretty-bytes@^5.3.0: version "5.6.0" resolved "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb"