From 31dee7d4572afc83efd83f77271a2e4d676bb4d1 Mon Sep 17 00:00:00 2001 From: Razvan Stoenescu Date: Sat, 14 Dec 2024 12:56:17 +0200 Subject: [PATCH] chore: small code style improvement --- app-vite/templates/entry/server-entry.js | 2 +- app-webpack/lib/modes/electron/electron-devserver.js | 2 +- app-webpack/lib/modes/pwa/pwa-devserver.js | 2 +- app-webpack/lib/modes/spa/spa-devserver.js | 2 +- app-webpack/lib/plugins/webpack.progress.js | 2 +- app-webpack/templates/entry/server-entry.js | 2 +- docs/src/layouts/doc-layout/DocSearch.vue | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app-vite/templates/entry/server-entry.js b/app-vite/templates/entry/server-entry.js index 2a369dcd93a..796f300644e 100644 --- a/app-vite/templates/entry/server-entry.js +++ b/app-vite/templates/entry/server-entry.js @@ -192,7 +192,7 @@ export default ssrContext => { Promise.resolve() ) .then(() => { - if (hasRedirected === true) { return } + if (hasRedirected === true) return <% if (metaConf.hasStore && ssr.manualStoreSsrContextInjection !== true) { %>ssrContext.state = unref(store.state)<% } %> diff --git a/app-webpack/lib/modes/electron/electron-devserver.js b/app-webpack/lib/modes/electron/electron-devserver.js index 0a56f4d9209..895ac34f387 100644 --- a/app-webpack/lib/modes/electron/electron-devserver.js +++ b/app-webpack/lib/modes/electron/electron-devserver.js @@ -71,7 +71,7 @@ module.exports.QuasarModeDevserver = class QuasarModeDevserver extends AppDevser const compiler = webpack(webpackConf) compiler.hooks.done.tap('done-compiling', stats => { - if (started === true) { return } + if (started === true) return // start dev server if there are no errors if (stats.hasErrors() === true) return diff --git a/app-webpack/lib/modes/pwa/pwa-devserver.js b/app-webpack/lib/modes/pwa/pwa-devserver.js index 1c96625e5cd..23ec273b080 100644 --- a/app-webpack/lib/modes/pwa/pwa-devserver.js +++ b/app-webpack/lib/modes/pwa/pwa-devserver.js @@ -77,7 +77,7 @@ module.exports.QuasarModeDevserver = class QuasarModeDevserver extends AppDevser const compiler = webpack(webpackConf) compiler.hooks.done.tap('done-compiling', stats => { - if (started === true) { return } + if (started === true) return // start dev server if there are no errors if (stats.hasErrors() === true) return diff --git a/app-webpack/lib/modes/spa/spa-devserver.js b/app-webpack/lib/modes/spa/spa-devserver.js index 7e7c0a1eb7a..7a04eca8435 100644 --- a/app-webpack/lib/modes/spa/spa-devserver.js +++ b/app-webpack/lib/modes/spa/spa-devserver.js @@ -30,7 +30,7 @@ module.exports.QuasarModeDevserver = class QuasarModeDevserver extends AppDevser const compiler = webpack(webpackConf) compiler.hooks.done.tap('done-compiling', stats => { - if (started === true) { return } + if (started === true) return // start dev server if there are no errors if (stats.hasErrors() === true) return diff --git a/app-webpack/lib/plugins/webpack.progress.js b/app-webpack/lib/plugins/webpack.progress.js index a74fe017ccc..09c472ed369 100644 --- a/app-webpack/lib/plugins/webpack.progress.js +++ b/app-webpack/lib/plugins/webpack.progress.js @@ -239,7 +239,7 @@ module.exports.WebpackProgressPlugin = class WebpackProgressPlugin extends Progr updateBars (percent, msg, details) { // it may still be called even after compilation was closed // due to Webpack's delayed call of handler - if (this.state === void 0) { return } + if (this.state === void 0) return const progress = Math.floor(percent * 100) const running = progress < 100 diff --git a/app-webpack/templates/entry/server-entry.js b/app-webpack/templates/entry/server-entry.js index 38ce096a08a..20e9364cc94 100644 --- a/app-webpack/templates/entry/server-entry.js +++ b/app-webpack/templates/entry/server-entry.js @@ -192,7 +192,7 @@ export default ssrContext => { Promise.resolve() ) .then(() => { - if (hasRedirected === true) { return } + if (hasRedirected === true) return <% if (metaConf.hasStore && ssr.manualStoreSsrContextInjection !== true) { %>ssrContext.state = unref(store.state)<% } %> diff --git a/docs/src/layouts/doc-layout/DocSearch.vue b/docs/src/layouts/doc-layout/DocSearch.vue index 6cd71dd925b..743c17cf521 100644 --- a/docs/src/layouts/doc-layout/DocSearch.vue +++ b/docs/src/layouts/doc-layout/DocSearch.vue @@ -106,7 +106,7 @@ function fetchQuery (val, onResult, onError) { clearTimeout(fetchTimer) fetchTimer = setTimeout(() => { - if (localRequestId !== requestId) { return } + if (localRequestId !== requestId) return const xhr = new XMLHttpRequest() const data = JSON.stringify({