From 0fc86fcd769f0023e8b19a5c53ec00b51ec0bd1e Mon Sep 17 00:00:00 2001 From: Kerwin Bryant Date: Sat, 30 Apr 2022 23:16:41 +0800 Subject: [PATCH] frat: add lint for scoped-css (#138) --- .eslintrc | 4 +- package.json | 1 + src/App.vue | 2 +- src/layouts/blank.vue | 2 +- src/layouts/components/Header.vue | 12 ++-- src/layouts/components/Notice.vue | 11 ++++ src/layouts/components/Search.vue | 67 +++++++++++++---------- src/layouts/setting.vue | 16 +++--- src/pages/list/components/CommonTable.vue | 2 +- src/pages/login/components/Login.vue | 4 ++ src/pages/login/components/Register.vue | 4 ++ src/pages/login/index.less | 4 +- src/pages/login/index.vue | 2 +- 13 files changed, 82 insertions(+), 49 deletions(-) diff --git a/.eslintrc b/.eslintrc index 0e482c7..06bdc19 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,6 +3,7 @@ "plugin:@typescript-eslint/recommended", "eslint-config-airbnb-base", "plugin:vue/vue3-recommended", + "plugin:vue-scoped-css/base", "plugin:prettier/recommended" ], "env": { @@ -53,7 +54,8 @@ "vue/require-default-prop": 0, "vue/multi-word-component-names": 0, "vue/no-reserved-props": 0, - "vue/no-v-html": 0 + "vue/no-v-html": 0, + "vue-scoped-css/enforce-style-type": ["error", { "allows": ["scoped"] }] } } ] diff --git a/package.json b/package.json index dc8abee..6eb1a9d 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "eslint-plugin-import": "^2.24.2", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-vue": "^7.16.0", + "eslint-plugin-vue-scoped-css": "^2.2.0", "husky": "^7.0.4", "less": "^4.1.1", "lint-staged": "^12.1.2", diff --git a/src/App.vue b/src/App.vue index dcd05a4..dbd2a79 100644 --- a/src/App.vue +++ b/src/App.vue @@ -16,7 +16,7 @@ onMounted(() => { store.updateConfig({ ...config }); }); - diff --git a/src/layouts/components/Search.vue b/src/layouts/components/Search.vue index e80f58d..bbef8b1 100644 --- a/src/layouts/components/Search.vue +++ b/src/layouts/components/Search.vue @@ -1,7 +1,7 @@