Skip to content

Commit f3ad621

Browse files
committed
Fixed lint warnings: prefer-destructuring
Signed-off-by: Vitika9 <[email protected]>
1 parent 72ac1c6 commit f3ad621

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
}
7878
],
7979
"no-unused-vars": "error",
80-
"prefer-destructuring": "warn",
80+
"prefer-destructuring": "error",
8181
"unicorn/no-for-loop": "error",
8282
"unicorn/prefer-includes": "warn",
8383
"unicorn/prefer-string-slice": "warn",

src/main/zapHomeFiles/hud/display.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ Vue.component('history-message-modal', {
529529
}, [channel.port2]);
530530
},
531531
ascanRequest() {
532-
const request = this.request;
532+
const {request} = this;
533533
this.$emit('close');
534534
navigator.serviceWorker.controller.postMessage(
535535
{
@@ -582,7 +582,7 @@ Vue.component('ws-message-modal', {
582582
},
583583
computed: {
584584
currentMessage() {
585-
const payload = this.payload;
585+
const {payload} = this;
586586
return {payload};
587587
}
588588
}
@@ -920,8 +920,8 @@ document.addEventListener('DOMContentLoaded', () => {
920920
});
921921

922922
navigator.serviceWorker.addEventListener('message', event => {
923-
const action = event.data.action;
924-
const config = event.data.config;
923+
const {data: {action}} = event;
924+
const {data: {config}} = event;
925925
const port = event.ports[0];
926926
let show;
927927

src/main/zapHomeFiles/hud/drawer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ document.addEventListener('DOMContentLoaded', () => {
487487
});
488488

489489
navigator.serviceWorker.addEventListener('message', event => {
490-
const action = event.data.action;
490+
const {data: {action}} = event;
491491
const port = event.ports[0];
492492

493493
switch (action) {

src/main/zapHomeFiles/hud/serviceworker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function initWebSockets() {
9797
self.dispatchEvent(ev);
9898
} else if ('id' in jevent && 'response' in jevent) {
9999
const pFunctions = webSocketCallbacks[jevent.id];
100-
const response = jevent.response;
100+
const {response} = jevent;
101101
if ('code' in response && 'message' in response) {
102102
// These always indicate a failure
103103
const error = new Error(I18n.t('error_with_message', [response.message]));

src/main/zapHomeFiles/hud/tools/commonAlerts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ const CommonAlerts = (function () {
196196
}
197197

198198
const risk = event.detail.riskString;
199-
const name = event.detail.name;
199+
const {detail: {name}} = event;
200200

201201
if (alertCache[targetDomain][risk][name] === undefined) {
202202
alertCache[targetDomain][risk][name] = {};

0 commit comments

Comments
 (0)