From b2ef26600cf793be0547a6caa36fdadc2004f6c2 Mon Sep 17 00:00:00 2001 From: Moulik Aggarwal <68378241+moulik-deepsource@users.noreply.github.com> Date: Thu, 24 Sep 2020 20:46:20 +0530 Subject: [PATCH] Fix Quality Issues using DeepSource (#1183) Co-authored-by: DeepSource Bot --- .deepsource.toml | 13 +++++++++++++ build.js | 2 +- .../collections/import-export-collections.vue | 4 ++-- components/graphql/queryeditor.vue | 1 + components/layout/pw-header.vue | 2 +- components/settings/swatch.vue | 1 + components/ui/ace-editor.vue | 1 + components/ui/js-editor.vue | 1 + components/ui/tab.vue | 5 +++-- components/ui/url-field.vue | 2 +- helpers/postwomanTesting.js | 2 +- layouts/default.vue | 2 +- pages/index.vue | 2 +- store/postwoman.js | 6 +++--- 14 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 .deepsource.toml diff --git a/.deepsource.toml b/.deepsource.toml new file mode 100644 index 000000000..a7292752d --- /dev/null +++ b/.deepsource.toml @@ -0,0 +1,13 @@ +version = 1 + +[[analyzers]] +name = "javascript" +enabled = true + + [analyzers.meta] + environment = [ + "nodejs", + "browser" + ] + plugins = ["vue"] + module_system="es-modules" diff --git a/build.js b/build.js index c4b42638e..25b4acacd 100644 --- a/build.js +++ b/build.js @@ -8,7 +8,7 @@ const PW_BUILD_DATA_DIR = "./.hoppscotch" // const IS_DEV_MODE = process.argv.includes("--dev") try { - ;(async () => { + (async () => { // Create the build data directory if it does not exist. if (!fs.existsSync(PW_BUILD_DATA_DIR)) { fs.mkdirSync(PW_BUILD_DATA_DIR) diff --git a/components/collections/import-export-collections.vue b/components/collections/import-export-collections.vue index 5fb2423cb..4b4100d83 100644 --- a/components/collections/import-export-collections.vue +++ b/components/collections/import-export-collections.vue @@ -320,10 +320,10 @@ export default { return items }, hasFolder(item) { - return item.hasOwnProperty("item") + return Object.prototype.hasOwnProperty.call(item, "item") }, isSubFolder(item) { - return item.hasOwnProperty("_postman_isSubFolder") && item._postman_isSubFolder + return Object.prototype.hasOwnProperty.call(item, "_postman_isSubFolder") && item._postman_isSubFolder }, flattenPostmanItem(subFolder, subFolderGlue = " -- ") { delete subFolder._postman_isSubFolder diff --git a/components/graphql/queryeditor.vue b/components/graphql/queryeditor.vue index b1f204367..6c7b62db5 100644 --- a/components/graphql/queryeditor.vue +++ b/components/graphql/queryeditor.vue @@ -38,6 +38,7 @@ export default { theme: { type: String, required: false, + default: null }, onRunGQLQuery: { type: Function, diff --git a/components/layout/pw-header.vue b/components/layout/pw-header.vue index 15c4a6e47..31555adb1 100644 --- a/components/layout/pw-header.vue +++ b/components/layout/pw-header.vue @@ -346,7 +346,7 @@ export default { mounted() { // Initializes the PWA code - checks if the app is installed, // etc. - ;(async () => { + (async () => { this.showInstallPrompt = await intializePwa() let cookiesAllowed = localStorage.getItem("cookiesAllowed") === "yes" if (!cookiesAllowed) { diff --git a/components/settings/swatch.vue b/components/settings/swatch.vue index 580cc3137..405835749 100644 --- a/components/settings/swatch.vue +++ b/components/settings/swatch.vue @@ -57,6 +57,7 @@ export default { }, name: { type: String, + default: "" }, active: { type: Boolean, diff --git a/components/ui/ace-editor.vue b/components/ui/ace-editor.vue index 8722e8710..c1b9bda76 100644 --- a/components/ui/ace-editor.vue +++ b/components/ui/ace-editor.vue @@ -35,6 +35,7 @@ export default { theme: { type: String, required: false, + default: null }, lang: { type: String, diff --git a/components/ui/js-editor.vue b/components/ui/js-editor.vue index 9d2f87d20..f658e4809 100644 --- a/components/ui/js-editor.vue +++ b/components/ui/js-editor.vue @@ -36,6 +36,7 @@ export default { theme: { type: String, required: false, + default: null, }, options: { type: Object, diff --git a/components/ui/tab.vue b/components/ui/tab.vue index 54353c540..3785daa42 100644 --- a/components/ui/tab.vue +++ b/components/ui/tab.vue @@ -7,10 +7,11 @@