diff --git a/apps/desktop/playwright/element-desktop-test.ts b/apps/desktop/playwright/element-desktop-test.ts index b2fa3c983e..c3a7570cbb 100644 --- a/apps/desktop/playwright/element-desktop-test.ts +++ b/apps/desktop/playwright/element-desktop-test.ts @@ -50,16 +50,13 @@ export const test = base.extend({ extraEnv: {}, extraArgs: [], - // eslint-disable-next-line no-empty-pattern stdout: async ({}, use) => { await use(new CapturedPassThrough()); }, - // eslint-disable-next-line no-empty-pattern stderr: async ({}, use) => { await use(new CapturedPassThrough()); }, - // eslint-disable-next-line no-empty-pattern tmpDir: async ({}, use) => { const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "element-desktop-tests-")); await use(tmpDir); diff --git a/apps/desktop/scripts/hak/index.ts b/apps/desktop/scripts/hak/index.ts index ea02582632..78da8aaefd 100644 --- a/apps/desktop/scripts/hak/index.ts +++ b/apps/desktop/scripts/hak/index.ts @@ -38,7 +38,6 @@ async function main(): Promise { // Can be specified multiple times for the copy command to bundle // multiple arches into a single universal output module) for (;;) { - // eslint-disable-line no-constant-condition const targetIndex = process.argv.indexOf("--target"); if (targetIndex === -1) break; diff --git a/apps/desktop/src/@types/global.d.ts b/apps/desktop/src/@types/global.d.ts index 3314f37261..3cba8d2fcc 100644 --- a/apps/desktop/src/@types/global.d.ts +++ b/apps/desktop/src/@types/global.d.ts @@ -10,10 +10,8 @@ import { type BrowserWindow } from "electron"; import { type AppLocalization } from "../language-helper.js"; // global type extensions need to use var for whatever reason -/* eslint-disable no-var */ declare global { var mainWindow: BrowserWindow | null; var appQuitting: boolean; var appLocalization: AppLocalization; } -/* eslint-enable no-var */ diff --git a/apps/desktop/src/@types/matrix-seshat.d.ts b/apps/desktop/src/@types/matrix-seshat.d.ts index e93147b673..d68846fd2c 100644 --- a/apps/desktop/src/@types/matrix-seshat.d.ts +++ b/apps/desktop/src/@types/matrix-seshat.d.ts @@ -11,7 +11,6 @@ declare module "matrix-seshat" { passphrase?: string; } - /* eslint-disable camelcase */ interface IMatrixEvent { event_id: string; sender: string; @@ -49,7 +48,6 @@ declare module "matrix-seshat" { context: ISearchContext; }>; } - /* eslint-enable camelcase */ interface ICheckpoint { roomId: string; diff --git a/apps/desktop/src/electron-main.ts b/apps/desktop/src/electron-main.ts index 9c2ee7687f..74c620d357 100644 --- a/apps/desktop/src/electron-main.ts +++ b/apps/desktop/src/electron-main.ts @@ -22,7 +22,6 @@ import { protocol, desktopCapturer, } from "electron"; -// eslint-disable-next-line n/file-extension-in-import import * as Sentry from "@sentry/electron/main"; import path, { dirname } from "node:path"; import windowStateKeeper from "electron-window-state"; diff --git a/apps/desktop/src/language-helper.ts b/apps/desktop/src/language-helper.ts index 45d8621584..33cf9c9f11 100644 --- a/apps/desktop/src/language-helper.ts +++ b/apps/desktop/src/language-helper.ts @@ -77,7 +77,6 @@ export class AppLocalization { if (store.has(AppLocalization.STORE_KEY)) { const locales = store.get(AppLocalization.STORE_KEY); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion this.setAppLocale(locales!); } diff --git a/apps/web/playwright/e2e/forgot-password/forgot-password.spec.ts b/apps/web/playwright/e2e/forgot-password/forgot-password.spec.ts index d075afda73..e692975958 100644 --- a/apps/web/playwright/e2e/forgot-password/forgot-password.spec.ts +++ b/apps/web/playwright/e2e/forgot-password/forgot-password.spec.ts @@ -14,7 +14,6 @@ import { isDendrite } from "../../plugins/homeserver/dendrite"; const email = "user@nowhere.dummy"; const test = base.extend({ - // eslint-disable-next-line no-empty-pattern credentials: async ({}, use, testInfo) => { await use({ username: `user_${testInfo.testId}`, diff --git a/apps/web/playwright/element-web-test.ts b/apps/web/playwright/element-web-test.ts index c1b66e551c..c3e242de9b 100644 --- a/apps/web/playwright/element-web-test.ts +++ b/apps/web/playwright/element-web-test.ts @@ -93,7 +93,6 @@ export const test = base.extend({ await bot.onTestFinished(testInfo); }, - // eslint-disable-next-line no-empty-pattern webserver: async ({}, use) => { const webserver = new Webserver(); await use(webserver); diff --git a/apps/web/playwright/plugins/homeserver/synapse/legacyOAuthHomeserver.ts b/apps/web/playwright/plugins/homeserver/synapse/legacyOAuthHomeserver.ts index b6ef7243fd..abdd0624e7 100644 --- a/apps/web/playwright/plugins/homeserver/synapse/legacyOAuthHomeserver.ts +++ b/apps/web/playwright/plugins/homeserver/synapse/legacyOAuthHomeserver.ts @@ -13,7 +13,6 @@ import { type Fixtures } from "../../../element-web-test.ts"; export const legacyOAuthHomeserver: Fixtures = { oAuthServer: [ - // eslint-disable-next-line no-empty-pattern async ({}, use) => { const server = new OAuthServer(); await use(server); diff --git a/apps/web/res/decoder-ring/datatypes.js b/apps/web/res/decoder-ring/datatypes.js index 07fdcc72e9..1913d0d8e2 100644 --- a/apps/web/res/decoder-ring/datatypes.js +++ b/apps/web/res/decoder-ring/datatypes.js @@ -58,56 +58,3 @@ class Some extends Optional { } } const None = new Optional(); - -class FetchStatus { - constructor(opt = {}) { - this.opt = { at: Date.now(), ...opt }; - } - map(f) { - return this; - } - flatMap(f) { - return this; - } -} -class Success extends FetchStatus { - static of(value) { - return new Success(value); - } - constructor(value, opt) { - super(opt); - this.value = value; - } - map(f) { - return new Success(f(this.value), this.opt); - } - flatMap(f) { - return f(this.value, this.opt); - } - fold({ success }) { - return success instanceof Function ? success(this.value, this.opt) : undefined; - } -} -class Pending extends FetchStatus { - static of(opt) { - return new Pending(opt); - } - constructor(opt) { - super(opt); - } - fold({ pending }) { - return pending instanceof Function ? pending(this.opt) : undefined; - } -} -class FetchError extends FetchStatus { - static of(reason, opt) { - return new FetchError(reason, opt); - } - constructor(reason, opt) { - super(opt); - this.reason = reason; - } - fold({ error }) { - return error instanceof Function ? error(this.reason, this.opt) : undefined; - } -} diff --git a/apps/web/src/@types/commonmark.ts b/apps/web/src/@types/commonmark.ts index 110e85f187..296f952392 100644 --- a/apps/web/src/@types/commonmark.ts +++ b/apps/web/src/@types/commonmark.ts @@ -11,8 +11,7 @@ import type * as commonmark from "commonmark"; declare module "commonmark" { export type Attr = [key: string, value: string]; - /* eslint-disable @typescript-eslint/naming-convention */ - interface HtmlRenderer { + export interface HtmlRenderer { // As far as @types/commonmark is concerned, these are not public, so add them // https://github.com/commonmark/commonmark.js/blob/master/lib/render/html.js#L272-L296 text: (this: commonmark.HtmlRenderer, node: commonmark.Node) => void; @@ -42,5 +41,4 @@ declare module "commonmark" { lit: (this: commonmark.HtmlRenderer, text: string) => void; cr: (this: commonmark.HtmlRenderer) => void; } - /* eslint-enable @typescript-eslint/naming-convention */ } diff --git a/apps/web/src/@types/global.d.ts b/apps/web/src/@types/global.d.ts index d66c160f8e..d994bc2013 100644 --- a/apps/web/src/@types/global.d.ts +++ b/apps/web/src/@types/global.d.ts @@ -38,8 +38,6 @@ import { type ModuleApiType } from "../modules/Api.ts"; import type { RoomListStoreV3Class } from "../stores/room-list-v3/RoomListStoreV3.ts"; import { type SDKContextClass } from "../contexts/SDKContextClass.ts"; -/* eslint-disable @typescript-eslint/naming-convention */ - type ElectronChannel = | "app_onAction" | "before-quit" @@ -177,7 +175,6 @@ declare global { }, ): void; - // eslint-disable-next-line no-var var grecaptcha: | undefined | { @@ -192,14 +189,8 @@ declare global { isReady: () => boolean; }; - // eslint-disable-next-line no-var, camelcase var mx_rage_logger: ConsoleLogger; - // eslint-disable-next-line no-var, camelcase var mx_rage_initPromise: Promise; - // eslint-disable-next-line no-var, camelcase var mx_rage_initStoragePromise: Promise; - // eslint-disable-next-line no-var, camelcase var mx_rage_store: IndexedDBLogStore; } - -/* eslint-enable @typescript-eslint/naming-convention */ diff --git a/apps/web/src/Linkify.ts b/apps/web/src/Linkify.ts index 70b4401d5f..939c561e56 100644 --- a/apps/web/src/Linkify.ts +++ b/apps/web/src/Linkify.ts @@ -102,7 +102,6 @@ export const transformTags: NonNullable = { } return { tagName, attribs }; }, - // eslint-disable-next-line @typescript-eslint/naming-convention "*": function (tagName: string, attribs: sanitizeHtml.Attributes) { // Delete any style previously assigned, style is an allowedTag for font, span & img, // because attributes are stripped after transforming. diff --git a/apps/web/src/Markdown.test.ts b/apps/web/src/Markdown.test.ts index 68dc00f9ba..507ef943d6 100644 --- a/apps/web/src/Markdown.test.ts +++ b/apps/web/src/Markdown.test.ts @@ -35,7 +35,6 @@ describe("Markdown parser test", () => { ].join("\n"); it("tests that links with markdown empasis in them are getting properly HTML formatted", () => { - /* eslint-disable max-len */ const expectedResult = [ "

Test1:
#_foonetic_xkcd:matrix.org
http://google.com/_thing_
https://matrix.org/_matrix/client/foo/123_
#_foonetic_xkcd:matrix.org

", "

Test1A:
#_foonetic_xkcd:matrix.org
http://google.com/_thing_
https://matrix.org/_matrix/client/foo/123_
#_foonetic_xkcd:matrix.org

", @@ -43,7 +42,6 @@ describe("Markdown parser test", () => { "

Test3:
https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org
https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org

", "", ].join("\n"); - /* eslint-enable max-len */ const md = new Markdown(testString); expect(md.toHTML()).toEqual(expectedResult); }); @@ -69,7 +67,6 @@ describe("Markdown parser test", () => { "", "", ].join("\n"); - /* eslint-disable max-len */ /** * NOTE: I'm not entirely sure if those "<"" and ">" should be visible in here for #_foonetic_xkcd:matrix.org * but it seems to be actually working properly @@ -81,7 +78,6 @@ describe("Markdown parser test", () => { '

Test3:
https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org
https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org

', "", ].join("\n"); - /* eslint-enable max-len */ const md = new Markdown(test); expect(md.toHTML()).toEqual(expectedResult); }); @@ -114,7 +110,6 @@ describe("Markdown parser test", () => { }); it('expects that links with emphasis are "escaped" correctly', () => { - /* eslint-disable max-len */ const testString = [ "http://domain.xyz/foo/bar-_stuff-like-this_-in-it.jpg" + " " + @@ -139,22 +134,18 @@ describe("Markdown parser test", () => { "https://example.com/_test__test2_test3__", "https://example.com/_test__test2", ].join("
"); - /* eslint-enable max-len */ const md = new Markdown(testString); expect(md.toHTML()).toEqual(expectedResult); }); it("expects that the link part will not be accidentally added to ", () => { - /* eslint-disable max-len */ const testString = `https://github.com/matrix-org/synapse/blob/develop/synapse/module_api/__init__.py`; const expectedResult = "https://github.com/matrix-org/synapse/blob/develop/synapse/module_api/__init__.py"; - /* eslint-enable max-len */ const md = new Markdown(testString); expect(md.toHTML()).toEqual(expectedResult); }); it("expects that the link part will not be accidentally added to for multiline links", () => { - /* eslint-disable max-len */ const testString = [ "https://github.com/matrix-org/synapse/blob/develop/synapse/module_api/__init__.py" + " " + @@ -171,7 +162,6 @@ describe("Markdown parser test", () => { " " + "https://github.com/matrix-org/synapse/blob/develop/synapse/module_api/__init__.py", ].join("
"); - /* eslint-enable max-len */ const md = new Markdown(testString); expect(md.toHTML()).toEqual(expectedResult); }); diff --git a/apps/web/src/Registration.tsx b/apps/web/src/Registration.tsx index 22eb6e15ff..098d25ca6c 100644 --- a/apps/web/src/Registration.tsx +++ b/apps/web/src/Registration.tsx @@ -38,7 +38,6 @@ export const SAFE_LOCALPART_REGEX = /^[a-z0-9=_\-./]+$/; * If present the screen to redirect to after a successful login or register. */ export async function startAnyRegistrationFlow( - // eslint-disable-next-line camelcase options: { go_home_on_cancel?: boolean; go_welcome_on_cancel?: boolean; screen_after?: boolean } = {}, ): Promise { const modal = Modal.createDialog(QuestionDialog, { diff --git a/apps/web/src/components/structures/AutocompleteInput.tsx b/apps/web/src/components/structures/AutocompleteInput.tsx index 95fcb83b4d..c57ca0be91 100644 --- a/apps/web/src/components/structures/AutocompleteInput.tsx +++ b/apps/web/src/components/structures/AutocompleteInput.tsx @@ -151,7 +151,6 @@ export const AutocompleteInput: React.FC = ({ {isFocused && suggestions.length ? (
diff --git a/apps/web/src/components/structures/ContextMenu.tsx b/apps/web/src/components/structures/ContextMenu.tsx index 2e67c16b04..0d3a8086b2 100644 --- a/apps/web/src/components/structures/ContextMenu.tsx +++ b/apps/web/src/components/structures/ContextMenu.tsx @@ -425,11 +425,7 @@ export default class ContextMenu extends React.PureComponent @@ -579,7 +575,6 @@ type ContextMenuTuple = [ (ev?: SyntheticEvent) => void, (val: boolean) => void, ]; -// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint export const useContextMenu = ( inputRef?: RefObject, ): ContextMenuTuple => { @@ -601,7 +596,6 @@ export const useContextMenu = ( setIsOpen(false); }; - // eslint-disable-next-line react-compiler/react-compiler return [button.current ? isOpen : false, button, open, close, setIsOpen]; }; diff --git a/apps/web/src/components/structures/IndicatorScrollbar.tsx b/apps/web/src/components/structures/IndicatorScrollbar.tsx index 0ff535ce3f..46d7ba537e 100644 --- a/apps/web/src/components/structures/IndicatorScrollbar.tsx +++ b/apps/web/src/components/structures/IndicatorScrollbar.tsx @@ -169,7 +169,6 @@ export default class IndicatorScrollbar e }; public render(): React.ReactNode { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { children, trackHorizontalOverflow, verticalScrollsHorizontally, className, ...otherProps } = this.props; const leftIndicatorStyle = { left: this.state.leftIndicatorOffset }; diff --git a/apps/web/src/components/structures/LoggedInView.tsx b/apps/web/src/components/structures/LoggedInView.tsx index 31456d3d24..63abfd7b3d 100644 --- a/apps/web/src/components/structures/LoggedInView.tsx +++ b/apps/web/src/components/structures/LoggedInView.tsx @@ -84,7 +84,7 @@ interface IProps { // transitioned to PWLU) onRegistered: (this: void, credentials: IMatrixClientCreds) => Promise; hideToSRUsers: boolean; - // eslint-disable-next-line camelcase + page_type?: string; threepidInvite?: IThreepidInvite; roomOobData?: IOOBData; diff --git a/apps/web/src/components/structures/MatrixChat.tsx b/apps/web/src/components/structures/MatrixChat.tsx index cab8f3c9e7..fd42de69ee 100644 --- a/apps/web/src/components/structures/MatrixChat.tsx +++ b/apps/web/src/components/structures/MatrixChat.tsx @@ -179,7 +179,6 @@ interface IState { // What the LoggedInView would be showing if visible. // A member of the enum for standard pages or a string for those provided by // a module. - // eslint-disable-next-line camelcase page_type?: PageType | string; // The ID of the room we're viewing. This is either populated directly // in the case where we view a room by ID or by RoomView when it resolves @@ -188,11 +187,8 @@ interface IState { // If we're trying to just view a user ID (i.e. /user URL), this is it currentUserId: string | null; // Parameters used in the registration dance with the IS - // eslint-disable-next-line camelcase register_client_secret?: string; - // eslint-disable-next-line camelcase register_session_id?: string; - // eslint-disable-next-line camelcase register_id_sid?: string; isMobileRegistration?: boolean; // When showing Modal dialogs we need to set aria-hidden on the root app element diff --git a/apps/web/src/components/structures/auth/Login.tsx b/apps/web/src/components/structures/auth/Login.tsx index e393e9c996..36634dea90 100644 --- a/apps/web/src/components/structures/auth/Login.tsx +++ b/apps/web/src/components/structures/auth/Login.tsx @@ -118,9 +118,7 @@ class LoginComponent extends React.PureComponent { "m.login.password": this.renderPasswordStep, // CAS and SSO are the same thing, modulo the url we link to - // eslint-disable-next-line @typescript-eslint/naming-convention "m.login.cas": () => this.renderSsoStep("cas"), - // eslint-disable-next-line @typescript-eslint/naming-convention "m.login.sso": () => this.renderSsoStep("sso"), "oauthNativeFlow": () => this.renderOAuth2Step(), }; diff --git a/apps/web/src/components/views/auth/InteractiveAuthEntryComponents.tsx b/apps/web/src/components/views/auth/InteractiveAuthEntryComponents.tsx index 5e5b163b7a..89fe5799e6 100644 --- a/apps/web/src/components/views/auth/InteractiveAuthEntryComponents.tsx +++ b/apps/web/src/components/views/auth/InteractiveAuthEntryComponents.tsx @@ -178,13 +178,11 @@ export class PasswordAuthEntry extends React.Component { public static LOGIN_TYPE = AuthType.Recaptcha; diff --git a/apps/web/src/components/views/dialogs/ForwardDialog.tsx b/apps/web/src/components/views/dialogs/ForwardDialog.tsx index ae5b43ad50..fac3887319 100644 --- a/apps/web/src/components/views/dialogs/ForwardDialog.tsx +++ b/apps/web/src/components/views/dialogs/ForwardDialog.tsx @@ -197,7 +197,6 @@ const Entry: React.FC> = ({ room, type, content, matrixClient: */ const transformEvent = (event: MatrixEvent, cli: MatrixClient): { type: string; content: IContent } => { const { - // eslint-disable-next-line @typescript-eslint/no-unused-vars "m.relates_to": _, // strip relations - in future we will attach a relation pointing at the original event // We're taking a shallow copy here to avoid https://github.com/vector-im/element-web/issues/10924 ...content diff --git a/apps/web/src/components/views/dialogs/IncomingSasDialog.tsx b/apps/web/src/components/views/dialogs/IncomingSasDialog.tsx index f9de078249..18b5ae4b28 100644 --- a/apps/web/src/components/views/dialogs/IncomingSasDialog.tsx +++ b/apps/web/src/components/views/dialogs/IncomingSasDialog.tsx @@ -35,7 +35,6 @@ interface IState { phase: number; sasVerified: boolean; opponentProfile: { - // eslint-disable-next-line camelcase avatar_url?: string; displayname?: string; } | null; diff --git a/apps/web/src/components/views/dialogs/InviteDialog.tsx b/apps/web/src/components/views/dialogs/InviteDialog.tsx index 77ed5b33ce..3f1caffda4 100644 --- a/apps/web/src/components/views/dialogs/InviteDialog.tsx +++ b/apps/web/src/components/views/dialogs/InviteDialog.tsx @@ -801,7 +801,6 @@ export default class InviteDialog extends React.PureComponent { private fakeEvent({ message }: IState): MatrixEvent { // Fake it till we make it - /* eslint-disable quote-props */ const rawEvent = { type: "m.room.message", sender: this.props.userId, @@ -86,7 +85,6 @@ export default class EventTilePreview extends React.Component { room_id: "!999999999999999999:example.org", }; const event = new MatrixEvent(rawEvent); - /* eslint-enable quote-props */ // Fake it more event.sender = { diff --git a/apps/web/src/components/views/elements/ResizeHandle.tsx b/apps/web/src/components/views/elements/ResizeHandle.tsx index 5e2ad0e5cf..a6aaa35710 100644 --- a/apps/web/src/components/views/elements/ResizeHandle.tsx +++ b/apps/web/src/components/views/elements/ResizeHandle.tsx @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com Please see LICENSE files in the repository root for full details. */ -import React from "react"; // eslint-disable-line no-unused-vars +import React from "react"; //see src/resizer for the actual resizing code, this is just the DOM for the resize handle interface IResizeHandleProps { diff --git a/apps/web/src/components/views/right_panel/UserInfo.tsx b/apps/web/src/components/views/right_panel/UserInfo.tsx index 82348ff7d3..c896115cf6 100644 --- a/apps/web/src/components/views/right_panel/UserInfo.tsx +++ b/apps/web/src/components/views/right_panel/UserInfo.tsx @@ -76,11 +76,8 @@ export const Container: React.FC<{ export interface IPowerLevelsContent { events?: Record; - // eslint-disable-next-line camelcase users_default?: number; - // eslint-disable-next-line camelcase events_default?: number; - // eslint-disable-next-line camelcase state_default?: number; ban?: number; kick?: number; diff --git a/apps/web/src/components/views/rooms/ReadReceiptGroup.tsx b/apps/web/src/components/views/rooms/ReadReceiptGroup.tsx index 0f3eee10b4..ee1538723b 100644 --- a/apps/web/src/components/views/rooms/ReadReceiptGroup.tsx +++ b/apps/web/src/components/views/rooms/ReadReceiptGroup.tsx @@ -108,7 +108,6 @@ export function ReadReceiptGroup({ readReceiptPosition = readReceiptMap[userId]; if (!readReceiptPosition) { readReceiptPosition = {}; - // eslint-disable-next-line react-compiler/react-compiler readReceiptMap[userId] = readReceiptPosition; } } diff --git a/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useComposerFunctions.ts b/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useComposerFunctions.ts index e9f6365d02..8c2ec26476 100644 --- a/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useComposerFunctions.ts +++ b/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useComposerFunctions.ts @@ -21,7 +21,6 @@ export function useComposerFunctions( () => ({ clear: () => { if (ref.current) { - // eslint-disable-next-line react-compiler/react-compiler ref.current.innerHTML = ""; } }, diff --git a/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextInitialization.ts b/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextInitialization.ts index b547afffbe..04caed66c7 100644 --- a/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextInitialization.ts +++ b/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextInitialization.ts @@ -12,7 +12,6 @@ export function usePlainTextInitialization(initialContent = "", ref: RefObject { // always read and write the ref.current using .innerHTML for consistency in linebreak and HTML entity handling if (ref.current) { - // eslint-disable-next-line react-compiler/react-compiler ref.current.innerHTML = initialContent; } }, [ref, initialContent]); diff --git a/apps/web/src/components/views/settings/BridgeTile.tsx b/apps/web/src/components/views/settings/BridgeTile.tsx index 870ed18884..9be5a6c030 100644 --- a/apps/web/src/components/views/settings/BridgeTile.tsx +++ b/apps/web/src/components/views/settings/BridgeTile.tsx @@ -33,25 +33,19 @@ interface IBridgeStateEvent { protocol: { id: string; displayname?: string; - // eslint-disable-next-line camelcase avatar_url?: string; - // eslint-disable-next-line camelcase external_url?: string; }; network?: { id: string; displayname?: string; - // eslint-disable-next-line camelcase avatar_url?: string; - // eslint-disable-next-line camelcase external_url?: string; }; channel: { id: string; displayname?: string; - // eslint-disable-next-line camelcase avatar_url?: string; - // eslint-disable-next-line camelcase external_url?: string; }; } diff --git a/apps/web/src/components/views/spaces/SpaceTreeLevel.tsx b/apps/web/src/components/views/spaces/SpaceTreeLevel.tsx index 8f44627b37..f76027633b 100644 --- a/apps/web/src/components/views/spaces/SpaceTreeLevel.tsx +++ b/apps/web/src/components/views/spaces/SpaceTreeLevel.tsx @@ -313,7 +313,6 @@ export class SpaceItem extends React.PureComponent { }; public render(): React.ReactNode { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { space, activeSpaces, @@ -366,7 +365,6 @@ export class SpaceItem extends React.PureComponent { ) : null; - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { tabIndex, ...restDragHandleProps } = dragHandleProps || {}; const selected = activeSpaces.includes(space.roomId); diff --git a/apps/web/src/contexts/ScopedRoomContext.tsx b/apps/web/src/contexts/ScopedRoomContext.tsx index 1d5840d871..7bbd27b40c 100644 --- a/apps/web/src/contexts/ScopedRoomContext.tsx +++ b/apps/web/src/contexts/ScopedRoomContext.tsx @@ -58,7 +58,7 @@ const ScopedRoomContext = createContext | undefin // Uses react memo and leverages splatting the value to ensure that the context is only updated when the state changes (shallow compare) export const ScopedRoomContextProvider = memo( ({ children, ...state }: { children: ReactNode } & ContextValue): JSX.Element => { - // eslint-disable-next-line react-compiler/react-compiler,react-hooks/exhaustive-deps + // eslint-disable-next-line react-hooks/exhaustive-deps const context = useMemo(() => new EfficientContext(state), []); useEffect(() => { context.setState(state); diff --git a/apps/web/src/createRoom.ts b/apps/web/src/createRoom.ts index 0d28834e7f..d83db68304 100644 --- a/apps/web/src/createRoom.ts +++ b/apps/web/src/createRoom.ts @@ -51,8 +51,6 @@ import { SDKContextClass } from "./contexts/SDKContextClass.ts"; import SdkConfig from "./SdkConfig"; // we define a number of interfaces which take their names from the js-sdk -/* eslint-disable camelcase */ - export interface IOpts { dmUserId?: string; /** diff --git a/apps/web/src/dispatcher/dispatcher.ts b/apps/web/src/dispatcher/dispatcher.ts index 99c4555f5d..75f11803bb 100644 --- a/apps/web/src/dispatcher/dispatcher.ts +++ b/apps/web/src/dispatcher/dispatcher.ts @@ -80,7 +80,7 @@ export class MatrixDispatcher { /** * Dispatches a payload to all registered callbacks. */ - // eslint-disable-next-line @typescript-eslint/naming-convention + private _dispatch = (payload: ActionPayload): void => { invariant(!this.isDispatching(), "Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch."); this.startDispatching(payload); diff --git a/apps/web/src/dispatcher/payloads/AfterLeaveRoomPayload.ts b/apps/web/src/dispatcher/payloads/AfterLeaveRoomPayload.ts index 07e7c54ad2..a16e3bd198 100644 --- a/apps/web/src/dispatcher/payloads/AfterLeaveRoomPayload.ts +++ b/apps/web/src/dispatcher/payloads/AfterLeaveRoomPayload.ts @@ -13,6 +13,5 @@ import { type ActionPayload } from "../payloads"; export interface AfterLeaveRoomPayload extends ActionPayload { action: Action.AfterLeaveRoom; - // eslint-disable-next-line camelcase room_id?: Room["roomId"]; } diff --git a/apps/web/src/dispatcher/payloads/DoAfterSyncPreparedPayload.ts b/apps/web/src/dispatcher/payloads/DoAfterSyncPreparedPayload.ts index e73ebcfc01..0bf549618e 100644 --- a/apps/web/src/dispatcher/payloads/DoAfterSyncPreparedPayload.ts +++ b/apps/web/src/dispatcher/payloads/DoAfterSyncPreparedPayload.ts @@ -11,6 +11,5 @@ import { type Action } from "../actions"; export interface DoAfterSyncPreparedPayload extends Pick { action: Action.DoAfterSyncPrepared; - // eslint-disable-next-line camelcase deferred_action: T; } diff --git a/apps/web/src/dispatcher/payloads/JoinRoomPayload.ts b/apps/web/src/dispatcher/payloads/JoinRoomPayload.ts index ba5019be6c..e65a2a7303 100644 --- a/apps/web/src/dispatcher/payloads/JoinRoomPayload.ts +++ b/apps/web/src/dispatcher/payloads/JoinRoomPayload.ts @@ -12,7 +12,6 @@ import { type IJoinRoomOpts } from "matrix-js-sdk/src/matrix"; import { type ActionPayload } from "../payloads"; import { type Action } from "../actions"; -/* eslint-disable camelcase */ export interface JoinRoomPayload extends Pick { action: Action.JoinRoom; @@ -24,4 +23,3 @@ export interface JoinRoomPayload extends Pick { canAskToJoin?: boolean; } -/* eslint-enable camelcase */ diff --git a/apps/web/src/dispatcher/payloads/JoinRoomReadyPayload.ts b/apps/web/src/dispatcher/payloads/JoinRoomReadyPayload.ts index 516f5b4d5c..ba324f7c48 100644 --- a/apps/web/src/dispatcher/payloads/JoinRoomReadyPayload.ts +++ b/apps/web/src/dispatcher/payloads/JoinRoomReadyPayload.ts @@ -11,7 +11,6 @@ import { type JoinedRoom as JoinedRoomEvent } from "@matrix-org/analytics-events import { type ActionPayload } from "../payloads"; import { type Action } from "../actions"; -/* eslint-disable camelcase */ export interface JoinRoomReadyPayload extends Pick { action: Action.JoinRoomReady; roomId: string; @@ -19,4 +18,3 @@ export interface JoinRoomReadyPayload extends Pick { // additional parameters for the purpose of metrics & instrumentation metricsTrigger: JoinedRoomEvent["trigger"]; } -/* eslint-enable camelcase */ diff --git a/apps/web/src/dispatcher/payloads/ThreadPayload.ts b/apps/web/src/dispatcher/payloads/ThreadPayload.ts index ac74370afa..161eb78598 100644 --- a/apps/web/src/dispatcher/payloads/ThreadPayload.ts +++ b/apps/web/src/dispatcher/payloads/ThreadPayload.ts @@ -9,10 +9,8 @@ Please see LICENSE files in the repository root for full details. import { type ActionPayload } from "../payloads"; import { type Action } from "../actions"; -/* eslint-disable camelcase */ export interface ThreadPayload extends Pick { action: Action.ViewThread; thread_id: string | null; } -/* eslint-enable camelcase */ diff --git a/apps/web/src/dispatcher/payloads/ViewHomePagePayload.ts b/apps/web/src/dispatcher/payloads/ViewHomePagePayload.ts index c18d896ae4..4dbf7a38e2 100644 --- a/apps/web/src/dispatcher/payloads/ViewHomePagePayload.ts +++ b/apps/web/src/dispatcher/payloads/ViewHomePagePayload.ts @@ -11,7 +11,6 @@ import { type ActionPayload } from "../payloads"; export interface ViewHomePagePayload extends ActionPayload { action: Action.ViewHomePage; - // eslint-disable-next-line camelcase context_switch?: boolean; justRegistered?: boolean; } diff --git a/apps/web/src/dispatcher/payloads/ViewRoomErrorPayload.ts b/apps/web/src/dispatcher/payloads/ViewRoomErrorPayload.ts index d14dc5c6da..2108bf4a62 100644 --- a/apps/web/src/dispatcher/payloads/ViewRoomErrorPayload.ts +++ b/apps/web/src/dispatcher/payloads/ViewRoomErrorPayload.ts @@ -13,9 +13,7 @@ import { type Action } from "../actions"; export interface ViewRoomErrorPayload extends Pick { action: Action.ViewRoomError; - // eslint-disable-next-line camelcase room_id: Room["roomId"] | null; - // eslint-disable-next-line camelcase room_alias?: string; err?: MatrixError; } diff --git a/apps/web/src/dispatcher/payloads/ViewRoomPayload.ts b/apps/web/src/dispatcher/payloads/ViewRoomPayload.ts index c1dba33feb..f9d027e969 100644 --- a/apps/web/src/dispatcher/payloads/ViewRoomPayload.ts +++ b/apps/web/src/dispatcher/payloads/ViewRoomPayload.ts @@ -18,7 +18,6 @@ import { type AtLeastOne } from "../../@types/common"; export type FocusNextType = "composer" | "threadsPanel" | undefined; -/* eslint-disable camelcase */ interface BaseViewRoomPayload extends Pick { action: Action.ViewRoom; @@ -58,4 +57,3 @@ export type ViewRoomPayload = BaseViewRoomPayload & room_alias?: string; focusNext: FocusNextType; // wat to focus after room switch. Defaults to 'composer' if undefined. }>; -/* eslint-enable camelcase */ diff --git a/apps/web/src/dispatcher/payloads/ViewStartChatOrReusePayload.ts b/apps/web/src/dispatcher/payloads/ViewStartChatOrReusePayload.ts index 9a23d39505..1651f6e9f0 100644 --- a/apps/web/src/dispatcher/payloads/ViewStartChatOrReusePayload.ts +++ b/apps/web/src/dispatcher/payloads/ViewStartChatOrReusePayload.ts @@ -13,6 +13,5 @@ import { type Action } from "../actions"; export interface ViewStartChatOrReusePayload extends Pick { action: Action.ViewStartChatOrReuse; - // eslint-disable-next-line camelcase user_id: User["userId"]; } diff --git a/apps/web/src/hooks/useAsyncRefreshMemo.ts b/apps/web/src/hooks/useAsyncRefreshMemo.ts index 83e5be90e8..12f4360d04 100644 --- a/apps/web/src/hooks/useAsyncRefreshMemo.ts +++ b/apps/web/src/hooks/useAsyncRefreshMemo.ts @@ -34,7 +34,7 @@ export function useAsyncRefreshMemo(fn: Fn, deps: DependencyList, initialV return () => { discard = true; }; - }, deps); // eslint-disable-line react-hooks/exhaustive-deps,react-compiler/react-compiler + }, deps); // eslint-disable-line react-hooks/exhaustive-deps useEffect(refresh, [refresh]); return [value, refresh]; } diff --git a/apps/web/src/hooks/useEventEmitter.ts b/apps/web/src/hooks/useEventEmitter.ts index f5f2f6a82b..81cbe5a9ec 100644 --- a/apps/web/src/hooks/useEventEmitter.ts +++ b/apps/web/src/hooks/useEventEmitter.ts @@ -160,7 +160,7 @@ export function useEventEmitterAsyncState (echoChamber.notificationVolume = state), [echoChamber]); return [notificationState, setter]; }; diff --git a/apps/web/src/indexing/BaseEventIndexManager.ts b/apps/web/src/indexing/BaseEventIndexManager.ts index 9893dab429..8a1c85dbbb 100644 --- a/apps/web/src/indexing/BaseEventIndexManager.ts +++ b/apps/web/src/indexing/BaseEventIndexManager.ts @@ -14,7 +14,6 @@ import { } from "matrix-js-sdk/src/matrix"; // The following interfaces take their names and member names from seshat and the spec -/* eslint-disable camelcase */ /** A record of a place to resume crawling events in a given room. */ export interface ICrawlerCheckpoint { diff --git a/apps/web/src/mjolnir/Mjolnir.ts b/apps/web/src/mjolnir/Mjolnir.ts index 63059b3c04..f1f848bcb3 100644 --- a/apps/web/src/mjolnir/Mjolnir.ts +++ b/apps/web/src/mjolnir/Mjolnir.ts @@ -24,8 +24,8 @@ import { Action } from "../dispatcher/actions"; export class Mjolnir { private static instance?: Mjolnir; - private _lists: BanList[] = []; // eslint-disable-line @typescript-eslint/naming-convention - private _roomIds: string[] = []; // eslint-disable-line @typescript-eslint/naming-convention + private _lists: BanList[] = []; + private _roomIds: string[] = []; private mjolnirWatchRef?: string; private dispatcherRef?: string; diff --git a/apps/web/src/modules/Api.ts b/apps/web/src/modules/Api.ts index 24b9306b7e..0bd3e247bd 100644 --- a/apps/web/src/modules/Api.ts +++ b/apps/web/src/modules/Api.ts @@ -60,7 +60,6 @@ export class ModuleApi implements Api { return ModuleApi._instance; } - /* eslint-disable @typescript-eslint/naming-convention */ public async _registerLegacyModule(LegacyModule: RuntimeModuleConstructor): Promise { ModuleRunner.instance.registerModule((api) => new LegacyModule(api)); } @@ -80,7 +79,6 @@ export class ModuleApi implements Api { ) => void = legacyCustomisationsFactory(WidgetPermissionCustomisations); public readonly _registerLegacyWidgetVariablesCustomisations = legacyCustomisationsFactory(WidgetVariableCustomisations); - /* eslint-enable @typescript-eslint/naming-convention */ public readonly navigation = new NavigationApi(); public readonly openDialog = openDialog; diff --git a/apps/web/src/sentry.ts b/apps/web/src/sentry.ts index 7b3148d211..db9dd21a14 100644 --- a/apps/web/src/sentry.ts +++ b/apps/web/src/sentry.ts @@ -14,8 +14,6 @@ import { MatrixClientPeg } from "./MatrixClientPeg"; import SettingsStore from "./settings/SettingsStore"; import { type IConfigOptions } from "./IConfigOptions"; -/* eslint-disable camelcase */ - type StorageContext = { storageManager_persisted?: string; storageManager_quota?: string; @@ -58,8 +56,6 @@ type Contexts = { storage: StorageContext; }; -/* eslint-enable camelcase */ - async function getStorageContext(): Promise { const result: StorageContext = {}; diff --git a/apps/web/src/stores/OwnBeaconStore.ts b/apps/web/src/stores/OwnBeaconStore.ts index 68a4b6d6a6..c56d8540f5 100644 --- a/apps/web/src/stores/OwnBeaconStore.ts +++ b/apps/web/src/stores/OwnBeaconStore.ts @@ -426,7 +426,6 @@ export class OwnBeaconStore extends AsyncStoreWithClient { const existingLiveBeaconIdsForRoom = this.getLiveBeaconIds(roomId); await Promise.all(existingLiveBeaconIdsForRoom.map((beaconId) => this.stopBeacon(beaconId))); - // eslint-disable-next-line camelcase const { event_id } = await doMaybeLocalRoomAction( roomId, (actualRoomId: string) => this.matrixClient!.unstable_createLiveBeacon(actualRoomId, beaconInfoContent), diff --git a/apps/web/src/stores/RoomViewStore.tsx b/apps/web/src/stores/RoomViewStore.tsx index 9dadd8a34d..407213d4d0 100644 --- a/apps/web/src/stores/RoomViewStore.tsx +++ b/apps/web/src/stores/RoomViewStore.tsx @@ -209,7 +209,7 @@ export class RoomViewStore extends EventEmitter { if (this.lockedToRoomId && payload.room_id && this.lockedToRoomId !== payload.room_id) { return; } - // eslint-disable-line @typescript-eslint/naming-convention + switch (payload.action) { // view_room: // - room_alias: '#somealias:matrix.org' diff --git a/apps/web/src/stores/ThreepidInviteStore.ts b/apps/web/src/stores/ThreepidInviteStore.ts index 271d75b130..57f90a56c0 100644 --- a/apps/web/src/stores/ThreepidInviteStore.ts +++ b/apps/web/src/stores/ThreepidInviteStore.ts @@ -15,13 +15,13 @@ import { type RoomType } from "matrix-js-sdk/src/matrix"; export interface IThreepidInviteWireFormat { email: string; signurl: string; - room_name: string; // eslint-disable-line camelcase - room_avatar_url: string; // eslint-disable-line camelcase - inviter_name: string; // eslint-disable-line camelcase + room_name: string; + room_avatar_url: string; + inviter_name: string; // TODO: Figure out if these are ever populated - guest_access_token?: string; // eslint-disable-line camelcase - guest_user_id?: string; // eslint-disable-line camelcase + guest_access_token?: string; + guest_user_id?: string; } interface IPersistedThreepidInvite extends IThreepidInviteWireFormat { @@ -46,7 +46,6 @@ export interface IOOBData { name?: string; // The room's name avatarUrl?: string; // The mxc:// avatar URL for the room inviterName?: string; // The display name of the person who invited us to the room - // eslint-disable-next-line camelcase room_name?: string; // The name of the room, to be used until we are told better by the server roomType?: RoomType | string; // The type of the room, to be used until we are told better by the server } diff --git a/apps/web/src/stores/VoiceRecordingStore.ts b/apps/web/src/stores/VoiceRecordingStore.ts index 20ad092484..5991c689d6 100644 --- a/apps/web/src/stores/VoiceRecordingStore.ts +++ b/apps/web/src/stores/VoiceRecordingStore.ts @@ -84,11 +84,7 @@ export class VoiceRecordingStore extends AsyncStoreWithClient { public disposeRecording(voiceRecordingId: string): Promise { this.state[voiceRecordingId]?.destroy(); // stops internally - const { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - [voiceRecordingId]: _toDelete, - ...newState - } = this.state; + const { [voiceRecordingId]: _toDelete, ...newState } = this.state; // unexpectedly AsyncStore.updateState merges state // AsyncStore.reset actually just *sets* return this.reset(newState); diff --git a/apps/web/src/stores/message-preview/MessagePreviewStore.ts b/apps/web/src/stores/message-preview/MessagePreviewStore.ts index fdf59dafde..0f9b074757 100644 --- a/apps/web/src/stores/message-preview/MessagePreviewStore.ts +++ b/apps/web/src/stores/message-preview/MessagePreviewStore.ts @@ -39,7 +39,7 @@ const ROOM_PREVIEW_CHANGED = "room_preview_changed"; const MAX_EVENTS_BACKWARDS = 50; // type merging ftw -type TAG_ANY = "im.vector.any"; // eslint-disable-line @typescript-eslint/naming-convention +type TAG_ANY = "im.vector.any"; const TAG_ANY: TAG_ANY = "im.vector.any"; export interface MessagePreview { diff --git a/apps/web/src/stores/widgets/ElementWidgetActions.ts b/apps/web/src/stores/widgets/ElementWidgetActions.ts index c7bcfcd8cd..0db59e986b 100644 --- a/apps/web/src/stores/widgets/ElementWidgetActions.ts +++ b/apps/web/src/stores/widgets/ElementWidgetActions.ts @@ -56,6 +56,6 @@ export interface IHangupCallApiRequest extends IWidgetApiRequest { */ export interface IViewRoomApiRequest extends IWidgetApiRequest { data: { - room_id: string; // eslint-disable-line camelcase + room_id: string; }; } diff --git a/apps/web/src/theme.ts b/apps/web/src/theme.ts index 4bd3ea322d..5dbd5142bc 100644 --- a/apps/web/src/theme.ts +++ b/apps/web/src/theme.ts @@ -47,7 +47,7 @@ interface CompoundTheme { export type CustomTheme = { name: string; - is_dark?: boolean; // eslint-disable-line camelcase + is_dark?: boolean; colors?: { [key: string]: string; }; diff --git a/apps/web/src/utils/FixedRollingArray.test.ts b/apps/web/src/utils/FixedRollingArray.test.ts index ecface8c79..7b1c0d54a9 100644 --- a/apps/web/src/utils/FixedRollingArray.test.ts +++ b/apps/web/src/utils/FixedRollingArray.test.ts @@ -50,10 +50,8 @@ describe("FixedRollingArray", () => { expect(previous - current).toBe(1); if (i === 1) { - // eslint-disable-next-line jest/no-conditional-expect expect(previous).toBe(maxValue); } else if (i === width) { - // eslint-disable-next-line jest/no-conditional-expect expect(current).toBe(minValue); } } diff --git a/apps/web/src/utils/MegolmExportEncryption.ts b/apps/web/src/utils/MegolmExportEncryption.ts index b7a5cc3bff..deed2a73a9 100644 --- a/apps/web/src/utils/MegolmExportEncryption.ts +++ b/apps/web/src/utils/MegolmExportEncryption.ts @@ -108,7 +108,7 @@ export async function decryptMegolmKeyFile(data: ArrayBuffer, password: string): export async function encryptMegolmKeyFile( data: string, password: string, - options?: { kdf_rounds?: number }, // eslint-disable-line camelcase + options?: { kdf_rounds?: number }, ): Promise { options = options || {}; const kdfRounds = options.kdf_rounds || 500000; diff --git a/apps/web/src/utils/SessionLock.ts b/apps/web/src/utils/SessionLock.ts index afa18c2644..096f5d1fb5 100644 --- a/apps/web/src/utils/SessionLock.ts +++ b/apps/web/src/utils/SessionLock.ts @@ -217,7 +217,6 @@ export async function getSessionLock(onNewInstance: () => Promise): Promis window.localStorage.setItem(SESSION_LOCK_CONSTANTS.STORAGE_ITEM_CLAIMANT, sessionIdentifier); // now, wait for the lock to be free. - // eslint-disable-next-line no-constant-condition while (true) { const remaining = checkLock(); diff --git a/apps/web/src/utils/SnakedObject.test.ts b/apps/web/src/utils/SnakedObject.test.ts index ad649ddba2..1324d64dd9 100644 --- a/apps/web/src/utils/SnakedObject.test.ts +++ b/apps/web/src/utils/SnakedObject.test.ts @@ -33,14 +33,12 @@ describe("snakeToCamel", () => { }); describe("SnakedObject", () => { - /* eslint-disable camelcase*/ const input = { snake_case: "woot", snakeCase: "oh no", // ensure different value from snake_case for tests camelCase: "fallback", }; const snake = new SnakedObject(input); - /* eslint-enable camelcase*/ it("should prefer snake_case keys", () => { expect(snake.get("snake_case")).toBe(input.snake_case); diff --git a/apps/web/src/utils/WellKnownUtils.ts b/apps/web/src/utils/WellKnownUtils.ts index f1e093b66a..e3af4116e8 100644 --- a/apps/web/src/utils/WellKnownUtils.ts +++ b/apps/web/src/utils/WellKnownUtils.ts @@ -15,7 +15,6 @@ const E2EE_WK_KEY_DEPRECATED = "im.vector.riot.e2ee"; export const TILE_SERVER_WK_KEY = new UnstableValue("m.tile_server", "org.matrix.msc3488.tile_server"); const EMBEDDED_PAGES_WK_PROPERTY = "io.element.embedded_pages"; -/* eslint-disable camelcase */ export interface ICallBehaviourWellKnown { widget_build_url?: string; ignore_dm?: boolean; @@ -39,7 +38,6 @@ export interface ITileServerWellKnown { export interface IEmbeddedPagesWellKnown { home_url?: string; } -/* eslint-enable camelcase */ export function getCallBehaviourWellKnown(matrixClient: MatrixClient): ICallBehaviourWellKnown { const clientWellKnown = matrixClient.getClientWellKnown(); diff --git a/apps/web/src/utils/WidgetUtils-types.ts b/apps/web/src/utils/WidgetUtils-types.ts index 374b37632f..0e5129c4a7 100644 --- a/apps/web/src/utils/WidgetUtils-types.ts +++ b/apps/web/src/utils/WidgetUtils-types.ts @@ -12,7 +12,6 @@ import { type IWidget } from "matrix-widget-api"; export interface IApp extends IWidget { "roomId": string; "eventId"?: string; // not present on virtual widgets - // eslint-disable-next-line camelcase "avatar_url"?: string; // MSC2765 https://github.com/matrix-org/matrix-doc/pull/2765 // Whether the widget was created from `widget_build_url` and thus is a call widget of some kind "io.element.managed_hybrid"?: boolean; @@ -22,7 +21,6 @@ export interface IWidgetEvent { id: string; type: string; sender: string; - // eslint-disable-next-line camelcase state_key: string; content: IApp; } diff --git a/apps/web/src/utils/device/parseUserAgent.test.ts b/apps/web/src/utils/device/parseUserAgent.test.ts index 1c7b080843..6799e1c02f 100644 --- a/apps/web/src/utils/device/parseUserAgent.test.ts +++ b/apps/web/src/utils/device/parseUserAgent.test.ts @@ -23,7 +23,6 @@ const makeDeviceExtendedInfo = ( client: clientName && [clientName, clientVersion].filter(Boolean).join(" "), }); -/* eslint-disable max-len */ const ANDROID_UA = [ // New User Agent Implementation "Element dbg/1.5.0-dev (Xiaomi Mi 9T; Android 11; RKQ1.200826.002 test-keys; Flavour GooglePlay; MatrixAndroidSdk2 1.5.2)", @@ -108,7 +107,6 @@ const MISC_EXPECTED_RESULT = [ makeDeviceExtendedInfo(DeviceType.Unknown, undefined, undefined, undefined, undefined), makeDeviceExtendedInfo(DeviceType.Unknown, undefined, undefined, undefined, undefined), ]; -/* eslint-disable max-len */ describe("parseUserAgent()", () => { it("returns deviceType unknown when user agent is falsy", () => { diff --git a/apps/web/src/utils/direct-messages.ts b/apps/web/src/utils/direct-messages.ts index e1e518421d..862daf6dde 100644 --- a/apps/web/src/utils/direct-messages.ts +++ b/apps/web/src/utils/direct-messages.ts @@ -119,7 +119,6 @@ export class DirectoryMember extends Member { private readonly displayName?: string; private readonly avatarUrl?: string; - // eslint-disable-next-line camelcase public constructor(userDirResult: { user_id: string; display_name?: string; avatar_url?: string }) { super(); this._userId = userDirResult.user_id; diff --git a/apps/web/src/utils/membership.ts b/apps/web/src/utils/membership.ts index 79d54cd658..73038ba45d 100644 --- a/apps/web/src/utils/membership.ts +++ b/apps/web/src/utils/membership.ts @@ -94,7 +94,6 @@ export async function waitForMember( } return new Promise((resolve) => { - // eslint-disable-next-line @typescript-eslint/naming-convention handler = function (_, __, member: RoomMember) { if (member.userId !== userId) return; if (member.roomId !== roomId) return; diff --git a/apps/web/src/utils/pushRules/monitorSyncedPushRules.ts b/apps/web/src/utils/pushRules/monitorSyncedPushRules.ts index 0e9620fe13..72c939a1e2 100644 --- a/apps/web/src/utils/pushRules/monitorSyncedPushRules.ts +++ b/apps/web/src/utils/pushRules/monitorSyncedPushRules.ts @@ -68,7 +68,6 @@ const monitorSyncedRule = async ( if (outOfSyncRules.length) { await updateExistingPushRulesWithActions( matrixClient, - // eslint-disable-next-line camelcase, @typescript-eslint/naming-convention outOfSyncRules.map(({ rule_id }) => rule_id), primaryRule.enabled ? primaryRule.actions : undefined, ); diff --git a/apps/web/src/utils/tokens/tokens.ts b/apps/web/src/utils/tokens/tokens.ts index 4e7a252b50..0d3b7555a7 100644 --- a/apps/web/src/utils/tokens/tokens.ts +++ b/apps/web/src/utils/tokens/tokens.ts @@ -52,7 +52,6 @@ async function pickleKeyToAesKey(pickleKey: string): Promise { // with some basic styling to make the iframe full page document.body.style.removeProperty("height"); const iframe = document.createElement("iframe"); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - typescript seems to only like the IE syntax for iframe sandboxing iframe["sandbox"] = ""; iframe.src = supportedBrowser ? "static/unable-to-load.html" : "static/incompatible-browser.html"; diff --git a/apps/web/src/vector/jitsi/index.ts b/apps/web/src/vector/jitsi/index.ts index c90dbc8657..bcfb6a49e4 100644 --- a/apps/web/src/vector/jitsi/index.ts +++ b/apps/web/src/vector/jitsi/index.ts @@ -392,7 +392,6 @@ async function joinConference(audioInput?: string | null, videoInput?: string | logger.log("Got OpenID Connect token"); if (!openIdToken?.access_token) { - // eslint-disable-line camelcase // We've failing to get a token, don't try to init conference logger.warn("Expected to have an OpenID credential, cannot initialize widget."); document.getElementById("widgetActionContainer")!.innerText = "Failed to load Jitsi widget"; diff --git a/apps/web/src/viewmodels/room/timeline/event-tile/call/tiles/ongoing/BaseOngoingCallTileViewModel.test.ts b/apps/web/src/viewmodels/room/timeline/event-tile/call/tiles/ongoing/BaseOngoingCallTileViewModel.test.ts index c0b5398165..29c9a3509e 100644 --- a/apps/web/src/viewmodels/room/timeline/event-tile/call/tiles/ongoing/BaseOngoingCallTileViewModel.test.ts +++ b/apps/web/src/viewmodels/room/timeline/event-tile/call/tiles/ongoing/BaseOngoingCallTileViewModel.test.ts @@ -154,7 +154,7 @@ describe("BaseOngoingCallViewModel", () => { const vm = new BaseOngoingCallViewModel({ mxEvent, cli, callStore, roomId, legacyCallHandler }); vm.join(); - const [_, room, callType, platformCallType] = vi.mocked(placeCall).mock.calls[0]; + const [, room, callType, platformCallType] = vi.mocked(placeCall).mock.calls[0]; expect(room.roomId).toStrictEqual(roomId); expect(callType).toStrictEqual(CallType.Video); expect(platformCallType).toStrictEqual(PlatformCallType.ElementCall); diff --git a/apps/web/src/widgets/CapabilityText.tsx b/apps/web/src/widgets/CapabilityText.tsx index 5f5c8b9a74..02b5923979 100644 --- a/apps/web/src/widgets/CapabilityText.tsx +++ b/apps/web/src/widgets/CapabilityText.tsx @@ -26,7 +26,7 @@ import { ElementWidgetCapabilities } from "../stores/widgets/ElementWidgetCapabi import { MatrixClientPeg } from "../MatrixClientPeg"; import TextWithTooltip from "../components/views/elements/TextWithTooltip"; -type GENERIC_WIDGET_KIND = "generic"; // eslint-disable-line @typescript-eslint/naming-convention +type GENERIC_WIDGET_KIND = "generic"; const GENERIC_WIDGET_KIND: GENERIC_WIDGET_KIND = "generic"; type SendRecvStaticCapText = Partial< diff --git a/apps/web/src/widgets/ManagedHybrid.ts b/apps/web/src/widgets/ManagedHybrid.ts index b1a67db4fb..7c71e1b52d 100644 --- a/apps/web/src/widgets/ManagedHybrid.ts +++ b/apps/web/src/widgets/ManagedHybrid.ts @@ -18,13 +18,11 @@ import WidgetStore, { type IApp } from "../stores/WidgetStore"; import SdkConfig from "../SdkConfig"; import { getJoinedNonFunctionalMembers } from "../utils/room/getJoinedNonFunctionalMembers"; -/* eslint-disable camelcase */ interface IManagedHybridWidgetData { widget_id: string; widget: IWidget; layout: IStoredLayout; } -/* eslint-enable camelcase */ function getWidgetBuildUrl(room: Room): string | undefined { const functionalMembers = getJoinedNonFunctionalMembers(room); @@ -40,7 +38,6 @@ function getWidgetBuildUrl(room: Room): string | undefined { if (isDm && wellKnown?.ignore_dm) { return undefined; } - /* eslint-disable-next-line camelcase */ return wellKnown?.widget_build_url; } @@ -56,7 +53,6 @@ export async function addManagedHybridWidget(room: Room): Promise { } // Get widget data - /* eslint-disable-next-line camelcase */ const widgetBuildUrl = getWidgetBuildUrl(room); if (!widgetBuildUrl) { return; diff --git a/apps/web/test/setupTests.ts b/apps/web/test/setupTests.ts index 10079fa141..e700869f08 100644 --- a/apps/web/test/setupTests.ts +++ b/apps/web/test/setupTests.ts @@ -16,7 +16,6 @@ import { PredictableRandom } from "./test-utils/predictableRandom"; import * as rageshake from "../src/rageshake/rageshake"; declare global { - // eslint-disable-next-line no-var var IS_REACT_ACT_ENVIRONMENT: boolean; } diff --git a/apps/web/test/test-utils/test-utils.ts b/apps/web/test/test-utils/test-utils.ts index 4066c78370..0e68494647 100644 --- a/apps/web/test/test-utils/test-utils.ts +++ b/apps/web/test/test-utils/test-utils.ts @@ -417,7 +417,6 @@ type MakeEventProps = MakeEventPassThruProps & { redacts?: string; content: IContent; room?: Room["roomId"]; // to-device messages are roomless - // eslint-disable-next-line camelcase prev_content?: IContent; unsigned?: IUnsigned; status?: EventStatus; diff --git a/apps/web/test/unit-tests/components/structures/PictureInPictureDragger-test.tsx b/apps/web/test/unit-tests/components/structures/PictureInPictureDragger-test.tsx index 424a396820..2a0df98df2 100644 --- a/apps/web/test/unit-tests/components/structures/PictureInPictureDragger-test.tsx +++ b/apps/web/test/unit-tests/components/structures/PictureInPictureDragger-test.tsx @@ -84,7 +84,6 @@ describe("PictureInPictureDragger", () => { {[ ({ onStartMoving }) => ( - // eslint-disable-next-line jsx-a11y/click-events-have-key-events
Hello
diff --git a/apps/web/test/unit-tests/components/views/elements/Pill-test.tsx b/apps/web/test/unit-tests/components/views/elements/Pill-test.tsx index 79251c9687..3602ac6aab 100644 --- a/apps/web/test/unit-tests/components/views/elements/Pill-test.tsx +++ b/apps/web/test/unit-tests/components/views/elements/Pill-test.tsx @@ -62,7 +62,6 @@ describe("", () => { } as PillProps; // wrap Pill with a div to allow testing of event bubbling renderResult = render( - // eslint-disable-next-line jsx-a11y/click-events-have-key-events
diff --git a/apps/web/test/unit-tests/components/views/rooms/MessageComposer-test.tsx b/apps/web/test/unit-tests/components/views/rooms/MessageComposer-test.tsx index 2014a820d7..69acf344f3 100644 --- a/apps/web/test/unit-tests/components/views/rooms/MessageComposer-test.tsx +++ b/apps/web/test/unit-tests/components/views/rooms/MessageComposer-test.tsx @@ -214,10 +214,8 @@ describe("MessageComposer", () => { it(`should${value ? "" : " not"} display the button`, () => { if (value) { - // eslint-disable-next-line jest/no-conditional-expect expect(screen.getByLabelText(buttonLabel)).toBeInTheDocument(); } else { - // eslint-disable-next-line jest/no-conditional-expect expect(screen.queryByLabelText(buttonLabel)).not.toBeInTheDocument(); } }); @@ -240,10 +238,8 @@ describe("MessageComposer", () => { it(`should${!value || "not"} display the button`, () => { if (!value) { - // eslint-disable-next-line jest/no-conditional-expect expect(screen.getByLabelText(buttonLabel)).toBeInTheDocument(); } else { - // eslint-disable-next-line jest/no-conditional-expect expect(screen.queryByLabelText(buttonLabel)).not.toBeInTheDocument(); } }); diff --git a/apps/web/test/unit-tests/components/views/rooms/wysiwyg_composer/SendWysiwygComposer-test.tsx b/apps/web/test/unit-tests/components/views/rooms/wysiwyg_composer/SendWysiwygComposer-test.tsx index 0116c6e8e3..1b9df3bcf1 100644 --- a/apps/web/test/unit-tests/components/views/rooms/wysiwyg_composer/SendWysiwygComposer-test.tsx +++ b/apps/web/test/unit-tests/components/views/rooms/wysiwyg_composer/SendWysiwygComposer-test.tsx @@ -347,10 +347,8 @@ describe("SendWysiwygComposer", () => { expect(leftIcon).toBeInTheDocument(); expect(leftIcon).toHaveClass("mx_E2EIcon"); if (expectedLabel) { - // eslint-disable-next-line jest/no-conditional-expect expect(leftIcon).toHaveAccessibleName(expectedLabel); } else { - // eslint-disable-next-line jest/no-conditional-expect expect(leftIcon.querySelector("svg")).not.toBeInTheDocument(); } }); diff --git a/apps/web/test/unit-tests/components/views/rooms/wysiwyg_composer/components/WysiwygComposer-test.tsx b/apps/web/test/unit-tests/components/views/rooms/wysiwyg_composer/components/WysiwygComposer-test.tsx index f2fa9ef884..e585e551a6 100644 --- a/apps/web/test/unit-tests/components/views/rooms/wysiwyg_composer/components/WysiwygComposer-test.tsx +++ b/apps/web/test/unit-tests/components/views/rooms/wysiwyg_composer/components/WysiwygComposer-test.tsx @@ -536,7 +536,6 @@ describe("WysiwygComposer", () => { await waitFor(() => { const selection = document.getSelection(); if (selection) { - // eslint-disable-next-line jest/no-conditional-expect expect(selection.focusNode?.textContent).toEqual("other"); } }); diff --git a/apps/web/test/unit-tests/components/views/spaces/SpacePanel-test.tsx b/apps/web/test/unit-tests/components/views/spaces/SpacePanel-test.tsx index 7f7e4212e8..3ad77ec2a2 100644 --- a/apps/web/test/unit-tests/components/views/spaces/SpacePanel-test.tsx +++ b/apps/web/test/unit-tests/components/views/spaces/SpacePanel-test.tsx @@ -53,7 +53,6 @@ const createTransitionEndEvent = (): Event => { // TransitionEvent constructor does not exist. // This is needed because of the following check // https://github.com/atlassian/react-beautiful-dnd/blob/master/src/view/draggable/draggable.jsx#L130 - // eslint-disable-next-line @typescript-eslint/no-explicit-any (event as any).propertyName = "transform"; return event; diff --git a/apps/web/test/unit-tests/utils/StorageManager-test.ts b/apps/web/test/unit-tests/utils/StorageManager-test.ts index e612471d24..c02fc5d73f 100644 --- a/apps/web/test/unit-tests/utils/StorageManager-test.ts +++ b/apps/web/test/unit-tests/utils/StorageManager-test.ts @@ -65,7 +65,6 @@ describe("StorageManager", () => { beforeEach(async () => { await populateHealthySession(); - // eslint-disable-next-line no-global-assign indexedDB = new IDBFactory(); }); @@ -109,13 +108,11 @@ describe("StorageManager", () => { }); it("should not be healthy if no indexeddb", async () => { - // eslint-disable-next-line no-global-assign indexedDB = {} as IDBFactory; const result = await StorageManager.checkConsistency(); expect(result.healthy).toBe(false); - // eslint-disable-next-line no-global-assign indexedDB = new IDBFactory(); }); }); diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index f8e0d39ed7..79be407b94 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details. import { withMermaid } from "vitepress-plugin-mermaid"; -function customPathResolver(href: string, currentPath: string) { +function customPathResolver(href: string, currentPath: string): string { const [link, fragment] = href.split("#", 2); if (currentPath === "index.md") { if (link.startsWith("./docs/")) { diff --git a/modules/banner/src/theme.ts b/modules/banner/src/theme.ts index 5a13f27b9f..3c715a955b 100644 --- a/modules/banner/src/theme.ts +++ b/modules/banner/src/theme.ts @@ -27,6 +27,5 @@ export const Theme = z.object({ export type Theme = z.infer; declare module "styled-components" { - // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface DefaultTheme extends Theme {} } diff --git a/oxlint.config.ts b/oxlint.config.ts index 4e457e6190..e2ccc77558 100644 --- a/oxlint.config.ts +++ b/oxlint.config.ts @@ -41,7 +41,7 @@ export default defineConfig({ }, options: { typeAware: true, - reportUnusedDisableDirectives: "off", + reportUnusedDisableDirectives: "warn", maxWarnings: 0, denyWarnings: true, }, @@ -94,6 +94,15 @@ export default defineConfig({ ], "prefer-const": ["error", { destructuring: "all" }], "import/first": "error", + "typescript/no-require-imports": "error", + "new-cap": "error", + "no-empty-pattern": "error", + "typescript/no-unsafe-function-type": "error", + "react/rules-of-hooks": "error", + "no-extend-native": "error", + "no-inner-declarations": "error", + "no-var": "error", + "typescript/no-unnecessary-type-constraint": "error", "unicorn/no-instanceof-array": "error", "no-restricted-globals": ["error", ...defaultRestrictedGlobals], @@ -108,11 +117,16 @@ export default defineConfig({ // Allow the use of underscore to show args are not used. // This is helpful for seeing that a function implements // an interface but won't be using one of it's arguments. - "typescript/no-unused-vars": ["error", { args: "none", ignoreRestSiblings: true }], + "no-unused-vars": ["error", { args: "none", ignoreRestSiblings: true }], - // Disable some rules here, but they are enabled for src - "typescript/explicit-function-return-type": "off", - "typescript/explicit-member-accessibility": "off", + // Require method signatures to be explicit to help make signature changes more obvious in review + "typescript/explicit-function-return-type": [ + "error", + { + allowExpressions: true, + }, + ], + "typescript/explicit-member-accessibility": "error", // Require us to be more explicit about type conversions to help prevent bugs "typescript/no-base-to-string": ["error"], @@ -146,8 +160,6 @@ export default defineConfig({ "typescript/no-redundant-type-constituents": "off", "typescript/no-useless-default-assignment": "off", "typescript/no-duplicate-type-constituents": "off", - "no-unused-vars": "off", - "eslint/no-unused-vars": "off", "typescript/no-floating-promises": "off", "typescript/no-implied-eval": "off", "typescript/no-misused-spread": "off", @@ -174,7 +186,71 @@ export default defineConfig({ }, overrides: [ { - files: ["apps/web/src/**/*"], + files: ["apps/web/src/**/*", "{packages,modules}/*/src/**/*"], + rules: { + "no-restricted-globals": [ + "error", + defaultRestrictedGlobals, + { + name: "Buffer", + message: "Buffer is not available in the web.", + }, + ], + }, + }, + { + files: ["{packages,apps,modules}/*/src/**/*"], + rules: { + "no-restricted-imports": [ + "error", + { + name: "events", + message: "Please use TypedEventEmitter instead", + }, + ], + + // Enable this in the future, it has a lot of false positives right now + // "react/react-compiler": "error", + }, + }, + { + files: ["packages/shared-components/**/*"], + rules: { + "no-restricted-imports": [ + "error", + { + paths: [ + { + name: "react", + importNames: ["act"], + message: "Please use @test-utils instead.", + }, + { + name: "@testing-library/react", + message: "Please use @test-utils instead", + }, + ], + }, + ], + + // This would be good to apply globally in the future + "react/forbid-elements": [ + "error", + { + forbid: [ + { element: "h1", message: "Use Compound instead" }, + { element: "h2", message: "Use Compound instead" }, + { element: "h3", message: "Use Compound instead" }, + { element: "h4", message: "Use Compound instead" }, + { element: "h5", message: "Use Compound instead" }, + { element: "h6", message: "Use Compound instead" }, + ], + }, + ], + }, + }, + { + files: ["apps/web/**/*"], rules: { "no-restricted-properties": [ "error", @@ -306,78 +382,24 @@ export default defineConfig({ }, }, { - files: ["apps/web/src/**/*", "{packages,modules}/*/src/**/*"], + files: [ + "apps/*/playwright/**/*", + "packages/playwright-common/**/*", + "modules/*/e2e/**/*", + "modules/playwright/**/*", + ], rules: { - "no-restricted-globals": [ - "error", - defaultRestrictedGlobals, - { - name: "Buffer", - message: "Buffer is not available in the web.", - }, - ], - }, - }, - { - files: ["packages/shared-components/**/*"], - rules: { - "no-restricted-imports": [ - "error", - { - paths: [ - { - name: "react", - importNames: ["act"], - message: "Please use @test-utils instead.", - }, - ], - }, - ], - - // This would be good to apply globally in the future - "react/forbid-elements": [ - "error", - { - forbid: [ - { element: "h1", message: "Use Compound instead" }, - { element: "h2", message: "Use Compound instead" }, - { element: "h3", message: "Use Compound instead" }, - { element: "h4", message: "Use Compound instead" }, - { element: "h5", message: "Use Compound instead" }, - { element: "h6", message: "Use Compound instead" }, - ], - }, - ], - }, - }, - { - files: ["{packages,apps,modules/*/src/**/*"], - rules: { - "no-console": "error", - // Require method signatures to be explicit to help make signature changes more obvious in review - "typescript/explicit-function-return-type": [ - "error", - { - allowExpressions: true, - }, - ], - "typescript/explicit-member-accessibility": "error", - - "no-restricted-imports": [ - "error", - { - name: "events", - message: "Please use TypedEventEmitter instead", - }, - ], - - "react/react-compiler": "error", + // This is a common pattern for Playwright fixtures + "no-empty-pattern": "off", + // Playwright has a `use` method for fixtures which confuses this rule + "react-hooks/rules-of-hooks": "off", }, }, { files: [ "{packages,apps,modules}/*/src/**/*.{test,stories}.{ts,tsx}", - "{packages,apps,modules}/*/src/{tests,__mocks__}/*.{ts,tsx}", + "{packages,apps,modules}/*/src/{tests,test}/*.{ts,tsx}", + "{packages,apps,modules}/*/src/**/__mocks__/*.{ts,tsx}", "{packages,apps,modules}/*/{test,playwright,e2e}/**/*", "{packages,apps,modules}/*/playwright.config.ts", "{packages,apps,modules}/*/.storybook/**/*", @@ -386,7 +408,6 @@ export default defineConfig({ rules: { // Tests can be linted a little more flexibly // We don't need super strict typing in test utilities - "no-empty-pattern": "off", "no-import-assign": "off", "no-unsafe-optional-chaining": "off", "typescript/no-empty-object-type": "off", @@ -412,6 +433,8 @@ export default defineConfig({ }, ], "jsdoc/check-tag-names": "off", + "typescript/explicit-function-return-type": "off", + "typescript/explicit-member-accessibility": "off", // Disable a11y rules for components in tests "jsx-a11y/role-has-required-aria-props": "off", @@ -446,6 +469,12 @@ export default defineConfig({ "storybook/no-uninstalled-addons": "error", }, }, + { + files: ["**/*.{cjs,js}"], + rules: { + "typescript/no-require-imports": "off", + }, + }, ], }); diff --git a/packages/module-api/src/@types/global.d.ts b/packages/module-api/src/@types/global.d.ts index 82ae781eb5..07eea17458 100644 --- a/packages/module-api/src/@types/global.d.ts +++ b/packages/module-api/src/@types/global.d.ts @@ -6,7 +6,6 @@ Please see LICENSE files in the repository root for full details. */ declare global { - // eslint-disable-next-line no-var var __VERSION__: string; // injected by vite } diff --git a/packages/module-api/src/api/legacy-modules.ts b/packages/module-api/src/api/legacy-modules.ts index baaad96b01..a2418c8aa6 100644 --- a/packages/module-api/src/api/legacy-modules.ts +++ b/packages/module-api/src/api/legacy-modules.ts @@ -5,7 +5,6 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore -- optional interface, will gracefully degrade to `any` if `react-sdk-module-api` isn't installed import type { ModuleApi, RuntimeModule } from "@matrix-org/react-sdk-module-api"; @@ -19,7 +18,6 @@ export type RuntimeModuleConstructor = new (api: ModuleApi) => RuntimeModule; * @alpha * @deprecated in favour of the new module API */ -/* eslint-disable @typescript-eslint/naming-convention */ export interface LegacyModuleApiExtension { /** * Register a legacy module based on \@matrix-org/react-sdk-module-api diff --git a/packages/playwright-common/src/fixtures/services.ts b/packages/playwright-common/src/fixtures/services.ts index de5e9af680..3dcdf12e21 100644 --- a/packages/playwright-common/src/fixtures/services.ts +++ b/packages/playwright-common/src/fixtures/services.ts @@ -84,7 +84,6 @@ export interface Services { export const test = base.extend({ logger: [ - // eslint-disable-next-line no-empty-pattern async ({}, use) => { const logger = new Logger(); await use(logger); @@ -92,7 +91,6 @@ export const test = base.extend({ { scope: "worker" }, ], network: [ - // eslint-disable-next-line no-empty-pattern async ({}, use) => { const network = await new Network().start(); await use(network); @@ -152,7 +150,6 @@ export const test = base.extend({ { scope: "worker" }, ], mas: [ - // eslint-disable-next-line no-empty-pattern async ({}, use) => { // we stub the mas fixture to allow `homeserver` to depend on it to ensure // when it is specified by `masHomeserver` it is started before the homeserver diff --git a/packages/shared-components/.storybook/languageAddon.tsx b/packages/shared-components/.storybook/languageAddon.tsx index fb5c13ab06..c2161d6c76 100644 --- a/packages/shared-components/.storybook/languageAddon.tsx +++ b/packages/shared-components/.storybook/languageAddon.tsx @@ -24,6 +24,7 @@ export const languageAddon: Addon = { title: "Language Selector", type: types.TOOL, render: ({ active }) => { + // oxlint-disable-next-line react-hooks/rules-of-hooks const [globals, updateGlobals] = useGlobals(); const selectedLanguage = globals.language || "en"; diff --git a/packages/shared-components/src/core/roving/RovingTabIndex.tsx b/packages/shared-components/src/core/roving/RovingTabIndex.tsx index 42055714a3..cdb56821a2 100644 --- a/packages/shared-components/src/core/roving/RovingTabIndex.tsx +++ b/packages/shared-components/src/core/roving/RovingTabIndex.tsx @@ -605,7 +605,6 @@ export const useRovingTabIndex = ( }); }, []); // eslint-disable-line react-hooks/exhaustive-deps - // eslint-disable-next-line react-compiler/react-compiler const isActive = context.state.activeNode === nodeRef.current; return [onFocus, isActive, ref, nodeRef]; }; diff --git a/packages/shared-components/src/core/utils/Flex/Flex.tsx b/packages/shared-components/src/core/utils/Flex/Flex.tsx index 7a7e9a1860..7404bf1874 100644 --- a/packages/shared-components/src/core/utils/Flex/Flex.tsx +++ b/packages/shared-components/src/core/utils/Flex/Flex.tsx @@ -11,7 +11,6 @@ import React, { type JSX, type ComponentProps, type JSXElementConstructor, useMe import styles from "./Flex.module.css"; -// eslint-disable-next-line @typescript-eslint/no-explicit-any type FlexProps> = { /** * The type of the HTML element @@ -61,7 +60,6 @@ type FlexProps = "div">({ as = "div", display = "flex", diff --git a/packages/shared-components/src/core/utils/ToastContext.test.tsx b/packages/shared-components/src/core/utils/ToastContext.test.tsx index b06d89f676..9ca9475d9c 100644 --- a/packages/shared-components/src/core/utils/ToastContext.test.tsx +++ b/packages/shared-components/src/core/utils/ToastContext.test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { describe, it, expect, vitest } from "vitest"; -import { render } from "@testing-library/react"; +import { render } from "@test-utils"; import { Toast } from "@vector-im/compound-web"; import React, { type JSX } from "react"; diff --git a/packages/shared-components/src/core/utils/linkify.test.ts b/packages/shared-components/src/core/utils/linkify.test.ts index b2fd9903d3..e6d387a769 100644 --- a/packages/shared-components/src/core/utils/linkify.test.ts +++ b/packages/shared-components/src/core/utils/linkify.test.ts @@ -104,7 +104,6 @@ describe("linkify-matrix", () => { }, ]); }); - // eslint-disable-next-line max-len it("should properly parse IPs v6 while ignoring dangling comma when without port name as the domain name", () => { const test = char + "username:[1234:5678::abcd]:"; expect(isLinkable(test)).toEqual(true); diff --git a/packages/shared-components/src/core/utils/linkify.ts b/packages/shared-components/src/core/utils/linkify.ts index 35e7cc4df5..d41cb1b1d8 100644 --- a/packages/shared-components/src/core/utils/linkify.ts +++ b/packages/shared-components/src/core/utils/linkify.ts @@ -90,13 +90,11 @@ function parseOpaqueIdsToMatrixIds({ const additionalDomainpartTokens = [HYPHEN]; const matrixToken = linkifyjs.createTokenClass(name, { isLink: true }); - // eslint-disable-next-line @typescript-eslint/no-explicit-any const matrixTokenState = new linkifyjs.State(matrixToken) as any as linkifyjs.State; // linkify doesn't appear to type this correctly const matrixTokenWithPort = linkifyjs.createTokenClass(name, { isLink: true }); const matrixTokenWithPortState = new linkifyjs.State( matrixTokenWithPort, - // eslint-disable-next-line @typescript-eslint/no-explicit-any ) as any as linkifyjs.State; // linkify doesn't appear to type this correctly const initialState = parser.start.tt(token); diff --git a/packages/shared-components/src/core/viewmodel/useCreateAutoDisposedViewModel.ts b/packages/shared-components/src/core/viewmodel/useCreateAutoDisposedViewModel.ts index a3b4fce3eb..fa32ae6f4f 100644 --- a/packages/shared-components/src/core/viewmodel/useCreateAutoDisposedViewModel.ts +++ b/packages/shared-components/src/core/viewmodel/useCreateAutoDisposedViewModel.ts @@ -60,7 +60,6 @@ export function useCreateAutoDisposedViewModel 0; const isInSection = useMemo(() => snapshot.sections.some((section) => section.isSelected), [snapshot.sections]); return ( - // eslint-disable-next-line jsx-a11y/no-static-element-interactions
e.stopPropagation()}> {snapshot.canMarkAsRead && ( } > - {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
e.stopPropagation()} diff --git a/packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListItemWrapper/RoomListItemWrapper.test.tsx b/packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListItemWrapper/RoomListItemWrapper.test.tsx index 4e38dc7863..0f91775c2f 100644 --- a/packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListItemWrapper/RoomListItemWrapper.test.tsx +++ b/packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListItemWrapper/RoomListItemWrapper.test.tsx @@ -20,7 +20,6 @@ describe(" keyboard re-dispatch", () => { const user = userEvent.setup(); const onKeyDown = vi.fn(); render( - // eslint-disable-next-line jsx-a11y/no-static-element-interactions
, @@ -40,7 +39,6 @@ describe(" keyboard re-dispatch", () => { const user = userEvent.setup(); const onKeyDown = vi.fn(); render( - // eslint-disable-next-line jsx-a11y/no-static-element-interactions
, diff --git a/packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListSectionHeaderView/RoomListSectionHeaderContent.tsx b/packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListSectionHeaderView/RoomListSectionHeaderContent.tsx index 4b417f5780..ccc09f8645 100644 --- a/packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListSectionHeaderView/RoomListSectionHeaderContent.tsx +++ b/packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListSectionHeaderView/RoomListSectionHeaderContent.tsx @@ -92,7 +92,6 @@ function MenuComponent({ vm }: MenuComponentProps): JSX.Element { } > - {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
e.stopPropagation()} diff --git a/packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListSectionHeaderView/RoomListSectionHeaderView.test.tsx b/packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListSectionHeaderView/RoomListSectionHeaderView.test.tsx index 7552c72e0b..7eb81bc605 100644 --- a/packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListSectionHeaderView/RoomListSectionHeaderView.test.tsx +++ b/packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListSectionHeaderView/RoomListSectionHeaderView.test.tsx @@ -87,7 +87,6 @@ describe(" stories", () => { const user = userEvent.setup(); const onKeyDown = vi.fn(); render( - // eslint-disable-next-line jsx-a11y/no-static-element-interactions
, diff --git a/packages/shared-components/src/room-list/story-mocks.tsx b/packages/shared-components/src/room-list/story-mocks.tsx index 38d71f5d08..4004fea224 100644 --- a/packages/shared-components/src/room-list/story-mocks.tsx +++ b/packages/shared-components/src/room-list/story-mocks.tsx @@ -46,7 +46,6 @@ export const mockAvatar = (name: string): React.ReactElement => ( */ export const renderAvatar = (room: Room): React.ReactElement => { // Cast to any to access properties - in real usage, the room object from the SDK will have these - // eslint-disable-next-line @typescript-eslint/no-explicit-any return mockAvatar((room as any)?.name || "Room"); }; diff --git a/packages/shared-components/src/room/HistoryVisibilityBadge/HistoryVisibilityBadge.test.tsx b/packages/shared-components/src/room/HistoryVisibilityBadge/HistoryVisibilityBadge.test.tsx index 6b8ea1c398..2531daf96b 100644 --- a/packages/shared-components/src/room/HistoryVisibilityBadge/HistoryVisibilityBadge.test.tsx +++ b/packages/shared-components/src/room/HistoryVisibilityBadge/HistoryVisibilityBadge.test.tsx @@ -7,7 +7,7 @@ import React from "react"; import { describe, expect, it } from "vitest"; -import { render } from "@testing-library/react"; +import { render } from "@test-utils"; import { HistoryVisibilityBadge } from "./HistoryVisibilityBadge.tsx"; diff --git a/packages/shared-components/src/room/WidgetPip/WidgetPipView.tsx b/packages/shared-components/src/room/WidgetPip/WidgetPipView.tsx index da0e3c5256..7f0446acf5 100644 --- a/packages/shared-components/src/room/WidgetPip/WidgetPipView.tsx +++ b/packages/shared-components/src/room/WidgetPip/WidgetPipView.tsx @@ -86,7 +86,6 @@ export const WidgetPipView: FC = ({ vm, RoomAvatar }) => { // if the user interacts with a mouse. Hence there is no use in providing an accessible alternative. // In the future we might consider introducing alternative shortcuts for moving the PiP around // with the keyboard. - // eslint-disable-next-line jsx-a11y/no-static-element-interactions
= { export function E2ePadlock({ icon, title, className }: Readonly): JSX.Element { // We specify isTriggerInteractive=true and make the div interactive manually as a workaround for // https://github.com/element-hq/compound/issues/294 - /* eslint-disable jsx-a11y/no-noninteractive-tabindex */ return (
); - /* eslint-enable jsx-a11y/no-noninteractive-tabindex */ } diff --git a/packages/shared-components/src/room/timeline/event-tile/body/MVideoBodyView/VideoBodyView.tsx b/packages/shared-components/src/room/timeline/event-tile/body/MVideoBodyView/VideoBodyView.tsx index 8b1fc95164..a09af81073 100644 --- a/packages/shared-components/src/room/timeline/event-tile/body/MVideoBodyView/VideoBodyView.tsx +++ b/packages/shared-components/src/room/timeline/event-tile/body/MVideoBodyView/VideoBodyView.tsx @@ -210,7 +210,6 @@ export function VideoBodyView({
{/* Captions will be supplied from app-side data once the VM wiring is in place. */} - {/* eslint-disable-next-line jsx-a11y/media-has-caption */}