diff --git a/package.json b/package.json index 3415cb69aa..5a24fb0ede 100644 --- a/package.json +++ b/package.json @@ -178,9 +178,10 @@ "enzyme-to-json": "^3.6.2", "eslint": "8.9.0", "eslint-config-google": "^0.14.0", + "eslint-plugin-deprecate": "^0.7.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jsx-a11y": "^6.5.1", - "eslint-plugin-matrix-org": "^0.5.2", + "eslint-plugin-matrix-org": "^0.6.1", "eslint-plugin-react": "^7.28.0", "eslint-plugin-react-hooks": "^4.3.0", "fs-extra": "^10.0.1", diff --git a/test/HtmlUtils-test.tsx b/test/HtmlUtils-test.tsx index de862b407a..f35d5548b4 100644 --- a/test/HtmlUtils-test.tsx +++ b/test/HtmlUtils-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { mocked } from 'jest-mock'; diff --git a/test/accessibility/RovingTabIndex-test.tsx b/test/accessibility/RovingTabIndex-test.tsx index fc1c48f041..708fc3c928 100644 --- a/test/accessibility/RovingTabIndex-test.tsx +++ b/test/accessibility/RovingTabIndex-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from "react"; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { diff --git a/test/components/structures/RightPanel-test.tsx b/test/components/structures/RightPanel-test.tsx index 17e952e7fb..1d3278774f 100644 --- a/test/components/structures/RightPanel-test.tsx +++ b/test/components/structures/RightPanel-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { jest } from "@jest/globals"; import { mocked, MockedObject } from "jest-mock"; diff --git a/test/components/structures/RoomView-test.tsx b/test/components/structures/RoomView-test.tsx index 3b529ec700..0a34e07e61 100644 --- a/test/components/structures/RoomView-test.tsx +++ b/test/components/structures/RoomView-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { act } from "react-dom/test-utils"; import { mocked, MockedObject } from "jest-mock"; diff --git a/test/components/structures/ThreadPanel-test.tsx b/test/components/structures/ThreadPanel-test.tsx index 6a2a65a9ee..37928c560d 100644 --- a/test/components/structures/ThreadPanel-test.tsx +++ b/test/components/structures/ThreadPanel-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { shallow, mount } from "enzyme"; import 'focus-visible'; // to fix context menus diff --git a/test/components/structures/TimelinePanel-test.tsx b/test/components/structures/TimelinePanel-test.tsx index ab3e2de25f..3331bc5934 100644 --- a/test/components/structures/TimelinePanel-test.tsx +++ b/test/components/structures/TimelinePanel-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { MessageEvent } from 'matrix-events-sdk'; import { EventTimelineSet, MatrixEvent, PendingEventOrdering, Room } from 'matrix-js-sdk/src/matrix'; diff --git a/test/components/structures/VideoRoomView-test.tsx b/test/components/structures/VideoRoomView-test.tsx index f14a8d8019..ff5368a84f 100644 --- a/test/components/structures/VideoRoomView-test.tsx +++ b/test/components/structures/VideoRoomView-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { act } from "react-dom/test-utils"; import { mocked } from "jest-mock"; diff --git a/test/components/views/audio_messages/RecordingPlayback-test.tsx b/test/components/views/audio_messages/RecordingPlayback-test.tsx index 3dd577f7ff..148829b6a3 100644 --- a/test/components/views/audio_messages/RecordingPlayback-test.tsx +++ b/test/components/views/audio_messages/RecordingPlayback-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { mocked } from 'jest-mock'; import { logger } from 'matrix-js-sdk/src/logger'; diff --git a/test/components/views/beacon/BeaconListItem-test.tsx b/test/components/views/beacon/BeaconListItem-test.tsx index 238a1dd041..d95deed045 100644 --- a/test/components/views/beacon/BeaconListItem-test.tsx +++ b/test/components/views/beacon/BeaconListItem-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { Beacon, diff --git a/test/components/views/beacon/BeaconMarker-test.tsx b/test/components/views/beacon/BeaconMarker-test.tsx index efc9c7d22c..2c0ed7bb78 100644 --- a/test/components/views/beacon/BeaconMarker-test.tsx +++ b/test/components/views/beacon/BeaconMarker-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import maplibregl from 'maplibre-gl'; import { act } from 'react-dom/test-utils'; diff --git a/test/components/views/beacon/BeaconStatus-test.tsx b/test/components/views/beacon/BeaconStatus-test.tsx index 68a6a34a30..b90cecc5d5 100644 --- a/test/components/views/beacon/BeaconStatus-test.tsx +++ b/test/components/views/beacon/BeaconStatus-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { Beacon } from 'matrix-js-sdk/src/matrix'; diff --git a/test/components/views/beacon/BeaconViewDialog-test.tsx b/test/components/views/beacon/BeaconViewDialog-test.tsx index e5c8535eef..13e3875dc8 100644 --- a/test/components/views/beacon/BeaconViewDialog-test.tsx +++ b/test/components/views/beacon/BeaconViewDialog-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { diff --git a/test/components/views/beacon/LeftPanelLiveShareWarning-test.tsx b/test/components/views/beacon/LeftPanelLiveShareWarning-test.tsx index aeef98c259..0369fa5cc1 100644 --- a/test/components/views/beacon/LeftPanelLiveShareWarning-test.tsx +++ b/test/components/views/beacon/LeftPanelLiveShareWarning-test.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import { mocked } from 'jest-mock'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { Beacon, BeaconIdentifier } from 'matrix-js-sdk/src/matrix'; diff --git a/test/components/views/beacon/OwnBeaconStatus-test.tsx b/test/components/views/beacon/OwnBeaconStatus-test.tsx index 57f3f98b82..57cbf55bd5 100644 --- a/test/components/views/beacon/OwnBeaconStatus-test.tsx +++ b/test/components/views/beacon/OwnBeaconStatus-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { mocked } from 'jest-mock'; diff --git a/test/components/views/beacon/RoomLiveShareWarning-test.tsx b/test/components/views/beacon/RoomLiveShareWarning-test.tsx index 535c046b99..35e9a4e5a8 100644 --- a/test/components/views/beacon/RoomLiveShareWarning-test.tsx +++ b/test/components/views/beacon/RoomLiveShareWarning-test.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import { act } from 'react-dom/test-utils'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { Room, Beacon, BeaconEvent, getBeaconInfoIdentifier } from 'matrix-js-sdk/src/matrix'; import { logger } from 'matrix-js-sdk/src/logger'; diff --git a/test/components/views/beacon/ShareLatestLocation-test.tsx b/test/components/views/beacon/ShareLatestLocation-test.tsx index 28d36bc977..767c712042 100644 --- a/test/components/views/beacon/ShareLatestLocation-test.tsx +++ b/test/components/views/beacon/ShareLatestLocation-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; diff --git a/test/components/views/beacon/StyledLiveBeaconIcon-test.tsx b/test/components/views/beacon/StyledLiveBeaconIcon-test.tsx index f239a26470..d6be878a25 100644 --- a/test/components/views/beacon/StyledLiveBeaconIcon-test.tsx +++ b/test/components/views/beacon/StyledLiveBeaconIcon-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import StyledLiveBeaconIcon from '../../../../src/components/views/beacon/StyledLiveBeaconIcon'; diff --git a/test/components/views/context_menus/ContextMenu-test.tsx b/test/components/views/context_menus/ContextMenu-test.tsx index 46dbbe31fe..70ee4b95f4 100644 --- a/test/components/views/context_menus/ContextMenu-test.tsx +++ b/test/components/views/context_menus/ContextMenu-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import ContextMenu, { ChevronFace } from "../../../../src/components/structures/ContextMenu"; diff --git a/test/components/views/context_menus/MessageContextMenu-test.tsx b/test/components/views/context_menus/MessageContextMenu-test.tsx index 72d5ebb5eb..38c646cfe8 100644 --- a/test/components/views/context_menus/MessageContextMenu-test.tsx +++ b/test/components/views/context_menus/MessageContextMenu-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from 'enzyme'; import { EventStatus, MatrixEvent } from 'matrix-js-sdk/src/models/event'; import { Room } from 'matrix-js-sdk/src/models/room'; diff --git a/test/components/views/context_menus/SpaceContextMenu-test.tsx b/test/components/views/context_menus/SpaceContextMenu-test.tsx index 4dff077f0f..9ab6ca11ff 100644 --- a/test/components/views/context_menus/SpaceContextMenu-test.tsx +++ b/test/components/views/context_menus/SpaceContextMenu-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { Room } from 'matrix-js-sdk/src/matrix'; import { mocked } from 'jest-mock'; diff --git a/test/components/views/dialogs/AccessSecretStorageDialog-test.tsx b/test/components/views/dialogs/AccessSecretStorageDialog-test.tsx index 1376c18c3b..5503db537b 100644 --- a/test/components/views/dialogs/AccessSecretStorageDialog-test.tsx +++ b/test/components/views/dialogs/AccessSecretStorageDialog-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { IPassphraseInfo } from 'matrix-js-sdk/src/crypto/api'; diff --git a/test/components/views/dialogs/ExportDialog-test.tsx b/test/components/views/dialogs/ExportDialog-test.tsx index a23c719717..c6ddda04ff 100644 --- a/test/components/views/dialogs/ExportDialog-test.tsx +++ b/test/components/views/dialogs/ExportDialog-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { mocked } from 'jest-mock'; import { act } from "react-dom/test-utils"; diff --git a/test/components/views/dialogs/ForwardDialog-test.tsx b/test/components/views/dialogs/ForwardDialog-test.tsx index fbb7f0cd84..16f2415af8 100644 --- a/test/components/views/dialogs/ForwardDialog-test.tsx +++ b/test/components/views/dialogs/ForwardDialog-test.tsx @@ -15,10 +15,10 @@ limitations under the License. */ import React from "react"; -import { mount } from "enzyme"; +// eslint-disable-next-line deprecate/import +import { mount, ReactWrapper } from "enzyme"; import { act } from "react-dom/test-utils"; import { MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; -import { ReactWrapper } from "enzyme"; import { LocationAssetType, M_ASSET, M_LOCATION, M_TIMESTAMP } from "matrix-js-sdk/src/@types/location"; import { TEXT_NODE_TYPE } from "matrix-js-sdk/src/@types/extensible_events"; diff --git a/test/components/views/dialogs/InteractiveAuthDialog-test.tsx b/test/components/views/dialogs/InteractiveAuthDialog-test.tsx index 787dbd2cd5..e464e4c87d 100644 --- a/test/components/views/dialogs/InteractiveAuthDialog-test.tsx +++ b/test/components/views/dialogs/InteractiveAuthDialog-test.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { act } from 'react-dom/test-utils'; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from 'enzyme'; import InteractiveAuthDialog from "../../../../src/components/views/dialogs/InteractiveAuthDialog"; diff --git a/test/components/views/dialogs/SpotlightDialog-test.tsx b/test/components/views/dialogs/SpotlightDialog-test.tsx index c2445139a7..dcecb95c24 100644 --- a/test/components/views/dialogs/SpotlightDialog-test.tsx +++ b/test/components/views/dialogs/SpotlightDialog-test.tsx @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { mocked } from "jest-mock"; import { IProtocol, IPublicRoomsChunkRoom, MatrixClient, Room, RoomMember } from "matrix-js-sdk/src/matrix"; diff --git a/test/components/views/elements/AccessibleButton-test.tsx b/test/components/views/elements/AccessibleButton-test.tsx index 89385dd057..5ec65ff044 100644 --- a/test/components/views/elements/AccessibleButton-test.tsx +++ b/test/components/views/elements/AccessibleButton-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; diff --git a/test/components/views/elements/AppTile-test.tsx b/test/components/views/elements/AppTile-test.tsx index d528f52a9e..f88e52f772 100644 --- a/test/components/views/elements/AppTile-test.tsx +++ b/test/components/views/elements/AppTile-test.tsx @@ -19,6 +19,7 @@ import TestRenderer from "react-test-renderer"; import { jest } from "@jest/globals"; import { Room } from "matrix-js-sdk/src/models/room"; import { ClientWidgetApi, MatrixWidgetType } from "matrix-widget-api"; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { Optional } from "matrix-events-sdk"; diff --git a/test/components/views/elements/EventListSummary-test.tsx b/test/components/views/elements/EventListSummary-test.tsx index 0a1102e86f..fa6410dc65 100644 --- a/test/components/views/elements/EventListSummary-test.tsx +++ b/test/components/views/elements/EventListSummary-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from 'enzyme'; import { MatrixEvent, RoomMember } from 'matrix-js-sdk/src/matrix'; diff --git a/test/components/views/elements/LabelledCheckbox-test.tsx b/test/components/views/elements/LabelledCheckbox-test.tsx index b03ee0c1f1..a908a15dda 100644 --- a/test/components/views/elements/LabelledCheckbox-test.tsx +++ b/test/components/views/elements/LabelledCheckbox-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { act } from "react-dom/test-utils"; diff --git a/test/components/views/elements/Linkify-test.tsx b/test/components/views/elements/Linkify-test.tsx index f663d4c927..14a3b81b21 100644 --- a/test/components/views/elements/Linkify-test.tsx +++ b/test/components/views/elements/Linkify-test.tsx @@ -13,6 +13,7 @@ limitations under the License. */ import React, { useState } from "react"; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { Linkify } from "../../../../src/components/views/elements/Linkify"; diff --git a/test/components/views/elements/PollCreateDialog-test.tsx b/test/components/views/elements/PollCreateDialog-test.tsx index 41d2591b64..1efb988409 100644 --- a/test/components/views/elements/PollCreateDialog-test.tsx +++ b/test/components/views/elements/PollCreateDialog-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { Room } from "matrix-js-sdk/src/models/room"; import { diff --git a/test/components/views/elements/StyledRadioGroup-test.tsx b/test/components/views/elements/StyledRadioGroup-test.tsx index d567be3394..3fa5dd9c53 100644 --- a/test/components/views/elements/StyledRadioGroup-test.tsx +++ b/test/components/views/elements/StyledRadioGroup-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { act } from "react-dom/test-utils"; diff --git a/test/components/views/location/LiveDurationDropdown-test.tsx b/test/components/views/location/LiveDurationDropdown-test.tsx index b07b9b9d22..60bd7c7706 100644 --- a/test/components/views/location/LiveDurationDropdown-test.tsx +++ b/test/components/views/location/LiveDurationDropdown-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; diff --git a/test/components/views/location/LocationPicker-test.tsx b/test/components/views/location/LocationPicker-test.tsx index 02fb29dc71..39b0b3b42e 100644 --- a/test/components/views/location/LocationPicker-test.tsx +++ b/test/components/views/location/LocationPicker-test.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import maplibregl from "maplibre-gl"; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { act } from 'react-dom/test-utils'; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; diff --git a/test/components/views/location/LocationShareMenu-test.tsx b/test/components/views/location/LocationShareMenu-test.tsx index 221bbb1917..e25fab3ade 100644 --- a/test/components/views/location/LocationShareMenu-test.tsx +++ b/test/components/views/location/LocationShareMenu-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from 'enzyme'; import { mocked } from 'jest-mock'; import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; diff --git a/test/components/views/location/LocationViewDialog-test.tsx b/test/components/views/location/LocationViewDialog-test.tsx index af270c5f97..04b08c9af6 100644 --- a/test/components/views/location/LocationViewDialog-test.tsx +++ b/test/components/views/location/LocationViewDialog-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { RoomMember } from 'matrix-js-sdk/src/matrix'; import { LocationAssetType } from 'matrix-js-sdk/src/@types/location'; diff --git a/test/components/views/location/Map-test.tsx b/test/components/views/location/Map-test.tsx index dc349793c6..0e22d1cdd8 100644 --- a/test/components/views/location/Map-test.tsx +++ b/test/components/views/location/Map-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; import maplibregl from 'maplibre-gl'; diff --git a/test/components/views/location/Marker-test.tsx b/test/components/views/location/Marker-test.tsx index da9ccaf0d6..767f1097bd 100644 --- a/test/components/views/location/Marker-test.tsx +++ b/test/components/views/location/Marker-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { RoomMember } from 'matrix-js-sdk/src/matrix'; diff --git a/test/components/views/location/SmartMarker-test.tsx b/test/components/views/location/SmartMarker-test.tsx index 5fc48085b4..3f617bcb5d 100644 --- a/test/components/views/location/SmartMarker-test.tsx +++ b/test/components/views/location/SmartMarker-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { mocked } from 'jest-mock'; import maplibregl from 'maplibre-gl'; diff --git a/test/components/views/location/ZoomButtons-test.tsx b/test/components/views/location/ZoomButtons-test.tsx index 62f488f43c..1192b6aed0 100644 --- a/test/components/views/location/ZoomButtons-test.tsx +++ b/test/components/views/location/ZoomButtons-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import maplibregl from 'maplibre-gl'; import { act } from 'react-dom/test-utils'; diff --git a/test/components/views/messages/DateSeparator-test.tsx b/test/components/views/messages/DateSeparator-test.tsx index abd809ac95..772942e080 100644 --- a/test/components/views/messages/DateSeparator-test.tsx +++ b/test/components/views/messages/DateSeparator-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { mocked } from "jest-mock"; diff --git a/test/components/views/messages/MBeaconBody-test.tsx b/test/components/views/messages/MBeaconBody-test.tsx index 6a564dfdc4..dbfa1f39d1 100644 --- a/test/components/views/messages/MBeaconBody-test.tsx +++ b/test/components/views/messages/MBeaconBody-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; import maplibregl from 'maplibre-gl'; diff --git a/test/components/views/messages/MLocationBody-test.tsx b/test/components/views/messages/MLocationBody-test.tsx index 81d5daaa8b..857926dd06 100644 --- a/test/components/views/messages/MLocationBody-test.tsx +++ b/test/components/views/messages/MLocationBody-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { LocationAssetType } from "matrix-js-sdk/src/@types/location"; import { ClientEvent, RoomMember } from 'matrix-js-sdk/src/matrix'; diff --git a/test/components/views/messages/MPollBody-test.tsx b/test/components/views/messages/MPollBody-test.tsx index 5fa55cd46f..e462584098 100644 --- a/test/components/views/messages/MPollBody-test.tsx +++ b/test/components/views/messages/MPollBody-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import { Relations } from "matrix-js-sdk/src/models/relations"; diff --git a/test/components/views/messages/MVideoBody-test.tsx b/test/components/views/messages/MVideoBody-test.tsx index 09d93f4d4a..42f804c1bc 100644 --- a/test/components/views/messages/MVideoBody-test.tsx +++ b/test/components/views/messages/MVideoBody-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { MatrixEvent } from 'matrix-js-sdk/src/matrix'; diff --git a/test/components/views/messages/TextualBody-test.tsx b/test/components/views/messages/TextualBody-test.tsx index d4b1b2aead..f07fce014a 100644 --- a/test/components/views/messages/TextualBody-test.tsx +++ b/test/components/views/messages/TextualBody-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { MatrixClient } from "matrix-js-sdk/src/matrix"; import { MockedObject } from "jest-mock"; diff --git a/test/components/views/right_panel/PinnedMessagesCard-test.tsx b/test/components/views/right_panel/PinnedMessagesCard-test.tsx index 23bdc2c7ff..0d5fc9f4ff 100644 --- a/test/components/views/right_panel/PinnedMessagesCard-test.tsx +++ b/test/components/views/right_panel/PinnedMessagesCard-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ComponentProps } from "react"; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { mocked } from "jest-mock"; import { act } from "react-dom/test-utils"; diff --git a/test/components/views/right_panel/UserInfo-test.tsx b/test/components/views/right_panel/UserInfo-test.tsx index 41c9debf40..6ec36cb096 100644 --- a/test/components/views/right_panel/UserInfo-test.tsx +++ b/test/components/views/right_panel/UserInfo-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { mocked } from 'jest-mock'; import { act } from "react-dom/test-utils"; diff --git a/test/components/views/rooms/BasicMessageComposer-test.tsx b/test/components/views/rooms/BasicMessageComposer-test.tsx index 838119492a..4f759db93f 100644 --- a/test/components/views/rooms/BasicMessageComposer-test.tsx +++ b/test/components/views/rooms/BasicMessageComposer-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from 'enzyme'; import { MatrixClient, Room } from 'matrix-js-sdk/src/matrix'; diff --git a/test/components/views/rooms/MessageComposer-test.tsx b/test/components/views/rooms/MessageComposer-test.tsx index e756a7653c..6bbb3cc2af 100644 --- a/test/components/views/rooms/MessageComposer-test.tsx +++ b/test/components/views/rooms/MessageComposer-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from "react"; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; diff --git a/test/components/views/rooms/MessageComposerButtons-test.tsx b/test/components/views/rooms/MessageComposerButtons-test.tsx index f0e736c032..6666a03f1f 100644 --- a/test/components/views/rooms/MessageComposerButtons-test.tsx +++ b/test/components/views/rooms/MessageComposerButtons-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { Room } from "matrix-js-sdk/src/models/room"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; diff --git a/test/components/views/rooms/RoomHeader-test.tsx b/test/components/views/rooms/RoomHeader-test.tsx index 31b6e818f3..baaf85eb44 100644 --- a/test/components/views/rooms/RoomHeader-test.tsx +++ b/test/components/views/rooms/RoomHeader-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from 'enzyme'; import { Room, PendingEventOrdering, MatrixEvent, MatrixClient } from 'matrix-js-sdk/src/matrix'; diff --git a/test/components/views/rooms/RoomListHeader-test.tsx b/test/components/views/rooms/RoomListHeader-test.tsx index 1baabebbb8..56ff7f5635 100644 --- a/test/components/views/rooms/RoomListHeader-test.tsx +++ b/test/components/views/rooms/RoomListHeader-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { MatrixClient } from 'matrix-js-sdk/src/client'; import { act } from "react-dom/test-utils"; diff --git a/test/components/views/rooms/RoomTile-test.tsx b/test/components/views/rooms/RoomTile-test.tsx index d5cb86443a..29c8b53324 100644 --- a/test/components/views/rooms/RoomTile-test.tsx +++ b/test/components/views/rooms/RoomTile-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { act } from "react-dom/test-utils"; import { mocked } from "jest-mock"; diff --git a/test/components/views/rooms/SearchBar-test.tsx b/test/components/views/rooms/SearchBar-test.tsx index d1a62ba688..fd17d6bbeb 100644 --- a/test/components/views/rooms/SearchBar-test.tsx +++ b/test/components/views/rooms/SearchBar-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import SearchWarning from "../../../../src/components/views/elements/SearchWarning"; diff --git a/test/components/views/rooms/SearchResultTile-test.tsx b/test/components/views/rooms/SearchResultTile-test.tsx index 9f0e2d8576..d2ddfb1a13 100644 --- a/test/components/views/rooms/SearchResultTile-test.tsx +++ b/test/components/views/rooms/SearchResultTile-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from "react"; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { SearchResult } from "matrix-js-sdk/src/models/search-result"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; diff --git a/test/components/views/rooms/SendMessageComposer-test.tsx b/test/components/views/rooms/SendMessageComposer-test.tsx index c46a76852e..cb10032720 100644 --- a/test/components/views/rooms/SendMessageComposer-test.tsx +++ b/test/components/views/rooms/SendMessageComposer-test.tsx @@ -18,6 +18,7 @@ import React from "react"; import { act } from "react-dom/test-utils"; import { sleep } from "matrix-js-sdk/src/utils"; import { ISendEventResponse, MatrixClient, MsgType } from "matrix-js-sdk/src/matrix"; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { mocked } from "jest-mock"; diff --git a/test/components/views/rooms/VoiceRecordComposerTile-test.tsx b/test/components/views/rooms/VoiceRecordComposerTile-test.tsx index a1645db097..88cd97a2d5 100644 --- a/test/components/views/rooms/VoiceRecordComposerTile-test.tsx +++ b/test/components/views/rooms/VoiceRecordComposerTile-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { ISendEventResponse, MatrixClient, MsgType, Room } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; diff --git a/test/components/views/settings/FontScalingPanel-test.tsx b/test/components/views/settings/FontScalingPanel-test.tsx index f18830b348..119a26ebc1 100644 --- a/test/components/views/settings/FontScalingPanel-test.tsx +++ b/test/components/views/settings/FontScalingPanel-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import * as TestUtils from "../../../test-utils"; diff --git a/test/components/views/settings/KeyboardShortcut-test.tsx b/test/components/views/settings/KeyboardShortcut-test.tsx index 0163544f52..5fcb65ddba 100644 --- a/test/components/views/settings/KeyboardShortcut-test.tsx +++ b/test/components/views/settings/KeyboardShortcut-test.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { Key } from "../../../../src/Keyboard"; diff --git a/test/components/views/settings/Notifications-test.tsx b/test/components/views/settings/Notifications-test.tsx index ab1f7aa6f0..1cbbb13439 100644 --- a/test/components/views/settings/Notifications-test.tsx +++ b/test/components/views/settings/Notifications-test.tsx @@ -13,6 +13,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from 'enzyme'; import { IPushRule, IPushRules, RuleId, IPusher } from 'matrix-js-sdk/src/matrix'; import { IThreepid, ThreepidMedium } from 'matrix-js-sdk/src/@types/threepids'; diff --git a/test/components/views/settings/ThemeChoicePanel-test.tsx b/test/components/views/settings/ThemeChoicePanel-test.tsx index 0d0a71c86c..e1eb47cfa0 100644 --- a/test/components/views/settings/ThemeChoicePanel-test.tsx +++ b/test/components/views/settings/ThemeChoicePanel-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import * as TestUtils from "../../../test-utils"; diff --git a/test/components/views/settings/UiFeatureSettingWrapper-test.tsx b/test/components/views/settings/UiFeatureSettingWrapper-test.tsx index 0868881936..5904457792 100644 --- a/test/components/views/settings/UiFeatureSettingWrapper-test.tsx +++ b/test/components/views/settings/UiFeatureSettingWrapper-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import SettingsStore from '../../../../src/settings/SettingsStore'; diff --git a/test/components/views/settings/tabs/user/KeyboardUserSettingsTab-test.tsx b/test/components/views/settings/tabs/user/KeyboardUserSettingsTab-test.tsx index 3838ce2665..57295a96fe 100644 --- a/test/components/views/settings/tabs/user/KeyboardUserSettingsTab-test.tsx +++ b/test/components/views/settings/tabs/user/KeyboardUserSettingsTab-test.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount, ReactWrapper } from "enzyme"; import { Key } from "../../../../../../src/Keyboard"; diff --git a/test/components/views/spaces/QuickThemeSwitcher-test.tsx b/test/components/views/spaces/QuickThemeSwitcher-test.tsx index c443963778..4efa1473b2 100644 --- a/test/components/views/spaces/QuickThemeSwitcher-test.tsx +++ b/test/components/views/spaces/QuickThemeSwitcher-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { mocked } from 'jest-mock'; import { act } from 'react-dom/test-utils'; diff --git a/test/components/views/spaces/SpacePanel-test.tsx b/test/components/views/spaces/SpacePanel-test.tsx index e328c51188..25ce4c3b6a 100644 --- a/test/components/views/spaces/SpacePanel-test.tsx +++ b/test/components/views/spaces/SpacePanel-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { mocked } from 'jest-mock'; import { MatrixClient } from 'matrix-js-sdk/src/matrix'; diff --git a/test/components/views/spaces/SpaceTreeLevel-test.tsx b/test/components/views/spaces/SpaceTreeLevel-test.tsx index 09661c71f4..eda55f6dc1 100644 --- a/test/components/views/spaces/SpaceTreeLevel-test.tsx +++ b/test/components/views/spaces/SpaceTreeLevel-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { stubClient, mkRoom } from "../../../test-utils"; diff --git a/test/components/views/voip/VideoLobby-test.tsx b/test/components/views/voip/VideoLobby-test.tsx index bf3a4a5d59..65c6d62f2a 100644 --- a/test/components/views/voip/VideoLobby-test.tsx +++ b/test/components/views/voip/VideoLobby-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { act } from "react-dom/test-utils"; import { mocked } from "jest-mock"; diff --git a/test/hooks/useDebouncedCallback-test.tsx b/test/hooks/useDebouncedCallback-test.tsx index 8aa28cb8f5..a9b8e04e95 100644 --- a/test/hooks/useDebouncedCallback-test.tsx +++ b/test/hooks/useDebouncedCallback-test.tsx @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { sleep } from "matrix-js-sdk/src/utils"; import React from "react"; diff --git a/test/hooks/useLatestResult-test.tsx b/test/hooks/useLatestResult-test.tsx index 16a4f20f24..f5ea67e920 100644 --- a/test/hooks/useLatestResult-test.tsx +++ b/test/hooks/useLatestResult-test.tsx @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { sleep } from "matrix-js-sdk/src/utils"; import React, { useEffect, useState } from "react"; diff --git a/test/hooks/useProfileInfo-test.tsx b/test/hooks/useProfileInfo-test.tsx index e77d7c2834..0debce3799 100644 --- a/test/hooks/useProfileInfo-test.tsx +++ b/test/hooks/useProfileInfo-test.tsx @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { sleep } from "matrix-js-sdk/src/utils"; import React from "react"; diff --git a/test/hooks/usePublicRoomDirectory-test.tsx b/test/hooks/usePublicRoomDirectory-test.tsx index 3cd76d1124..12db308bee 100644 --- a/test/hooks/usePublicRoomDirectory-test.tsx +++ b/test/hooks/usePublicRoomDirectory-test.tsx @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { sleep } from "matrix-js-sdk/src/utils"; import React from "react"; diff --git a/test/hooks/useUserDirectory-test.tsx b/test/hooks/useUserDirectory-test.tsx index 44721e3643..3813efa472 100644 --- a/test/hooks/useUserDirectory-test.tsx +++ b/test/hooks/useUserDirectory-test.tsx @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { sleep } from "matrix-js-sdk/src/utils"; import React from "react"; diff --git a/test/modules/ModuleComponents-test.tsx b/test/modules/ModuleComponents-test.tsx index 3bb39a9012..1bc7f77c69 100644 --- a/test/modules/ModuleComponents-test.tsx +++ b/test/modules/ModuleComponents-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { TextInputField } from "@matrix-org/react-sdk-module-api/lib/components/TextInputField"; import { Spinner as ModuleSpinner } from "@matrix-org/react-sdk-module-api/lib/components/Spinner"; diff --git a/test/setupTests.js b/test/setupTests.js index 0c7617eb2b..dc6d4b9d5f 100644 --- a/test/setupTests.js +++ b/test/setupTests.js @@ -15,6 +15,7 @@ limitations under the License. */ import Adapter from "@wojtekmaj/enzyme-adapter-react-17"; +// eslint-disable-next-line deprecate/import import { configure } from "enzyme"; import "blob-polyfill"; // https://github.com/jsdom/jsdom/issues/2555 diff --git a/test/test-utils/utilities.ts b/test/test-utils/utilities.ts index 5011a55593..4da1389477 100644 --- a/test/test-utils/utilities.ts +++ b/test/test-utils/utilities.ts @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// eslint-disable-next-line deprecate/import import { ReactWrapper } from "enzyme"; import EventEmitter from "events"; diff --git a/test/useTopic-test.tsx b/test/useTopic-test.tsx index 7052375eb8..818eb9fd71 100644 --- a/test/useTopic-test.tsx +++ b/test/useTopic-test.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from "react"; import { Room } from "matrix-js-sdk/src/models/room"; +// eslint-disable-next-line deprecate/import import { mount } from "enzyme"; import { act } from "react-dom/test-utils"; diff --git a/test/utils/tooltipify-test.tsx b/test/utils/tooltipify-test.tsx index 468cd059e1..8e3784e7fd 100644 --- a/test/utils/tooltipify-test.tsx +++ b/test/utils/tooltipify-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +// eslint-disable-next-line deprecate/import import { mount } from 'enzyme'; import { tooltipifyLinks } from '../../src/utils/tooltipify'; diff --git a/yarn.lock b/yarn.lock index 65dd51b227..216ef0b547 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4171,6 +4171,11 @@ eslint-module-utils@^2.7.3: debug "^3.2.7" find-up "^2.1.0" +eslint-plugin-deprecate@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-deprecate/-/eslint-plugin-deprecate-0.7.0.tgz#04805d2f2884800c580d59933b9c895f31b02437" + integrity sha512-MylhCqoH/SJ2MwzVgX0we6oE+lKPVwhOu9hAJ98vMCmbz3FNwqJ8XipdI23bCF7NHxUbhd6mdxFjywKE52pt7A== + eslint-plugin-import@^2.25.4: version "2.26.0" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz#f812dc47be4f2b72b478a021605a59fc6fe8b88b" @@ -4209,10 +4214,10 @@ eslint-plugin-jsx-a11y@^6.5.1: minimatch "^3.1.2" semver "^6.3.0" -eslint-plugin-matrix-org@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-matrix-org/-/eslint-plugin-matrix-org-0.5.2.tgz#eb355b1a81906ea814235d0b224e8162db7cbbf4" - integrity sha512-qJbyxp9cOi35Qpn3WCBqohCJaMSVp3ntOJ3WbjpREbCQdyrFze6MJAayl7GNidbNsdP7ejHTi0PtZzyKLcfLzQ== +eslint-plugin-matrix-org@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-matrix-org/-/eslint-plugin-matrix-org-0.6.1.tgz#deab0636a1fe999d9c2a42929c2b486334ec8ead" + integrity sha512-kq7fCbOdj6OvPF50gJtTVSgg6TbQCOxwwZktyIGQJfZyGNWhew77ptTnmaxgxq+RIQ+rzNcWrcMGO5eQC9fZAg== eslint-plugin-react-hooks@^4.3.0: version "4.6.0"