eslint fixes

This commit is contained in:
luke crouch 2021-02-10 15:35:14 -06:00
parent 9c80f19f2f
commit ff3c31637c
3 changed files with 18 additions and 17 deletions

View file

@ -1,6 +1,6 @@
module.exports = { module.exports = {
"parserOptions": { "parserOptions": {
"ecmaVersion": 8 "ecmaVersion": 2018
}, },
"env": { "env": {
"browser": true, "browser": true,

View file

@ -1,3 +1,5 @@
/*global getBogusProxy */
const DEFAULT_FAVICON = "/img/blank-favicon.svg"; const DEFAULT_FAVICON = "/img/blank-favicon.svg";
// TODO use export here instead of globals // TODO use export here instead of globals
@ -26,8 +28,7 @@ const Utils = {
const bogusType = "socks4"; const bogusType = "socks4";
const bogusPort = 9999; const bogusPort = 9999;
const bogusUsername = "foo"; const bogusUsername = "foo";
const bogusPassword = "foo"; if(typeof window.Utils.pregeneratedString !== "undefined")
if(typeof window.Utils.pregeneratedString !== 'undefined')
{ {
return {type:bogusType, host:`w.${window.Utils.pregeneratedString}.coo`, port:bogusPort, username:bogusUsername, failoverTimeout:bogusFailover}; return {type:bogusType, host:`w.${window.Utils.pregeneratedString}.coo`, port:bogusPort, username:bogusUsername, failoverTimeout:bogusFailover};
} }
@ -38,12 +39,12 @@ const Utils = {
// We generate a cryptographically random string (of length specified in bogusLength), but we only do so once - thus negating any time delay caused // We generate a cryptographically random string (of length specified in bogusLength), but we only do so once - thus negating any time delay caused
const bogusLength = 8; const bogusLength = 8;
let array = new Uint8Array(bogusLength); const array = new Uint8Array(bogusLength);
window.crypto.getRandomValues(array); window.crypto.getRandomValues(array);
for(let i = 0; i < bogusLength; i++) for(let i = 0; i < bogusLength; i++)
{ {
let s = array[i].toString(16); const s = array[i].toString(16);
if(s.length == 1) if(s.length === 1)
window.Utils.pregeneratedString += `0${s}`; window.Utils.pregeneratedString += `0${s}`;
else else
window.Utils.pregeneratedString += s; window.Utils.pregeneratedString += s;

View file

@ -9,4 +9,4 @@ module.exports = {
"rules": { "rules": {
"no-restricted-globals": ["error", "browser"] "no-restricted-globals": ["error", "browser"]
} }
} };