From 63aed4082f1357456b689b027d83927ae6b22b9b Mon Sep 17 00:00:00 2001 From: mwx816443 Date: Sat, 30 May 2020 16:21:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E5=8E=9F=20stylelint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .stylelintignore | 1 + .stylelintrc | 27 + package.json | 6 +- src/components/BackToTop/index.vue | 8 +- src/components/DndList/index.vue | 34 +- src/components/DragSelect/index.vue | 6 +- src/components/Dropzone/index.vue | 97 +- src/components/GithubCorner/index.vue | 17 +- src/components/ImageCropper/index.vue | 1567 +++++++---------- src/components/JsonEditor/index.vue | 9 +- src/components/Kanban/index.vue | 2 +- src/components/MDinput/index.vue | 40 +- src/components/Pagination/index.vue | 1 + src/components/PanThumb/index.vue | 4 +- src/components/RightPanel/index.vue | 11 +- src/components/Screenfull/index.vue | 2 +- src/components/Share/DropdownMenu.vue | 13 +- src/components/SvgIcon/index.vue | 2 +- src/components/TextHoverEffect/Mallki.vue | 2 +- .../Tinymce/components/EditorImage.vue | 1 + src/components/Tinymce/index.vue | 5 + src/components/Upload/SingleImage.vue | 102 +- src/components/Upload/SingleImage2.vue | 15 +- src/components/Upload/SingleImage3.vue | 18 +- src/components/UploadExcel/index.vue | 7 +- src/directive/waves/waves.css | 44 +- src/layout/components/Navbar.vue | 18 +- src/layout/components/Settings/index.vue | 6 +- src/layout/components/Sidebar/Logo.vue | 3 +- src/layout/components/TagsView/ScrollPane.vue | 4 +- src/layout/components/TagsView/index.vue | 20 +- src/layout/index.vue | 6 +- src/styles/btn.scss | 85 +- src/styles/element-ui.scss | 17 +- src/styles/element-variables.scss | 4 +- src/styles/index.scss | 50 +- src/styles/mixin.scss | 12 +- src/styles/sidebar.scss | 12 +- src/styles/transition.scss | 6 +- src/styles/variables.scss | 30 +- src/views/charts/keyboard.vue | 4 +- src/views/charts/line.vue | 4 +- src/views/charts/mix-chart.vue | 4 +- src/views/clipboard/index.vue | 16 +- src/views/components-demo/avatar-upload.vue | 15 +- src/views/components-demo/count-to.vue | 93 +- src/views/components-demo/drag-kanban.vue | 15 +- src/views/components-demo/drag-select.vue | 6 +- src/views/components-demo/json-editor.vue | 4 +- src/views/components-demo/markdown.vue | 7 +- src/views/components-demo/mixin.vue | 17 +- src/views/components-demo/split-pane.vue | 14 +- src/views/components-demo/sticky.vue | 2 +- src/views/components-demo/tinymce.vue | 2 +- .../dashboard/admin/components/BoxCard.vue | 56 +- .../dashboard/admin/components/PanelGroup.vue | 26 +- .../admin/components/TodoList/index.scss | 242 ++- .../admin/components/TransactionTable.vue | 2 +- src/views/dashboard/admin/index.vue | 16 +- src/views/dashboard/editor/index.vue | 31 +- src/views/documentation/index.vue | 16 +- src/views/error-log/index.vue | 4 +- src/views/error-page/401.vue | 22 +- src/views/error-page/404.vue | 184 +- .../example/components/ArticleDetail.vue | 36 +- .../example/components/Dropdown/SourceUrl.vue | 4 +- src/views/example/list.vue | 3 +- .../excel/components/AutoWidthOption.vue | 2 +- src/views/excel/components/BookTypeOption.vue | 4 +- src/views/excel/components/FilenameOption.vue | 6 +- src/views/excel/export-excel.vue | 6 +- src/views/excel/merge-header.vue | 2 +- src/views/excel/select-excel.vue | 6 +- src/views/excel/upload-excel.vue | 2 +- src/views/icons/index.vue | 14 +- src/views/login/components/SocialSignin.vue | 17 +- src/views/login/index.vue | 64 +- src/views/nested/menu1/index.vue | 2 +- src/views/nested/menu1/menu1-1/index.vue | 2 +- src/views/nested/menu1/menu1-2/index.vue | 2 +- .../nested/menu1/menu1-2/menu1-2-1/index.vue | 2 +- .../nested/menu1/menu1-2/menu1-2-2/index.vue | 2 +- src/views/nested/menu1/menu1-3/index.vue | 2 +- src/views/nested/menu2/index.vue | 2 +- src/views/pdf/download.vue | 102 +- src/views/pdf/index.vue | 2 +- .../permission/components/SwitchRoles.vue | 2 +- src/views/permission/directive.vue | 30 +- src/views/permission/role.vue | 5 +- src/views/profile/components/Activity.vue | 30 +- src/views/profile/components/UserCard.vue | 14 +- src/views/tab/components/TabPane.vue | 2 +- src/views/tab/index.vue | 4 +- src/views/table/complex-table.vue | 16 +- src/views/table/drag-table.vue | 24 +- .../dynamic-table/components/FixedThead.vue | 2 +- .../dynamic-table/components/UnfixedThead.vue | 2 +- src/views/table/dynamic-table/index.vue | 4 +- src/views/table/inline-edit-table.vue | 3 +- src/views/theme/index.vue | 9 +- src/views/zip/index.vue | 4 +- 101 files changed, 1767 insertions(+), 1784 deletions(-) create mode 100644 .stylelintignore create mode 100644 .stylelintrc diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 00000000..d00d567c --- /dev/null +++ b/.stylelintignore @@ -0,0 +1 @@ +src/assets diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 00000000..bf3fe7b9 --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,27 @@ +{ + "extends": "stylelint-config-sass-guidelines", + "plugins": [ + "stylelint-order" + ], + "rules": { + "property-no-vendor-prefix": null, + "declaration-block-semicolon-newline-after": "always-multi-line", + "declaration-property-value-blacklist": null, + "selector-no-qualifying-type": null, + "selector-pseudo-element-no-unknown": null, + "selector-no-vendor-prefix": null, + "media-feature-name-no-vendor-prefix": null, + "scss/at-import-partial-extension-blacklist": null, + "scss/selector-no-redundant-nesting-selector": null, + "scss/at-mixin-pattern": null, + "scss/dollar-variable-pattern": null, + "order/properties-alphabetical-order": null, + "selector-max-id": null, + "property-no-unknown": null, + "color-named": null, + "value-no-vendor-prefix": null, + "selector-class-pattern": null, + "max-nesting-depth": 10, + "selector-max-compound-selectors": 10 + } +} diff --git a/package.json b/package.json index f82df424..ed9a4427 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", "lint": "eslint --ext .js,.vue src", + "lint:css": "stylelint --aei .vue,.html src", "test:unit": "jest --clearCache && vue-cli-service test:unit", "test:ci": "npm run lint && npm run test:unit", "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", @@ -97,7 +98,10 @@ "runjs": "4.3.2", "sass-loader": "7.3.1", "script-ext-html-webpack-plugin": "2.1.3", - "serve-static": "1.13.2", + "serve-static": "^1.13.2", + "stylelint": "13.5.0", + "stylelint-config-sass-guidelines": "7.0.0", + "stylelint-order": "4.0.0", "svg-sprite-loader": "4.1.3", "svgo": "1.2.0", "vue-template-compiler": "2.6.10", diff --git a/src/components/BackToTop/index.vue b/src/components/BackToTop/index.vue index 36522f4a..a2061ff3 100644 --- a/src/components/BackToTop/index.vue +++ b/src/components/BackToTop/index.vue @@ -1,7 +1,7 @@ @@ -96,15 +96,15 @@ export default { .fade-enter-active, .fade-leave-active { - transition: opacity .5s; + transition: opacity 0.5s; } .fade-enter, .fade-leave-to { - opacity: 0 + opacity: 0; } -.back-to-ceiling .Icon { +.back-to-ceiling .back-to-icon { fill: #9aaabf; background: none; } diff --git a/src/components/DndList/index.vue b/src/components/DndList/index.vue index 23ca006e..2862d52a 100644 --- a/src/components/DndList/index.vue +++ b/src/components/DndList/index.vue @@ -1,23 +1,23 @@