From 027b3660bb391d84e142c8681fce0cd13d40d260 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Fri, 22 Oct 2021 17:49:09 -0500 Subject: [PATCH] Manual fixes Signed-off-by: Aaron Raimist --- .eslintrc.js | 2 -- src/CallHandler.tsx | 10 +++++++++- src/components/structures/MatrixChat.tsx | 4 +--- src/components/views/right_panel/EncryptionPanel.tsx | 6 +++++- src/languageHandler.tsx | 1 - src/stores/SetupEncryptionStore.ts | 5 ++++- src/stores/UIStore.ts | 2 +- test/components/views/rooms/RoomHeader-test.tsx | 4 +--- test/utils/export-test.tsx | 3 +-- 9 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 94e19c8eea..20c8269e5e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -44,8 +44,6 @@ module.exports = { }, ], "import/first": "error", - "import/newline-after-import": "error", - "import/no-duplicates": "error", }, overrides: [{ files: [ diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index 9c583544b0..316b76d594 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -56,7 +56,15 @@ limitations under the License. import React from 'react'; import { base32 } from "rfc4648"; -import { MatrixCall, CallErrorCode, CallState, CallEvent, CallParty, CallType, CallError } from "matrix-js-sdk/src/webrtc/call"; +import { + MatrixCall, + CallErrorCode, + CallState, + CallEvent, + CallParty, + CallType, + CallError, +} from "matrix-js-sdk/src/webrtc/call"; import { logger } from 'matrix-js-sdk/src/logger'; import { randomUppercaseString, randomLowercaseString } from "matrix-js-sdk/src/randomstring"; import EventEmitter from 'events'; diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 866245042f..2a0d068dcc 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -20,6 +20,7 @@ import { InvalidStoreError } from "matrix-js-sdk/src/errors"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { sleep, defer, IDeferred, QueryDict } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; // focus-visible is a Polyfill for the :focus-visible CSS pseudo-attribute used by _AccessibleButton.scss import 'focus-visible'; @@ -106,9 +107,6 @@ import { makeRoomPermalink } from "../../utils/permalinks/Permalinks"; import { copyPlaintext } from "../../utils/strings"; import { PosthogAnalytics } from '../../PosthogAnalytics'; import { initSentry } from "../../sentry"; - -import { logger } from "matrix-js-sdk/src/logger"; - import { showSpaceInvite } from "../../utils/space"; /** constants for MatrixChat.state.view */ diff --git a/src/components/views/right_panel/EncryptionPanel.tsx b/src/components/views/right_panel/EncryptionPanel.tsx index d26cbbce4d..12b7cbf598 100644 --- a/src/components/views/right_panel/EncryptionPanel.tsx +++ b/src/components/views/right_panel/EncryptionPanel.tsx @@ -15,7 +15,11 @@ limitations under the License. */ import React, { useCallback, useEffect, useState } from "react"; -import { VerificationRequest, PHASE_REQUESTED, PHASE_UNSENT } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { + VerificationRequest, + PHASE_REQUESTED, + PHASE_UNSENT, +} from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { User } from "matrix-js-sdk/src/models/user"; diff --git a/src/languageHandler.tsx b/src/languageHandler.tsx index 15539eced4..5b3878866b 100644 --- a/src/languageHandler.tsx +++ b/src/languageHandler.tsx @@ -24,7 +24,6 @@ import { logger } from "matrix-js-sdk/src/logger"; import SettingsStore from "./settings/SettingsStore"; import PlatformPeg from "./PlatformPeg"; - // @ts-ignore - $webapp is a webpack resolve alias pointing to the output directory, see webpack config import { SettingLevel } from "./settings/SettingLevel"; import { retry } from "./utils/promise"; diff --git a/src/stores/SetupEncryptionStore.ts b/src/stores/SetupEncryptionStore.ts index cfd69d3365..5af39356e7 100644 --- a/src/stores/SetupEncryptionStore.ts +++ b/src/stores/SetupEncryptionStore.ts @@ -15,7 +15,10 @@ limitations under the License. */ import EventEmitter from 'events'; -import { VerificationRequest, PHASE_DONE as VERIF_PHASE_DONE } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { + VerificationRequest, + PHASE_DONE as VERIF_PHASE_DONE, +} from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; import { ISecretStorageKeyInfo } from "matrix-js-sdk/src/crypto/api"; import { logger } from "matrix-js-sdk/src/logger"; diff --git a/src/stores/UIStore.ts b/src/stores/UIStore.ts index 99446da49a..7b40ba44f7 100644 --- a/src/stores/UIStore.ts +++ b/src/stores/UIStore.ts @@ -21,7 +21,7 @@ import ResizeObserverEntry from 'resize-observer-polyfill/src/ResizeObserverEntr // own DOM types: https://github.com/que-etc/resize-observer-polyfill/issues/80 // Using require here rather than import is a horrenous workaround. We should // be able to remove the polyfill once Safari 14 is released. -const ResizeObserverPolyfill = require('resize-observer-polyfill'); +const ResizeObserverPolyfill = require('resize-observer-polyfill'); // eslint-disable-line @typescript-eslint/no-var-requires export enum UI_EVENTS { Resize = "resize" diff --git a/test/components/views/rooms/RoomHeader-test.tsx b/test/components/views/rooms/RoomHeader-test.tsx index 83af58aa4c..33983df7e4 100644 --- a/test/components/views/rooms/RoomHeader-test.tsx +++ b/test/components/views/rooms/RoomHeader-test.tsx @@ -1,10 +1,8 @@ import React from 'react'; import ReactDOM from 'react-dom'; - -import "../../../skinned-sdk"; - import { Room, PendingEventOrdering, MatrixEvent, MatrixClient } from 'matrix-js-sdk'; +import "../../../skinned-sdk"; import * as TestUtils from '../../../test-utils'; import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import DMRoomMap from '../../../../src/utils/DMRoomMap'; diff --git a/test/utils/export-test.tsx b/test/utils/export-test.tsx index 90d44c08e3..1ce463fdbd 100644 --- a/test/utils/export-test.tsx +++ b/test/utils/export-test.tsx @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { renderToString } from "react-dom/server"; import { IContent, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk"; import { MatrixClientPeg } from "../../src/MatrixClientPeg"; @@ -24,8 +25,6 @@ import HTMLExporter from "../../src/utils/exportUtils/HtmlExport"; import * as TestUtilsMatrix from '../test-utils'; import { stubClient } from '../test-utils'; -import { renderToString } from "react-dom/server"; - let client: MatrixClient; const MY_USER_ID = "@me:here";