From c76e45a5d806bb08cb67624fcbc12450900918e6 Mon Sep 17 00:00:00 2001 From: keelyzheng Date: Wed, 22 Dec 2021 14:40:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feature:=20eslint=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/.eslintrc.js | 8 +++---- src/pages/build/webpack.dev.conf.js | 8 ++++++- src/pages/package.json | 22 +++++++------------ src/pages/src/api/index.js | 2 +- .../src/components/authority/NoAuthority.vue | 2 +- src/pages/src/views/audit/index.vue | 2 +- src/pages/src/views/catalog/PageAdd.vue | 5 ++--- src/pages/src/views/catalog/dataUpdate.vue | 4 ++-- src/pages/src/views/organization/index.vue | 2 +- .../organization/tree/OrganizationTree.vue | 2 +- 10 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/pages/.eslintrc.js b/src/pages/.eslintrc.js index 7407e332d..d9e858e37 100644 --- a/src/pages/.eslintrc.js +++ b/src/pages/.eslintrc.js @@ -1,6 +1,6 @@ module.exports = { root: true, - extends: ['@bkui/eslint-config-bk/vue'], + extends: ['@blueking/eslint-config-bk/vue'], globals: { NODE_ENV: false, }, @@ -8,8 +8,8 @@ module.exports = { parser: 'babel-eslint', sourceType: 'module', ecmaFeatures: { - legacyDecorators: true - } + legacyDecorators: true, + }, }, rules: { @@ -21,5 +21,5 @@ module.exports = { 'no-nested-ternary': 'off', 'arrow-body-style': 'off', 'no-restricted-properties': 'off', - }, + }, }; diff --git a/src/pages/build/webpack.dev.conf.js b/src/pages/build/webpack.dev.conf.js index 9ea01577e..db0720887 100644 --- a/src/pages/build/webpack.dev.conf.js +++ b/src/pages/build/webpack.dev.conf.js @@ -45,7 +45,13 @@ const webpackConfig = merge(baseConf, { }, }, }, - 'sass-loader', + { + loader: "sass-loader", + options: { + implementation: require("sass") //使用dart-sass代替node-sass + } + }, + // 'sass-loader', ], }, ], diff --git a/src/pages/package.json b/src/pages/package.json index 06b0b5569..4a35a922a 100644 --- a/src/pages/package.json +++ b/src/pages/package.json @@ -41,9 +41,9 @@ } }, "dependencies": { - "bk-magic-vue": "2.2.16", "art-template": "4.1.0", "axios": "0.18.0", + "bk-magic-vue": "2.2.16", "connect-history-api-fallback": "1.6.0", "cookie": "0.4.0", "cookie-parser": "1.4.4", @@ -66,7 +66,7 @@ "vuex": "3.1.1" }, "devDependencies": { - "@babel/core": "7.9.6", + "@babel/core": "7.11.0", "@babel/eslint-parser": "~7.14.7", "@babel/node": "7.8.7", "@babel/plugin-proposal-decorators": "7.4.4", @@ -82,8 +82,8 @@ "@babel/preset-env": "7.4.5", "@babel/register": "7.4.4", "@babel/runtime": "7.4.5", - "@bkui/eslint-config-bk": "^2.0.0", - "@bkui/stylelint-config-bk": "^2.0.0", + "@blueking/eslint-config-bk": "^2.0.1", + "@blueking/stylelint-config-bk": "^2.0.0", "@vue/babel-preset-jsx": "~1.2.4", "babel-core": "7.0.0-bridge.0", "babel-eslint": "10.0.2", @@ -100,15 +100,9 @@ "cors": "2.8.5", "cross-env": "5.2.0", "css-loader": "2.1.1", - "eslint": "5.16.0", - "eslint-config-standard": "12.0.0", + "eslint": "7.29.0", "eslint-friendly-formatter": "4.0.1", "eslint-loader": "2.1.2", - "eslint-plugin-import": "2.17.2", - "eslint-plugin-node": "9.0.1", - "eslint-plugin-promise": "4.1.1", - "eslint-plugin-standard": "4.0.0", - "eslint-plugin-vue": "7.7.0", "eventsource-polyfill": "0.9.6", "faker": "4.1.0", "file-loader": "3.0.1", @@ -123,7 +117,6 @@ "markdown-it-container": "2.0.0", "mini-css-extract-plugin": "0.6.0", "moment": "2.24.0", - "node-sass": "4.13.0", "npm": "6.9.0", "open": "6.3.0", "opencollective": "1.0.3", @@ -141,13 +134,14 @@ "postcss-property-lookup": "2.0.0", "postcss-url": "8.0.0", "rimraf": "2.6.3", - "sass-loader": "8.0.0", + "sass": "^1.45.1", + "sass-loader": "^8.0.0", "semver": "6.1.0", "shelljs": "0.8.3", "terser-webpack-plugin": "1.2.4", "transliteration": "2.1.3", "url-loader": "1.1.2", - "vue-eslint-parser": "~7.9.0", + "vue-eslint-parser": "~8.0.1", "vue-loader": "15.7.0", "vue-markdown-loader": "2.4.1", "vue-template-compiler": "2.5.22", diff --git a/src/pages/src/api/index.js b/src/pages/src/api/index.js index 484b2d006..394b8e2bd 100644 --- a/src/pages/src/api/index.js +++ b/src/pages/src/api/index.js @@ -50,7 +50,7 @@ axiosInstance.interceptors.request.use((config) => { */ axiosInstance.interceptors.response.use( response => response.data, - error => Promise.reject(error) + error => Promise.reject(error), ); const http = { diff --git a/src/pages/src/components/authority/NoAuthority.vue b/src/pages/src/components/authority/NoAuthority.vue index 3a0f6cd55..4646315c6 100644 --- a/src/pages/src/components/authority/NoAuthority.vue +++ b/src/pages/src/components/authority/NoAuthority.vue @@ -199,7 +199,7 @@ export default { margin-bottom: 30px; } - /deep/ .king-table { + ::v-deep .king-table { margin-bottom: 12px; .bk-table-body-wrapper { diff --git a/src/pages/src/views/audit/index.vue b/src/pages/src/views/audit/index.vue index 0040ebfc9..31dafe7e6 100644 --- a/src/pages/src/views/audit/index.vue +++ b/src/pages/src/views/audit/index.vue @@ -468,7 +468,7 @@ export default { } } - /deep/ .audit-panel-class { + ::v-deep .audit-panel-class { margin-top: 20px; .bk-tab-section { diff --git a/src/pages/src/views/catalog/PageAdd.vue b/src/pages/src/views/catalog/PageAdd.vue index 66348f009..c80251ed4 100644 --- a/src/pages/src/views/catalog/PageAdd.vue +++ b/src/pages/src/views/catalog/PageAdd.vue @@ -57,12 +57,11 @@ export default { }; }, created() { - for (const item of this.catalogMetas) { + this.catalogMetas.map((item) => { if (item.authorized) { this.selectedItem = item; - break; } - } + }); }, methods: { handleSelectItem(item) { diff --git a/src/pages/src/views/catalog/dataUpdate.vue b/src/pages/src/views/catalog/dataUpdate.vue index 2f93b9654..9020bffdf 100644 --- a/src/pages/src/views/catalog/dataUpdate.vue +++ b/src/pages/src/views/catalog/dataUpdate.vue @@ -170,13 +170,13 @@ export default { if (60 <= row.required_time && row.required_time < 3600) { const time = row.required_time / 60; const min = time.toString().split('.')[0]; - const sec = parseInt(time.toString().split('.')[1][0]) * 6; + const sec = parseInt(time.toString().split('.')[1][0], 10) * 6; return `${min}${this.$t('分钟')}${sec}${this.$t('秒')}`; } if (3600 <= row.required_time) { const time = row.required_time / 3600; const hour = time.toString().split('.')[0]; - const min = parseInt(time.toString().split('.')[1][0]) * 6; + const min = parseInt(time.toString().split('.')[1][0], 10) * 6; return `${hour}${this.$t('小时')}${min}${this.$t('分钟')}`; } }, diff --git a/src/pages/src/views/organization/index.vue b/src/pages/src/views/organization/index.vue index e821949ae..38fbd3c9d 100644 --- a/src/pages/src/views/organization/index.vue +++ b/src/pages/src/views/organization/index.vue @@ -558,7 +558,7 @@ export default { { key: 'update_time', name: 'update_time', - } + }, ); this.userMessage.tableHeardList = tableHeardList; } catch (e) { diff --git a/src/pages/src/views/organization/tree/OrganizationTree.vue b/src/pages/src/views/organization/tree/OrganizationTree.vue index 5ee1b503f..687edbfb1 100644 --- a/src/pages/src/views/organization/tree/OrganizationTree.vue +++ b/src/pages/src/views/organization/tree/OrganizationTree.vue @@ -700,7 +700,7 @@ li.tree-first-node { height: 32px; line-height: initial; - /deep/ .bk-form-input { + ::v-deep .bk-form-input { padding-left: 41px; } } From 33935b46cb95dedd2033325a4022cede2c20f1f9 Mon Sep 17 00:00:00 2001 From: keelyzheng Date: Wed, 22 Dec 2021 15:02:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feature:=20eslint=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/package.json b/src/pages/package.json index 1df4877fe..06c4086bc 100644 --- a/src/pages/package.json +++ b/src/pages/package.json @@ -102,7 +102,7 @@ "css-loader": "2.1.1", "eslint": "7.29.0", "eslint-friendly-formatter": "4.0.1", - "eslint-loader": "2.1.2", + "eslint-loader": "^4.0.2", "eventsource-polyfill": "0.9.6", "faker": "4.1.0", "file-loader": "3.0.1",