diff --git a/package.json b/package.json index 91c2d27edc..f30dae8f49 100644 --- a/package.json +++ b/package.json @@ -283,7 +283,7 @@ "ts-loader": "4.1.0", "ts-node": "8.3.0", "typed-scss-modules": "0.0.11", - "typescript": "4.3.5", + "typescript": "4.4.2", "webpack": "5.30.0", "webpack-cli": "4.6.0", "webpack-dev-server": "3.11.2" diff --git a/ts/test-node/updater/curve_test.ts b/ts/test-node/updater/curve_test.ts index cd8e36545c..55108b00c1 100644 --- a/ts/test-node/updater/curve_test.ts +++ b/ts/test-node/updater/curve_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { get as getFromConfig } from 'config'; +import config from 'config'; import { keyPair, sign, verify } from '../../updater/curve'; @@ -25,7 +25,7 @@ describe('updater/curve', () => { 'hex' ); const publicKey = Buffer.from( - getFromConfig('updatesPublicKey'), + config.get('updatesPublicKey'), 'hex' ); diff --git a/ts/textsecure/Crypto.ts b/ts/textsecure/Crypto.ts index 55e80b3e87..5d4a9e6d8e 100644 --- a/ts/textsecure/Crypto.ts +++ b/ts/textsecure/Crypto.ts @@ -15,105 +15,6 @@ import { typedArrayToArrayBuffer, } from '../Crypto'; -declare global { - // this is fixed in already, and won't be necessary when the new definitions - // files are used: https://github.com/microsoft/TSJS-lib-generator/pull/843 - // We want to extend `SubtleCrypto`, so we need an interface. - // eslint-disable-next-line no-restricted-syntax - export interface SubtleCrypto { - decrypt( - algorithm: - | string - | RsaOaepParams - | AesCtrParams - | AesCbcParams - | AesCmacParams - | AesGcmParams - | AesCfbParams, - key: CryptoKey, - data: - | Int8Array - | Int16Array - | Int32Array - | Uint8Array - | Uint16Array - | Uint32Array - | Uint8ClampedArray - | Float32Array - | Float64Array - | DataView - | ArrayBuffer - ): Promise; - - digest( - algorithm: string | Algorithm, - data: - | Int8Array - | Int16Array - | Int32Array - | Uint8Array - | Uint16Array - | Uint32Array - | Uint8ClampedArray - | Float32Array - | Float64Array - | DataView - | ArrayBuffer - ): Promise; - - importKey( - format: 'raw' | 'pkcs8' | 'spki', - keyData: - | Int8Array - | Int16Array - | Int32Array - | Uint8Array - | Uint16Array - | Uint32Array - | Uint8ClampedArray - | Float32Array - | Float64Array - | DataView - | ArrayBuffer, - algorithm: - | string - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | DhImportKeyParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: Array - ): Promise; - - importKey( - format: string, - keyData: - | JsonWebKey - | Int8Array - | Int16Array - | Int32Array - | Uint8Array - | Uint16Array - | Uint32Array - | Uint8ClampedArray - | Float32Array - | Float64Array - | DataView - | ArrayBuffer, - algorithm: - | string - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | DhImportKeyParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: Array - ): Promise; - } -} - const PROFILE_IV_LENGTH = 12; // bytes const PROFILE_KEY_LENGTH = 32; // bytes const PROFILE_TAG_LENGTH = 128; // bits diff --git a/ts/updater/common.ts b/ts/updater/common.ts index e3426e264d..7c28e80fea 100644 --- a/ts/updater/common.ts +++ b/ts/updater/common.ts @@ -15,7 +15,7 @@ import { createParser, ParserConfiguration } from 'dashdash'; import ProxyAgent from 'proxy-agent'; import { FAILSAFE_SCHEMA, safeLoad } from 'js-yaml'; import { gt } from 'semver'; -import { get as getFromConfig } from 'config'; +import config from 'config'; import { get, GotOptions, stream } from 'got'; import { v4 as getGuid } from 'uuid'; import pify from 'pify'; @@ -188,10 +188,10 @@ export function getUpdateCheckUrl(): string { } export function getUpdatesBase(): string { - return getFromConfig('updatesUrl'); + return config.get('updatesUrl'); } export function getCertificateAuthority(): string { - return getFromConfig('certificateAuthority'); + return config.get('certificateAuthority'); } export function getProxyUrl(): string | undefined { return process.env.HTTPS_PROXY || process.env.https_proxy; diff --git a/ts/updater/index.ts b/ts/updater/index.ts index dda3ec79f0..a0a85659d3 100644 --- a/ts/updater/index.ts +++ b/ts/updater/index.ts @@ -1,7 +1,7 @@ // Copyright 2019-2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { get as getFromConfig } from 'config'; +import config from 'config'; import { BrowserWindow } from 'electron'; import { UpdaterInterface } from './common'; @@ -57,8 +57,6 @@ export async function force(): Promise { function autoUpdateDisabled() { return ( - process.platform === 'linux' || - process.mas || - !getFromConfig('updatesEnabled') + process.platform === 'linux' || process.mas || !config.get('updatesEnabled') ); } diff --git a/ts/updater/macos.ts b/ts/updater/macos.ts index 9914c66178..901a6176b3 100644 --- a/ts/updater/macos.ts +++ b/ts/updater/macos.ts @@ -8,7 +8,7 @@ import { dirname } from 'path'; import { v4 as getGuid } from 'uuid'; import { app, autoUpdater, BrowserWindow } from 'electron'; -import { get as getFromConfig } from 'config'; +import config from 'config'; import { gt } from 'semver'; import got from 'got'; @@ -136,7 +136,7 @@ async function downloadAndInstall( return; } - const publicKey = hexToBinary(getFromConfig('updatesPublicKey')); + const publicKey = hexToBinary(config.get('updatesPublicKey')); const verified = await verifySignature(updateFilePath, version, publicKey); if (!verified) { // Note: We don't delete the cache here, because we don't want to continually diff --git a/ts/updater/windows.ts b/ts/updater/windows.ts index 41fcc23743..43b02a832e 100644 --- a/ts/updater/windows.ts +++ b/ts/updater/windows.ts @@ -6,7 +6,7 @@ import { spawn as spawnEmitter, SpawnOptions } from 'child_process'; import { readdir as readdirCallback, unlink as unlinkCallback } from 'fs'; import { app, BrowserWindow } from 'electron'; -import { get as getFromConfig } from 'config'; +import config from 'config'; import { gt } from 'semver'; import pify from 'pify'; @@ -135,7 +135,7 @@ async function downloadAndInstall( throw error; } - const publicKey = hexToBinary(getFromConfig('updatesPublicKey')); + const publicKey = hexToBinary(config.get('updatesPublicKey')); const verified = await verifySignature(updateFilePath, version, publicKey); if (!verified) { // Note: We don't delete the cache here, because we don't want to continually @@ -216,7 +216,7 @@ async function verifyAndInstall( return; } - const publicKey = hexToBinary(getFromConfig('updatesPublicKey')); + const publicKey = hexToBinary(config.get('updatesPublicKey')); const verified = await verifySignature(updateFilePath, newVersion, publicKey); if (!verified) { throw new Error( diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index e37546aa8a..6618fca027 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -12814,14 +12814,6 @@ "updated": "2021-02-26T18:44:56.450Z", "reasonDetail": "Rendered template has been sanitized" }, - { - "rule": "React-useRef", - "path": "ts/calling/useGetCallingFrameBuffer.js", - "line": " const ref = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-01-06T00:47:54.313Z", - "reasonDetail": "Needed to render remote video elements. Doesn't interact with the DOM." - }, { "rule": "React-useRef", "path": "ts/calling/useGetCallingFrameBuffer.ts", @@ -12864,13 +12856,6 @@ "reasonCategory": "falseMatch", "updated": "2021-05-05T23:11:22.692Z" }, - { - "rule": "React-useRef", - "path": "ts/components/AvatarPreview.js", - "line": " const startingAvatarPathRef = react_1.useRef(avatarValue ? undefined : avatarPath);", - "reasonCategory": "usageTrusted", - "updated": "2021-08-03T21:17:38.615Z" - }, { "rule": "React-useRef", "path": "ts/components/AvatarPreview.tsx", @@ -12878,28 +12863,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-08-03T21:17:38.615Z" }, - { - "rule": "React-useRef", - "path": "ts/components/AvatarTextEditor.js", - "line": " const measureElRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-08-04T18:18:09.236Z", - "reasonDetail": "Only used for measurement. Doesn't modify the DOM." - }, - { - "rule": "React-useRef", - "path": "ts/components/AvatarTextEditor.js", - "line": " const inputRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-08-04T22:02:17.074Z" - }, - { - "rule": "React-useRef", - "path": "ts/components/AvatarTextEditor.js", - "line": " const onDoneRef = react_1.useRef(onDone);", - "reasonCategory": "usageTrusted", - "updated": "2021-08-05T23:40:55.699Z" - }, { "rule": "React-useRef", "path": "ts/components/AvatarTextEditor.tsx", @@ -12922,13 +12885,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-08-05T23:40:55.699Z" }, - { - "rule": "React-useRef", - "path": "ts/components/AvatarUploadButton.js", - "line": " const fileInputRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-08-03T21:17:38.615Z" - }, { "rule": "React-useRef", "path": "ts/components/AvatarUploadButton.tsx", @@ -12936,20 +12892,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-08-03T21:17:38.615Z" }, - { - "rule": "React-useRef", - "path": "ts/components/BackboneHost.js", - "line": " const hostRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-06-09T04:02:08.305Z" - }, - { - "rule": "React-useRef", - "path": "ts/components/BackboneHost.js", - "line": " const viewRef = react_1.useRef(undefined);", - "reasonCategory": "usageTrusted", - "updated": "2021-06-09T04:02:08.305Z" - }, { "rule": "React-useRef", "path": "ts/components/BackboneHost.tsx", @@ -12964,14 +12906,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/CallNeedPermissionScreen.js", - "line": " const autoCloseAtRef = react_1.useRef(Date.now() + AUTO_CLOSE_MS);", - "reasonCategory": "falseMatch", - "updated": "2020-10-26T19:12:24.410Z", - "reasonDetail": "Doesn't touch the DOM." - }, { "rule": "React-useRef", "path": "ts/components/CallNeedPermissionScreen.tsx", @@ -12979,14 +12913,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/CallScreen.js", - "line": " const localVideoRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2020-10-26T21:35:52.858Z", - "reasonDetail": "Used to get the local video element for rendering." - }, { "rule": "React-useRef", "path": "ts/components/CallScreen.tsx", @@ -13040,13 +12966,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/CallingToastManager.js", - "line": " const timeoutRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-05-13T19:40:31.751Z" - }, { "rule": "React-useRef", "path": "ts/components/CallingToastManager.tsx", @@ -13054,14 +12973,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/CaptchaDialog.js", - "line": " const buttonRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-05-05T23:11:22.692Z", - "reasonDetail": "Used only to set focus" - }, { "rule": "React-useRef", "path": "ts/components/CaptchaDialog.tsx", @@ -13085,13 +12996,6 @@ "updated": "2019-03-09T00:08:44.242Z", "reasonDetail": "Used only to set focus" }, - { - "rule": "React-useRef", - "path": "ts/components/ChatColorPicker.js", - "line": " const menuRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-05-25T18:25:53.896Z" - }, { "rule": "React-useRef", "path": "ts/components/ChatColorPicker.tsx", @@ -13249,14 +13153,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/ContactPills.js", - "line": " const elRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-03-01T18:34:36.638Z", - "reasonDetail": "Used for scrolling. Doesn't otherwise manipulate the DOM" - }, { "rule": "React-useRef", "path": "ts/components/ContactPills.tsx", @@ -13264,14 +13160,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/ConversationList.js", - "line": " const listRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-02-12T16:25:08.285Z", - "reasonDetail": "Used for scroll calculations" - }, { "rule": "React-useRef", "path": "ts/components/ConversationList.tsx", @@ -13279,14 +13167,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/DirectCallRemoteParticipant.js", - "line": " const remoteVideoRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2020-11-11T21:56:04.179Z", - "reasonDetail": "Needed to render the remote video element." - }, { "rule": "React-useRef", "path": "ts/components/DirectCallRemoteParticipant.tsx", @@ -13294,13 +13174,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/ForwardMessageModal.js", - "line": " const inputRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-04-19T18:13:21.664Z" - }, { "rule": "React-useRef", "path": "ts/components/ForwardMessageModal.js", @@ -13322,13 +13195,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/GradientDial.js", - "line": " const containerRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-05-25T18:25:53.896Z" - }, { "rule": "React-useRef", "path": "ts/components/GradientDial.tsx", @@ -13336,14 +13202,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/GroupCallOverflowArea.js", - "line": " const overflowRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-01-08T15:48:46.313Z", - "reasonDetail": "Used to deal with scroll position." - }, { "rule": "React-useRef", "path": "ts/components/GroupCallOverflowArea.tsx", @@ -13351,30 +13209,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/GroupCallRemoteParticipant.js", - "line": " const remoteVideoRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2020-11-11T21:56:04.179Z", - "reasonDetail": "Needed to render the remote video element." - }, - { - "rule": "React-useRef", - "path": "ts/components/GroupCallRemoteParticipant.js", - "line": " const canvasContextRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2020-11-17T23:29:38.698Z", - "reasonDetail": "Doesn't touch the DOM." - }, - { - "rule": "React-useRef", - "path": "ts/components/GroupCallRemoteParticipant.js", - "line": " const lastReceivedVideoAt = react_1.useRef(-Infinity);", - "reasonCategory": "usageTrusted", - "updated": "2021-06-17T20:46:02.342Z", - "reasonDetail": "Doesn't reference the DOM." - }, { "rule": "React-useRef", "path": "ts/components/GroupCallRemoteParticipant.tsx", @@ -13397,20 +13231,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/Inbox.js", - "line": " const hostRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-06-08T02:49:25.154Z" - }, - { - "rule": "React-useRef", - "path": "ts/components/Inbox.js", - "line": " const viewRef = react_1.useRef(undefined);", - "reasonCategory": "usageTrusted", - "updated": "2021-06-08T02:49:25.154Z" - }, { "rule": "React-useRef", "path": "ts/components/Inbox.tsx", @@ -13425,14 +13245,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/IncomingCallBar.js", - "line": " const initialTitleRef = react_1.useRef(title);", - "reasonCategory": "usageTrusted", - "updated": "2021-08-16T20:52:11.043Z", - "reasonDetail": "Doesn't interact with the DOM." - }, { "rule": "React-useRef", "path": "ts/components/IncomingCallBar.tsx", @@ -13441,27 +13253,6 @@ "updated": "2021-08-16T20:52:11.043Z", "reasonDetail": "Doesn't interact with the DOM." }, - { - "rule": "React-useRef", - "path": "ts/components/Input.js", - "line": " const innerRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-07-14T00:50:58.330Z" - }, - { - "rule": "React-useRef", - "path": "ts/components/Input.js", - "line": " const valueOnKeydownRef = react_1.useRef(value);", - "reasonCategory": "usageTrusted", - "updated": "2021-07-14T00:50:58.330Z" - }, - { - "rule": "React-useRef", - "path": "ts/components/Input.js", - "line": " const selectionStartOnKeydownRef = react_1.useRef(value.length);", - "reasonCategory": "usageTrusted", - "updated": "2021-07-14T00:50:58.330Z" - }, { "rule": "React-useRef", "path": "ts/components/Input.tsx", @@ -13497,20 +13288,6 @@ "reasonCategory": "falseMatch", "updated": "2020-07-21T18:34:59.251Z" }, - { - "rule": "React-useRef", - "path": "ts/components/Lightbox.js", - "line": " const containerRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-08-23T18:39:37.081Z" - }, - { - "rule": "React-useRef", - "path": "ts/components/Lightbox.js", - "line": " const focusRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-08-23T18:39:37.081Z" - }, { "rule": "React-useRef", "path": "ts/components/Lightbox.tsx", @@ -13541,13 +13318,6 @@ "updated": "2020-02-14T20:02:37.507Z", "reasonDetail": "Used only to set focus" }, - { - "rule": "React-useRef", - "path": "ts/components/Modal.js", - "line": " const modalRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-08-05T00:22:31.660Z" - }, { "rule": "React-useRef", "path": "ts/components/Modal.tsx", @@ -13555,13 +13325,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-08-05T00:22:31.660Z" }, - { - "rule": "React-useRef", - "path": "ts/components/ProfileEditor.js", - "line": " const focusInputRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-07-14T00:50:58.330Z" - }, { "rule": "React-useRef", "path": "ts/components/ProfileEditor.tsx", @@ -13577,27 +13340,6 @@ "updated": "2020-06-23T06:48:06.829Z", "reasonDetail": "Used to focus cancel button when dialog opens" }, - { - "rule": "React-useRef", - "path": "ts/components/Slider.js", - "line": " const diff = react_1.useRef(0);", - "reasonCategory": "usageTrusted", - "updated": "2021-05-25T18:25:53.896Z" - }, - { - "rule": "React-useRef", - "path": "ts/components/Slider.js", - "line": " const handleRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-05-25T18:25:53.896Z" - }, - { - "rule": "React-useRef", - "path": "ts/components/Slider.js", - "line": " const sliderRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-05-25T18:25:53.896Z" - }, { "rule": "React-useRef", "path": "ts/components/Slider.tsx", @@ -13634,20 +13376,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/conversation/ContactModal.js", - "line": " const overlayRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-08-03T21:17:38.615Z" - }, - { - "rule": "React-useRef", - "path": "ts/components/conversation/ContactModal.js", - "line": " const closeButtonRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-08-03T21:17:38.615Z" - }, { "rule": "React-useRef", "path": "ts/components/conversation/ContactModal.tsx", @@ -13678,14 +13406,6 @@ "updated": "2020-05-20T20:10:43.540Z", "reasonDetail": "Used to reference popup menu" }, - { - "rule": "React-useRef", - "path": "ts/components/conversation/ConversationHero.js", - "line": " const firstRenderRef = react_1.useRef(true);", - "reasonCategory": "falseMatch", - "updated": "2020-10-26T19:12:24.410Z", - "reasonDetail": "Doesn't refer to a DOM element." - }, { "rule": "React-useRef", "path": "ts/components/conversation/ConversationHero.tsx", @@ -13694,14 +13414,6 @@ "updated": "2020-10-26T19:12:24.410Z", "reasonDetail": "Doesn't refer to a DOM element." }, - { - "rule": "React-useRef", - "path": "ts/components/conversation/GIF.js", - "line": " const videoRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-04-17T01:47:31.419Z", - "reasonDetail": "Used for managing playback of GIF video" - }, { "rule": "React-useRef", "path": "ts/components/conversation/GIF.tsx", @@ -13709,13 +13421,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/conversation/GroupDescription.js", - "line": " const textRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-05-29T02:15:39.186Z" - }, { "rule": "React-useRef", "path": "ts/components/conversation/GroupDescription.tsx", @@ -13787,14 +13492,6 @@ "updated": "2021-03-05T19:57:01.431Z", "reasonDetail": "Used for propagating click from the Message to MessageAudio's button" }, - { - "rule": "React-useRef", - "path": "ts/components/conversation/MessageAudio.js", - "line": " const waveformRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-03-09T01:19:04.057Z", - "reasonDetail": "Used for obtanining the bounding box for the container" - }, { "rule": "React-useRef", "path": "ts/components/conversation/MessageAudio.tsx", @@ -13818,14 +13515,6 @@ "updated": "2021-08-20T16:48:00.885Z", "reasonDetail": "Needed to confine Poppers. We don't actually manipulate this DOM reference." }, - { - "rule": "React-useRef", - "path": "ts/components/conversation/Quote.js", - "line": " const imageRef = react_1.useRef(new Image());", - "reasonCategory": "usageTrusted", - "updated": "2021-01-20T21:30:08.430Z", - "reasonDetail": "Doesn't touch the DOM." - }, { "rule": "React-useRef", "path": "ts/components/conversation/Quote.tsx", @@ -13850,14 +13539,6 @@ "updated": "2021-08-20T16:48:00.885Z", "reasonDetail": "Needed to confine Poppers. We don't actually manipulate this DOM reference." }, - { - "rule": "React-useRef", - "path": "ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.js", - "line": " const inputRef = react_1.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2021-03-11T20:49:17.292Z", - "reasonDetail": "Used to focus an input." - }, { "rule": "React-useRef", "path": "ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx", @@ -13865,30 +13546,6 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, - { - "rule": "React-useRef", - "path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.js", - "line": " const startingTitleRef = react_1.useRef(externalTitle);", - "reasonCategory": "usageTrusted", - "updated": "2021-03-05T22:52:40.572Z", - "reasonDetail": "Doesn't interact with the DOM." - }, - { - "rule": "React-useRef", - "path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.js", - "line": " const startingAvatarPathRef = react_1.useRef(externalAvatarPath);", - "reasonCategory": "usageTrusted", - "updated": "2021-03-05T22:52:40.572Z", - "reasonDetail": "Doesn't interact with the DOM." - }, - { - "rule": "React-useRef", - "path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.js", - "line": " const focusDescriptionRef = react_1.useRef(initiallyFocusDescription);", - "reasonCategory": "usageTrusted", - "updated": "2021-06-04T14:19:49.714Z", - "reasonDetail": "Only stores undefined/true/false, not DOM references." - }, { "rule": "React-useRef", "path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx", @@ -14273,4 +13930,4 @@ "reasonCategory": "usageTrusted", "updated": "2021-07-22T03:00:34.561Z" } -] +] \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 2fe87607fd..b7addd5f14 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,6 +27,9 @@ // Strict Type-Checking Options "strict": true, // Enable all strict type-checking options. + // As a temporary measure + "useUnknownInCatchVariables": false, + // Additional Checks "noUnusedLocals": true, // Report errors on unused locals. "noUnusedParameters": true, // Report errors on unused parameters. diff --git a/yarn.lock b/yarn.lock index 9077d8497f..42e176571f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17957,10 +17957,10 @@ typescript@3.8.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061" integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== -typescript@4.3.5: - version "4.3.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4" - integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA== +typescript@4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86" + integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ== ua-parser-js@^0.7.18: version "0.7.28"