diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 8028a640..21b3b9a9 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -36,6 +36,9 @@ rules: no-unexpected-multiline: 0 - no-unused-vars: + "@typescript-eslint/no-explicit-any": + 0 + + "@typescript-eslint/no-unused-vars": - error - argsIgnorePattern: "^_" diff --git a/src/Javascript/Odd/components/capabilities.ts b/src/Javascript/Odd/components/capabilities.ts index 54fdafa5..59ebfea6 100644 --- a/src/Javascript/Odd/components/capabilities.ts +++ b/src/Javascript/Odd/components/capabilities.ts @@ -87,26 +87,26 @@ export async function request( // Compile params const params = [ - [ "didExchange", exchangeDid ], - [ "didWrite", writeDid ], - [ "redirectTo", redirectTo ], - [ "sdk", VERSION.toString() ], - [ "sharedRepo", sharedRepo ? "t" : "f" ], - [ "sharing", sharing ? "t" : "f" ] + ["didExchange", exchangeDid], + ["didWrite", writeDid], + ["redirectTo", redirectTo], + ["sdk", VERSION.toString()], + ["sharedRepo", sharedRepo ? "t" : "f"], + ["sharing", sharing ? "t" : "f"] ].concat( - app ? [ [ "appFolder", `${app.creator}/${app.name}` ] ] : [], - fs?.private ? fs.private.map(p => [ "privatePath", Path.toPosix(p, { absolute: true }) ]) : [], - fs?.public ? fs.public.map(p => [ "publicPath", Path.toPosix(p, { absolute: true }) ]) : [], - raw ? [ [ "raw", Base64.urlEncode(JSON.stringify(raw)) ] ] : [], + app ? [["appFolder", `${app.creator}/${app.name}`]] : [], + fs?.private ? fs.private.map(p => ["privatePath", Path.toPosix(p, { absolute: true })]) : [], + fs?.public ? fs.public.map(p => ["publicPath", Path.toPosix(p, { absolute: true })]) : [], + raw ? [["raw", Base64.urlEncode(JSON.stringify(raw))]] : [], options.extraParams ? Object.entries(options.extraParams) : [] ).concat((() => { const apps = platform?.apps switch (typeof apps) { - case "string": return [ [ "app", apps ] ] - case "object": return apps.map(a => [ "app", a ]) + case "string": return [["app", apps]] + case "object": return apps.map(a => ["app", a]) default: return [] } @@ -115,7 +115,7 @@ export async function request( // And, go! window.location.href = endpoints.lobby + "?" + params - .map(([ k, v ]) => encodeURIComponent(k) + "=" + encodeURIComponent(v)) + .map(([k, v]) => encodeURIComponent(k) + "=" + encodeURIComponent(v)) .join("&") } @@ -178,9 +178,11 @@ async function getClassifiedViaPostMessage( if (!isLobbyClassifiedInfo(classifiedInfo)) stop() globalThis.removeEventListener("message", listen) - try { document.body.removeChild(iframe) } catch { } - - resolve(classifiedInfo) + try { + document.body.removeChild(iframe) + } catch { + resolve(classifiedInfo) + } } globalThis.addEventListener("message", listen) @@ -228,7 +230,7 @@ async function translateClassifiedInfo( // This easy way of detection works because the decrypted session key is encoded in base 64. // That means it'll only ever use the first byte to encode it, and if it were UTF-16 it would // split up the two bytes. Hence we check for the second byte here. - const isUtf16 = rawSessionKey[ 1 ] === 0 + const isUtf16 = rawSessionKey[1] === 0 const sessionKey = isUtf16 ? Uint8arrays.fromString( @@ -255,7 +257,7 @@ async function translateClassifiedInfo( isLobbySecrets(secrets) ? Object .entries(secrets.fs) - .map(([ posixPath, { bareNameFilter, key } ]) => { + .map(([posixPath, { bareNameFilter, key }]) => { return { bareNameFilter: bareNameFilter, path: Path.fromPosix(posixPath), diff --git a/system/Review/elm.json b/system/Review/elm.json index 6140bc3d..96702066 100644 --- a/system/Review/elm.json +++ b/system/Review/elm.json @@ -8,7 +8,7 @@ "direct": { "elm/core": "1.0.5", "elm/json": "1.1.3", - "jfmengels/elm-review": "2.11.1", + "jfmengels/elm-review": "2.13.1", "jfmengels/elm-review-common": "1.3.2", "jfmengels/elm-review-debug": "1.0.8", "jfmengels/elm-review-performance": "1.0.2",