🐳 chore(prettier): 使用prettier格式化样式文件

This commit is contained in:
xuan 2022-12-05 17:22:54 +08:00
parent 54337b65d6
commit 544c790431
6 changed files with 81 additions and 57 deletions

10
.prettierrc Normal file
View File

@ -0,0 +1,10 @@
{
"printWidth": 160,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"jsxSingleQuote": true,
"jsxBracketSameLine": true,
"trailingComma": "all"
}

10
.vscode/settings.json vendored
View File

@ -1,5 +1,7 @@
{ {
"editor.defaultFormatter": "dbaeumer.vscode-eslint", "editor.defaultFormatter": "dbaeumer.vscode-eslint",
// Set the default
"editor.formatOnSave": true,
// Enable per-language // Enable per-language
"[javascript]": { "[javascript]": {
"editor.formatOnSave": true, "editor.formatOnSave": true,
@ -17,4 +19,12 @@
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint" "editor.defaultFormatter": "dbaeumer.vscode-eslint"
}, },
"[css]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
} }

View File

@ -75,6 +75,7 @@
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"eslint": "^8.29.0", "eslint": "^8.29.0",
"eslint-config-taro": "3.5.8", "eslint-config-taro": "3.5.8",
"prettier": "^2.8.0",
"react-refresh": "0.14.0", "react-refresh": "0.14.0",
"stylelint": "14.16.0", "stylelint": "14.16.0",
"typescript": "^4.9.3", "typescript": "^4.9.3",

View File

@ -1,6 +1,5 @@
@import './styles/common.scss'; @import './styles/common.scss';
@import './styles/iconfont.scss'; @import './styles/iconfont.scss';
page{ page {
height: 100%; height: 100%;
} }

View File

@ -1,14 +1,14 @@
.address_main{ .address_main {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
.address_title{ .address_title {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: $font_size; font-size: $font_size;
padding: 20px; padding: 20px;
padding-bottom: 0; padding-bottom: 0;
} }
.address_select{ .address_select {
display: flex; display: flex;
padding: 30px 0; padding: 30px 0;
margin-top: 10px; margin-top: 10px;
@ -16,44 +16,43 @@
border-bottom: 1px solid #eaeaea; border-bottom: 1px solid #eaeaea;
color: $color_font_two; color: $color_font_two;
position: relative; position: relative;
.address_item{ .address_item {
padding: 0 20px; padding: 0 20px;
max-width: 200px; max-width: 200px;
@include common_ellipsis() @include common_ellipsis();
} }
.bottom_index{ .bottom_index {
width: 100px; width: 100px;
height: 2px; height: 2px;
border-radius: 50px; border-radius: 50px;
background-color:$color_main; background-color: $color_main;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
transition: left 0.1s; transition: left 0.1s;
} }
} }
.address_scroll{ .address_scroll {
height: 600px; height: 600px;
.address_scroll_list{ .address_scroll_list {
padding: 0 20px; padding: 0 20px;
font-size: $font_size; font-size: $font_size;
.address_list_item{ .address_list_item {
padding: 20px 0; padding: 20px 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.address_list_item_name{ .address_list_item_name {
@include common_ellipsis() @include common_ellipsis();
} }
.address_iconfont{ .address_iconfont {
font-size: 30px !important; font-size: 30px !important;
color: $color_main; color: $color_main;
} }
} }
} }
} }
.addresst_select{ .addresst_select {
color:$color_font_one; color: $color_font_one;
} }
} }

View File

@ -10977,6 +10977,11 @@ prepend-http@^2.0.0:
resolved "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" resolved "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
integrity sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA== 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: pretty-bytes@^5.3.0:
version "5.6.0" version "5.6.0"
resolved "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" resolved "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb"