From 365e7e7f6a87f0ef169533eaaaf59c64e628f2e9 Mon Sep 17 00:00:00 2001 From: qiang Date: Fri, 4 Jun 2021 15:29:31 +0800 Subject: [PATCH] style: lint --- .../uni-cli-shared/components/unicloud-db.vue | 2 +- .../lib/plugin/generate-json.js | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/uni-cli-shared/components/unicloud-db.vue b/packages/uni-cli-shared/components/unicloud-db.vue index 92a4933ae..1e2a07609 100644 --- a/packages/uni-cli-shared/components/unicloud-db.vue +++ b/packages/uni-cli-shared/components/unicloud-db.vue @@ -570,7 +570,7 @@ export default { complete && complete() }) }, - _getCollection() { + _getCollection () { const index = this.collection.indexOf(',') const collection = index > 0 ? this.collection.substring(0, index) : this.collection return collection diff --git a/packages/webpack-uni-mp-loader/lib/plugin/generate-json.js b/packages/webpack-uni-mp-loader/lib/plugin/generate-json.js index 81d96a845..2d5be4c68 100644 --- a/packages/webpack-uni-mp-loader/lib/plugin/generate-json.js +++ b/packages/webpack-uni-mp-loader/lib/plugin/generate-json.js @@ -25,7 +25,7 @@ const mpBaiduDynamicLibs = [ 'dynamicLib://myDynamicLib/vrvideo' ] -function analyzeUsingComponents() { +function analyzeUsingComponents () { if (!process.env.UNI_OPT_SUBPACKAGES) { return } @@ -95,7 +95,7 @@ function analyzeUsingComponents() { // }, {}) } -function normalizeUsingComponents(file, usingComponents) { +function normalizeUsingComponents (file, usingComponents) { const names = Object.keys(usingComponents) if (!names.length) { return usingComponents @@ -107,7 +107,7 @@ function normalizeUsingComponents(file, usingComponents) { return usingComponents } -module.exports = function generateJson(compilation) { +module.exports = function generateJson (compilation) { analyzeUsingComponents() const jsonFileMap = getChangedJsonFileMap() @@ -180,10 +180,10 @@ module.exports = function generateJson(compilation) { scopedSlotComponents.forEach(scopedSlotComponent => { compilation.assets[scopedSlotComponent] = { - size() { + size () { return Buffer.byteLength(scopedSlotComponentJsonSource, 'utf8') }, - source() { + source () { return scopedSlotComponentJsonSource } } @@ -215,20 +215,20 @@ module.exports = function generateJson(compilation) { !compilation.assets[jsFile] ) { const jsFileAsset = { - size() { + size () { return Buffer.byteLength(EMPTY_COMPONENT, 'utf8') }, - source() { + source () { return EMPTY_COMPONENT } } compilation.assets[jsFile] = jsFileAsset } const jsonAsset = { - size() { + size () { return Buffer.byteLength(source, 'utf8') }, - source() { + source () { return source } } -- GitLab