From f40d15a770bb25ed3b77ef7ff1c7452b231b8578 Mon Sep 17 00:00:00 2001 From: chuzhixin <1204505056@qq.com> Date: Tue, 25 Aug 2020 17:34:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0stylint=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .stylelintrc.js | 34 +--------------------------------- .vscode/settings.json | 9 +++------ package.json | 5 ++--- 3 files changed, 6 insertions(+), 42 deletions(-) diff --git a/.stylelintrc.js b/.stylelintrc.js index b000fa4..f521455 100644 --- a/.stylelintrc.js +++ b/.stylelintrc.js @@ -1,35 +1,3 @@ module.exports = { - extends: ["stylelint-config-standard", "stylelint-config-recess-order"], - rules: { - "at-rule-no-unknown": [ - true, - { - ignoreAtRules: [ - "mixin", - "extend", - "content", - "include", - "for", - "function", - "return", - ], - }, - ], - "selector-pseudo-element-no-unknown": [ - true, - { - ignorePseudoElements: ["v-deep"], - }, - ], - "selector-pseudo-class-no-unknown": [ - true, - { - ignorePseudoClasses: ["export"], - }, - ], - indentation: 2, - "no-descending-specificity": null, - "declaration-colon-newline-after": null, - }, - ignoreFiles: ["**/*.js", "dist/*.*", "node_modules", "**/*.ts", "**/*.md"], + extends: ["stylelint-config-recess-order", "stylelint-config-prettier"], }; diff --git a/.vscode/settings.json b/.vscode/settings.json index 1896e70..896f53d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,11 +11,6 @@ "emmet.triggerExpansionOnTab": true, "editor.formatOnSave": true, "javascript.format.enable": true, - "stylelint.enable": true, - "css.validate": false, - "less.validate": false, - "scss.validate": false, - "stylelint.autoFixOnSave": true, "git.enableSmartCommit": true, "git.autofetch": true, "git.confirmSync": false, @@ -30,6 +25,7 @@ "**/.idea": true }, "editor.codeActionsOnSave": { + "source.fixAll.stylelint": true, "source.fixAll.eslint": true }, "[javascript]": { @@ -51,5 +47,6 @@ "docthis.includeAuthorTag": true, "docthis.includeDescriptionTag": true, "docthis.enableHungarianNotationEvaluation": true, - "docthis.inferTypesFromNames": true + "docthis.inferTypesFromNames": true, + "vetur.format.defaultFormatter.html": "prettier" } diff --git a/package.json b/package.json index 5a07fe0..41f7a4f 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "build:report": "vue-cli-service build --report", "globle": "npm install -g cnpm --registry=https://registry.npm.taobao.org&&cnpm i rimraf npm-check-updates nrm -g&&rimraf node_modules&&cnpm i", "lint": "vue-cli-service lint --fix", - "lint:style": "stylelint **/*.{vue,css,scss} --fix", + "lint:style": "stylelint-config-prettier-check", "inspect": "vue-cli-service inspect", "template": "plop", "clear": "rimraf node_modules&&cnpm i&&increase-memory-limit", @@ -107,9 +107,8 @@ "sass-loader": "^9.0.3", "script-loader": "^0.7.2", "stylelint": "^13.6.1", + "stylelint-config-prettier": "^8.0.2", "stylelint-config-recess-order": "^2.1.0", - "stylelint-config-standard": "^20.0.0", - "stylelint-order": "^4.1.0", "svg-sprite-loader": "^5.0.0", "svgo": "^1.3.2", "vue-template-compiler": "^2.6.12",