Fix Quality Issues using DeepSource (#1183)
Co-authored-by: DeepSource Bot <bot@deepsource.io>
This commit is contained in:
13
.deepsource.toml
Normal file
13
.deepsource.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
version = 1
|
||||
|
||||
[[analyzers]]
|
||||
name = "javascript"
|
||||
enabled = true
|
||||
|
||||
[analyzers.meta]
|
||||
environment = [
|
||||
"nodejs",
|
||||
"browser"
|
||||
]
|
||||
plugins = ["vue"]
|
||||
module_system="es-modules"
|
||||
2
build.js
2
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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -38,6 +38,7 @@ export default {
|
||||
theme: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null
|
||||
},
|
||||
onRunGQLQuery: {
|
||||
type: Function,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -57,6 +57,7 @@ export default {
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
active: {
|
||||
type: Boolean,
|
||||
|
||||
@@ -35,6 +35,7 @@ export default {
|
||||
theme: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null
|
||||
},
|
||||
lang: {
|
||||
type: String,
|
||||
|
||||
@@ -36,6 +36,7 @@ export default {
|
||||
theme: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
options: {
|
||||
type: Object,
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
label: { type: String },
|
||||
icon: { type: String },
|
||||
label: { type: String, default: "" },
|
||||
icon: { type: String, default: "" },
|
||||
id: { required: true },
|
||||
selected: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
value: { type: String },
|
||||
value: { type: String, default: "" },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -102,7 +102,7 @@ class Expectation {
|
||||
: this._fail(this._fmtNot(`Expected ${this.expectValue} (not)to be ${value}`))
|
||||
}
|
||||
toHaveProperty(value) {
|
||||
return this._satisfies(this.expectValue.hasOwnProperty(value), true)
|
||||
return this._satisfies(Object.prototype.hasOwnProperty.call(this.expectValue, value), true)
|
||||
? this._pass()
|
||||
: this._fail(
|
||||
this._fmtNot(`Expected object ${this.expectValue} to (not)have property ${value}`)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
export default {
|
||||
beforeMount() {
|
||||
// Load theme settings
|
||||
;(() => {
|
||||
(() => {
|
||||
// Apply theme from settings.
|
||||
document.documentElement.className = this.$store.state.postwoman.settings.THEME_CLASS || ""
|
||||
// Load theme color data from settings, or use default color.
|
||||
|
||||
@@ -2604,7 +2604,7 @@ export default {
|
||||
},
|
||||
async oauthRedirectReq() {
|
||||
const tokenInfo = await oauthRedirect()
|
||||
if (tokenInfo.hasOwnProperty("access_token")) {
|
||||
if (Object.prototype.hasOwnProperty.call(tokenInfo, "access_token")) {
|
||||
this.bearerToken = tokenInfo.access_token
|
||||
this.addOAuthToken({
|
||||
name: this.accessTokenName,
|
||||
|
||||
@@ -331,9 +331,9 @@ export const mutations = {
|
||||
const { request } = payload
|
||||
|
||||
// Remove the old request from collection
|
||||
if (request.hasOwnProperty("oldCollection") && request.oldCollection > -1) {
|
||||
if (Object.prototype.hasOwnProperty.call(request, "oldCollection") && request.oldCollection > -1) {
|
||||
const folder =
|
||||
request.hasOwnProperty("oldFolder") && request.oldFolder >= -1
|
||||
Object.prototype.hasOwnProperty.call(request, "oldFolder") && request.oldFolder >= -1
|
||||
? request.oldFolder
|
||||
: request.folder
|
||||
if (folder > -1) {
|
||||
@@ -341,7 +341,7 @@ export const mutations = {
|
||||
} else {
|
||||
collections[request.oldCollection].requests.splice(request.requestIndex, 1)
|
||||
}
|
||||
} else if (request.hasOwnProperty("oldFolder") && request.oldFolder !== -1) {
|
||||
} else if (Object.prototype.hasOwnProperty.call(request, "oldFolder") && request.oldFolder !== -1) {
|
||||
collections[request.collection].folders[folder].requests.splice(request.requestIndex, 1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user