diff --git a/.eslintrc.js b/.eslintrc.js index a0f5715573..45cd05506f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -87,32 +87,71 @@ module.exports = { "jsx-a11y/role-supports-aria-props": "off", "jsx-a11y/tabindex-no-positive": "off", }, - overrides: [{ - files: [ - "src/**/*.{ts,tsx}", - "test/**/*.{ts,tsx}", - ], - extends: [ - "plugin:matrix-org/typescript", - "plugin:matrix-org/react", - ], - rules: { - // Things we do that break the ideal style - "prefer-promise-reject-errors": "off", - "quotes": "off", - "no-extra-boolean-cast": "off", + overrides: [ + { + files: [ + "src/**/*.{ts,tsx}", + "test/**/*.{ts,tsx}", + ], + extends: [ + "plugin:matrix-org/typescript", + "plugin:matrix-org/react", + ], + rules: { + // Things we do that break the ideal style + "prefer-promise-reject-errors": "off", + "quotes": "off", + "no-extra-boolean-cast": "off", - // Remove Babel things manually due to override limitations - "@babel/no-invalid-this": ["off"], + // Remove Babel things manually due to override limitations + "@babel/no-invalid-this": ["off"], - // We're okay being explicit at the moment - "@typescript-eslint/no-empty-interface": "off", - // We disable this while we're transitioning - "@typescript-eslint/no-explicit-any": "off", - // We'd rather not do this but we do - "@typescript-eslint/ban-ts-comment": "off", + // We're okay being explicit at the moment + "@typescript-eslint/no-empty-interface": "off", + // We disable this while we're transitioning + "@typescript-eslint/no-explicit-any": "off", + // We'd rather not do this but we do + "@typescript-eslint/ban-ts-comment": "off", + }, }, - }], + // temporary override for offending icon require files + { + files: [ + "src/SdkConfig.ts", + "src/components/structures/FileDropTarget.tsx", + "src/components/structures/RoomStatusBar.tsx", + "src/components/structures/UserMenu.tsx", + "src/components/views/avatars/WidgetAvatar.tsx", + "src/components/views/dialogs/AddExistingToSpaceDialog.tsx", + "src/components/views/dialogs/CreateSpaceFromCommunityDialog.tsx", + "src/components/views/dialogs/ForwardDialog.tsx", + "src/components/views/dialogs/InviteDialog.tsx", + "src/components/views/dialogs/ModalWidgetDialog.tsx", + "src/components/views/dialogs/UploadConfirmDialog.tsx", + "src/components/views/dialogs/security/SetupEncryptionDialog.tsx", + "src/components/views/elements/AddressTile.tsx", + "src/components/views/elements/AppWarning.tsx", + "src/components/views/elements/SSOButtons.tsx", + "src/components/views/messages/MAudioBody.tsx", + "src/components/views/messages/MImageBody.tsx", + "src/components/views/messages/MFileBody.tsx", + "src/components/views/messages/MStickerBody.tsx", + "src/components/views/messages/MVideoBody.tsx", + "src/components/views/messages/MVoiceMessageBody.tsx", + "src/components/views/right_panel/EncryptionPanel.tsx", + "src/components/views/rooms/EntityTile.tsx", + "src/components/views/rooms/LinkPreviewGroup.tsx", + "src/components/views/rooms/MemberList.tsx", + "src/components/views/rooms/MessageComposer.tsx", + "src/components/views/rooms/ReplyPreview.tsx", + "src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx", + "src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx" + ], + rules: { + "@typescript-eslint/no-var-requires": "off", + }, + } + ], settings: { react: { version: "detect", diff --git a/src/SdkConfig.ts b/src/SdkConfig.ts index f0bfafab9f..c4387d1f23 100644 --- a/src/SdkConfig.ts +++ b/src/SdkConfig.ts @@ -50,7 +50,7 @@ export const DEFAULTS: ConfigOptions = { }, desktopBuilds: { available: true, - logo: require("../res/img/element-desktop-logo.svg"), + logo: require("../res/img/element-desktop-logo.svg").default, url: "https://element.io/get-started", }, }; diff --git a/src/components/structures/FileDropTarget.tsx b/src/components/structures/FileDropTarget.tsx index 72a86978d9..f6572a05e8 100644 --- a/src/components/structures/FileDropTarget.tsx +++ b/src/components/structures/FileDropTarget.tsx @@ -17,7 +17,6 @@ limitations under the License. import React, { useEffect, useState } from "react"; import { _t } from "../../languageHandler"; -import FileDropSvg from '../../../res/img/upload-big.svg'; interface IProps { parent: HTMLElement; @@ -110,7 +109,7 @@ const FileDropTarget: React.FC = ({ parent, onFileDrop }) => { if (state.dragging) { return
- + { _t("Drop file here to upload") }
; } diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index bfeec99ae7..d5da40b86a 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -46,12 +46,6 @@ import { createSpaceFromCommunity } from "../../utils/space"; import { Action } from "../../dispatcher/actions"; import { RightPanelPhases } from "../../stores/right-panel/RightPanelStorePhases"; import { UPDATE_EVENT } from "../../stores/AsyncStore"; -import CreateRoomSvg from '../../../res/img/icons-create-room.svg'; -import CancelSmallSvg from '../../../res/img/cancel-small.svg'; -import CancelSvg from '../../../res/img/cancel.svg'; -import ExternalLinkSvg from '../../../res/img/external-link.svg'; -import AddRoomSvg from '../../../res/img/icons-room-add.svg'; -import CameraSvg from '../../../res/img/camera.svg'; const LONG_DESC_PLACEHOLDER = _td( `

HTML for your community's page

@@ -141,7 +135,7 @@ class CategoryRoomList extends React.Component { ( - +
{ _t('Add a Room') }
@@ -241,7 +235,7 @@ class FeaturedRoom extends React.Component { const deleteButton = this.props.editing ? Delete - +
{ _t('Add a User') }
@@ -392,7 +386,7 @@ class FeaturedUser extends React.Component { const deleteButton = this.props.editing ? Delete - + ; } @@ -931,7 +925,7 @@ export default class GroupView extends React.Component { onClick={this._onAddRoomsClick} >
- +
{ _t('Add rooms to this community') } @@ -1263,7 +1257,7 @@ export default class GroupView extends React.Component {