Skip to content

Commit f42d694

Browse files
committed
Fixed lint warnings: unicorn/prefer-includes
Signed-off-by: Vitika9 <[email protected]>
1 parent f3ad621 commit f42d694

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"no-unused-vars": "error",
8080
"prefer-destructuring": "error",
8181
"unicorn/no-for-loop": "error",
82-
"unicorn/prefer-includes": "warn",
82+
"unicorn/prefer-includes": "error",
8383
"unicorn/prefer-string-slice": "warn",
8484
"unicorn/filename-case": "warn",
8585
"unicorn/prefer-query-selector": "error"

src/main/zapHomeFiles/hud/drawer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Vue.component('history', {
5656
return re.test(message.url);
5757
}
5858

59-
return message.url.indexOf(self.filter) >= 0;
59+
return message.url.includes(self.filter);
6060
});
6161
}
6262
},
@@ -170,7 +170,7 @@ Vue.component('websockets', {
170170
return re.test(message.messageSummary);
171171
}
172172

173-
return message.messageSummary.indexOf(self.filter) >= 0;
173+
return message.messageSummary.includes(self.filter);
174174
});
175175
}
176176
},

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const Break = (function () {
136136

137137
utils.getAllClients('display')
138138
.then(clients => {
139-
const isFirefox = this.navigator.userAgent.indexOf('Firefox') > -1;
139+
const isFirefox = this.navigator.userAgent.includes('Firefox');
140140
let r = false;
141141

142142
if (isFirefox) {
@@ -198,7 +198,7 @@ const Break = (function () {
198198
function showBreakWebSocketDisplay(data) {
199199
utils.getAllClients('display')
200200
.then(clients => {
201-
const isFirefox = this.navigator.userAgent.indexOf('Firefox') > -1;
201+
const isFirefox = this.navigator.userAgent.includes('Firefox');
202202
let r = false;
203203

204204
if (isFirefox) {

src/main/zapHomeFiles/hud/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const utils = (function () {
5858
headerText = headerText.substring(headerText.indexOf(':') + 2);
5959
let value;
6060

61-
if (headerText.indexOf('\n') < 0) {
61+
if (!headerText.includes('\n')) {
6262
value = headerText;
6363
headerText = '';
6464
} else {
@@ -125,7 +125,7 @@ const utils = (function () {
125125
}
126126

127127
function hasScheme(url) {
128-
return url.indexOf('://') > -1;
128+
return url.includes('://');
129129
}
130130

131131
/*
@@ -152,7 +152,7 @@ const utils = (function () {
152152
* Initialize all of the info that will be stored in indexeddb.
153153
*/
154154
function initializeHUD(leftTools, rightTools, drawer) {
155-
if (IS_DEV_MODE && leftTools.indexOf('hudErrors') < 0) {
155+
if (IS_DEV_MODE && !leftTools.includes('hudErrors')) {
156156
// Always add the error tool in dev mode
157157
leftTools.push('hudErrors');
158158
}

0 commit comments

Comments
 (0)