Tweak oxlint config & delint our code (#34301)
* Remove stale max-len disablements * Remove stale camelCase & naming-convention disablements * Remove stale ban-ts-comment disablements * Remove stale no-var disablements * Remove stale no-empty-property disablements * Remove stale react rule disablements * Remove stale no-constant-condition disablements * Remove stale no-unused-vars disablements * Remove stale disablements for disabled rules * fixup camelcase * Remove dead code * Tidy code * Tweak oxlint config
This commit is contained in:
@@ -50,16 +50,13 @@ export const test = base.extend<Fixtures>({
|
|||||||
extraEnv: {},
|
extraEnv: {},
|
||||||
extraArgs: [],
|
extraArgs: [],
|
||||||
|
|
||||||
// eslint-disable-next-line no-empty-pattern
|
|
||||||
stdout: async ({}, use) => {
|
stdout: async ({}, use) => {
|
||||||
await use(new CapturedPassThrough());
|
await use(new CapturedPassThrough());
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line no-empty-pattern
|
|
||||||
stderr: async ({}, use) => {
|
stderr: async ({}, use) => {
|
||||||
await use(new CapturedPassThrough());
|
await use(new CapturedPassThrough());
|
||||||
},
|
},
|
||||||
|
|
||||||
// eslint-disable-next-line no-empty-pattern
|
|
||||||
tmpDir: async ({}, use) => {
|
tmpDir: async ({}, use) => {
|
||||||
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "element-desktop-tests-"));
|
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "element-desktop-tests-"));
|
||||||
await use(tmpDir);
|
await use(tmpDir);
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ async function main(): Promise<void> {
|
|||||||
// Can be specified multiple times for the copy command to bundle
|
// Can be specified multiple times for the copy command to bundle
|
||||||
// multiple arches into a single universal output module)
|
// multiple arches into a single universal output module)
|
||||||
for (;;) {
|
for (;;) {
|
||||||
// eslint-disable-line no-constant-condition
|
|
||||||
const targetIndex = process.argv.indexOf("--target");
|
const targetIndex = process.argv.indexOf("--target");
|
||||||
if (targetIndex === -1) break;
|
if (targetIndex === -1) break;
|
||||||
|
|
||||||
|
|||||||
Vendored
-2
@@ -10,10 +10,8 @@ import { type BrowserWindow } from "electron";
|
|||||||
import { type AppLocalization } from "../language-helper.js";
|
import { type AppLocalization } from "../language-helper.js";
|
||||||
|
|
||||||
// global type extensions need to use var for whatever reason
|
// global type extensions need to use var for whatever reason
|
||||||
/* eslint-disable no-var */
|
|
||||||
declare global {
|
declare global {
|
||||||
var mainWindow: BrowserWindow | null;
|
var mainWindow: BrowserWindow | null;
|
||||||
var appQuitting: boolean;
|
var appQuitting: boolean;
|
||||||
var appLocalization: AppLocalization;
|
var appLocalization: AppLocalization;
|
||||||
}
|
}
|
||||||
/* eslint-enable no-var */
|
|
||||||
|
|||||||
-2
@@ -11,7 +11,6 @@ declare module "matrix-seshat" {
|
|||||||
passphrase?: string;
|
passphrase?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-disable camelcase */
|
|
||||||
interface IMatrixEvent {
|
interface IMatrixEvent {
|
||||||
event_id: string;
|
event_id: string;
|
||||||
sender: string;
|
sender: string;
|
||||||
@@ -49,7 +48,6 @@ declare module "matrix-seshat" {
|
|||||||
context: ISearchContext;
|
context: ISearchContext;
|
||||||
}>;
|
}>;
|
||||||
}
|
}
|
||||||
/* eslint-enable camelcase */
|
|
||||||
|
|
||||||
interface ICheckpoint {
|
interface ICheckpoint {
|
||||||
roomId: string;
|
roomId: string;
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import {
|
|||||||
protocol,
|
protocol,
|
||||||
desktopCapturer,
|
desktopCapturer,
|
||||||
} from "electron";
|
} from "electron";
|
||||||
// eslint-disable-next-line n/file-extension-in-import
|
|
||||||
import * as Sentry from "@sentry/electron/main";
|
import * as Sentry from "@sentry/electron/main";
|
||||||
import path, { dirname } from "node:path";
|
import path, { dirname } from "node:path";
|
||||||
import windowStateKeeper from "electron-window-state";
|
import windowStateKeeper from "electron-window-state";
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ export class AppLocalization {
|
|||||||
|
|
||||||
if (store.has(AppLocalization.STORE_KEY)) {
|
if (store.has(AppLocalization.STORE_KEY)) {
|
||||||
const locales = store.get(AppLocalization.STORE_KEY);
|
const locales = store.get(AppLocalization.STORE_KEY);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
||||||
this.setAppLocale(locales!);
|
this.setAppLocale(locales!);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import { isDendrite } from "../../plugins/homeserver/dendrite";
|
|||||||
const email = "user@nowhere.dummy";
|
const email = "user@nowhere.dummy";
|
||||||
|
|
||||||
const test = base.extend({
|
const test = base.extend({
|
||||||
// eslint-disable-next-line no-empty-pattern
|
|
||||||
credentials: async ({}, use, testInfo) => {
|
credentials: async ({}, use, testInfo) => {
|
||||||
await use({
|
await use({
|
||||||
username: `user_${testInfo.testId}`,
|
username: `user_${testInfo.testId}`,
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ export const test = base.extend<TestFixtures>({
|
|||||||
await bot.onTestFinished(testInfo);
|
await bot.onTestFinished(testInfo);
|
||||||
},
|
},
|
||||||
|
|
||||||
// eslint-disable-next-line no-empty-pattern
|
|
||||||
webserver: async ({}, use) => {
|
webserver: async ({}, use) => {
|
||||||
const webserver = new Webserver();
|
const webserver = new Webserver();
|
||||||
await use(webserver);
|
await use(webserver);
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import { type Fixtures } from "../../../element-web-test.ts";
|
|||||||
|
|
||||||
export const legacyOAuthHomeserver: Fixtures = {
|
export const legacyOAuthHomeserver: Fixtures = {
|
||||||
oAuthServer: [
|
oAuthServer: [
|
||||||
// eslint-disable-next-line no-empty-pattern
|
|
||||||
async ({}, use) => {
|
async ({}, use) => {
|
||||||
const server = new OAuthServer();
|
const server = new OAuthServer();
|
||||||
await use(server);
|
await use(server);
|
||||||
|
|||||||
@@ -58,56 +58,3 @@ class Some extends Optional {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const None = new 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ import type * as commonmark from "commonmark";
|
|||||||
declare module "commonmark" {
|
declare module "commonmark" {
|
||||||
export type Attr = [key: string, value: string];
|
export type Attr = [key: string, value: string];
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
export interface HtmlRenderer {
|
||||||
interface HtmlRenderer {
|
|
||||||
// As far as @types/commonmark is concerned, these are not public, so add them
|
// 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
|
// https://github.com/commonmark/commonmark.js/blob/master/lib/render/html.js#L272-L296
|
||||||
text: (this: commonmark.HtmlRenderer, node: commonmark.Node) => void;
|
text: (this: commonmark.HtmlRenderer, node: commonmark.Node) => void;
|
||||||
@@ -42,5 +41,4 @@ declare module "commonmark" {
|
|||||||
lit: (this: commonmark.HtmlRenderer, text: string) => void;
|
lit: (this: commonmark.HtmlRenderer, text: string) => void;
|
||||||
cr: (this: commonmark.HtmlRenderer) => void;
|
cr: (this: commonmark.HtmlRenderer) => void;
|
||||||
}
|
}
|
||||||
/* eslint-enable @typescript-eslint/naming-convention */
|
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-9
@@ -38,8 +38,6 @@ import { type ModuleApiType } from "../modules/Api.ts";
|
|||||||
import type { RoomListStoreV3Class } from "../stores/room-list-v3/RoomListStoreV3.ts";
|
import type { RoomListStoreV3Class } from "../stores/room-list-v3/RoomListStoreV3.ts";
|
||||||
import { type SDKContextClass } from "../contexts/SDKContextClass.ts";
|
import { type SDKContextClass } from "../contexts/SDKContextClass.ts";
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
|
||||||
|
|
||||||
type ElectronChannel =
|
type ElectronChannel =
|
||||||
| "app_onAction"
|
| "app_onAction"
|
||||||
| "before-quit"
|
| "before-quit"
|
||||||
@@ -177,7 +175,6 @@ declare global {
|
|||||||
},
|
},
|
||||||
): void;
|
): void;
|
||||||
|
|
||||||
// eslint-disable-next-line no-var
|
|
||||||
var grecaptcha:
|
var grecaptcha:
|
||||||
| undefined
|
| undefined
|
||||||
| {
|
| {
|
||||||
@@ -192,14 +189,8 @@ declare global {
|
|||||||
isReady: () => boolean;
|
isReady: () => boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line no-var, camelcase
|
|
||||||
var mx_rage_logger: ConsoleLogger;
|
var mx_rage_logger: ConsoleLogger;
|
||||||
// eslint-disable-next-line no-var, camelcase
|
|
||||||
var mx_rage_initPromise: Promise<void>;
|
var mx_rage_initPromise: Promise<void>;
|
||||||
// eslint-disable-next-line no-var, camelcase
|
|
||||||
var mx_rage_initStoragePromise: Promise<void>;
|
var mx_rage_initStoragePromise: Promise<void>;
|
||||||
// eslint-disable-next-line no-var, camelcase
|
|
||||||
var mx_rage_store: IndexedDBLogStore;
|
var mx_rage_store: IndexedDBLogStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-enable @typescript-eslint/naming-convention */
|
|
||||||
|
|||||||
@@ -102,7 +102,6 @@ export const transformTags: NonNullable<IOptions["transformTags"]> = {
|
|||||||
}
|
}
|
||||||
return { tagName, attribs };
|
return { tagName, attribs };
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
||||||
"*": function (tagName: string, attribs: sanitizeHtml.Attributes) {
|
"*": function (tagName: string, attribs: sanitizeHtml.Attributes) {
|
||||||
// Delete any style previously assigned, style is an allowedTag for font, span & img,
|
// Delete any style previously assigned, style is an allowedTag for font, span & img,
|
||||||
// because attributes are stripped after transforming.
|
// because attributes are stripped after transforming.
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ describe("Markdown parser test", () => {
|
|||||||
].join("\n");
|
].join("\n");
|
||||||
|
|
||||||
it("tests that links with markdown empasis in them are getting properly HTML formatted", () => {
|
it("tests that links with markdown empasis in them are getting properly HTML formatted", () => {
|
||||||
/* eslint-disable max-len */
|
|
||||||
const expectedResult = [
|
const expectedResult = [
|
||||||
"<p>Test1:<br />#_foonetic_xkcd:matrix.org<br />http://google.com/_thing_<br />https://matrix.org/_matrix/client/foo/123_<br />#_foonetic_xkcd:matrix.org</p>",
|
"<p>Test1:<br />#_foonetic_xkcd:matrix.org<br />http://google.com/_thing_<br />https://matrix.org/_matrix/client/foo/123_<br />#_foonetic_xkcd:matrix.org</p>",
|
||||||
"<p>Test1A:<br />#_foonetic_xkcd:matrix.org<br />http://google.com/_thing_<br />https://matrix.org/_matrix/client/foo/123_<br />#_foonetic_xkcd:matrix.org</p>",
|
"<p>Test1A:<br />#_foonetic_xkcd:matrix.org<br />http://google.com/_thing_<br />https://matrix.org/_matrix/client/foo/123_<br />#_foonetic_xkcd:matrix.org</p>",
|
||||||
@@ -43,7 +42,6 @@ describe("Markdown parser test", () => {
|
|||||||
"<p>Test3:<br />https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org<br />https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org</p>",
|
"<p>Test3:<br />https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org<br />https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org</p>",
|
||||||
"",
|
"",
|
||||||
].join("\n");
|
].join("\n");
|
||||||
/* eslint-enable max-len */
|
|
||||||
const md = new Markdown(testString);
|
const md = new Markdown(testString);
|
||||||
expect(md.toHTML()).toEqual(expectedResult);
|
expect(md.toHTML()).toEqual(expectedResult);
|
||||||
});
|
});
|
||||||
@@ -69,7 +67,6 @@ describe("Markdown parser test", () => {
|
|||||||
"<https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org>",
|
"<https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org>",
|
||||||
"<https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org>",
|
"<https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org>",
|
||||||
].join("\n");
|
].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
|
* 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
|
* but it seems to be actually working properly
|
||||||
@@ -81,7 +78,6 @@ describe("Markdown parser test", () => {
|
|||||||
'<p>Test3:<br /><a href="https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org">https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org</a><br /><a href="https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org">https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org</a></p>',
|
'<p>Test3:<br /><a href="https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org">https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org</a><br /><a href="https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org">https://riot.im/app/#/room/#_foonetic_xkcd:matrix.org</a></p>',
|
||||||
"",
|
"",
|
||||||
].join("\n");
|
].join("\n");
|
||||||
/* eslint-enable max-len */
|
|
||||||
const md = new Markdown(test);
|
const md = new Markdown(test);
|
||||||
expect(md.toHTML()).toEqual(expectedResult);
|
expect(md.toHTML()).toEqual(expectedResult);
|
||||||
});
|
});
|
||||||
@@ -114,7 +110,6 @@ describe("Markdown parser test", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('expects that links with emphasis are "escaped" correctly', () => {
|
it('expects that links with emphasis are "escaped" correctly', () => {
|
||||||
/* eslint-disable max-len */
|
|
||||||
const testString = [
|
const testString = [
|
||||||
"http://domain.xyz/foo/bar-_stuff-like-this_-in-it.jpg" +
|
"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_test3__",
|
||||||
"https://example.com/_test__test2",
|
"https://example.com/_test__test2",
|
||||||
].join("<br />");
|
].join("<br />");
|
||||||
/* eslint-enable max-len */
|
|
||||||
const md = new Markdown(testString);
|
const md = new Markdown(testString);
|
||||||
expect(md.toHTML()).toEqual(expectedResult);
|
expect(md.toHTML()).toEqual(expectedResult);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("expects that the link part will not be accidentally added to <strong>", () => {
|
it("expects that the link part will not be accidentally added to <strong>", () => {
|
||||||
/* eslint-disable max-len */
|
|
||||||
const testString = `https://github.com/matrix-org/synapse/blob/develop/synapse/module_api/__init__.py`;
|
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";
|
const expectedResult = "https://github.com/matrix-org/synapse/blob/develop/synapse/module_api/__init__.py";
|
||||||
/* eslint-enable max-len */
|
|
||||||
const md = new Markdown(testString);
|
const md = new Markdown(testString);
|
||||||
expect(md.toHTML()).toEqual(expectedResult);
|
expect(md.toHTML()).toEqual(expectedResult);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("expects that the link part will not be accidentally added to <strong> for multiline links", () => {
|
it("expects that the link part will not be accidentally added to <strong> for multiline links", () => {
|
||||||
/* eslint-disable max-len */
|
|
||||||
const testString = [
|
const testString = [
|
||||||
"https://github.com/matrix-org/synapse/blob/develop/synapse/module_api/__init__.py" +
|
"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",
|
"https://github.com/matrix-org/synapse/blob/develop/synapse/module_api/__init__.py",
|
||||||
].join("<br />");
|
].join("<br />");
|
||||||
/* eslint-enable max-len */
|
|
||||||
const md = new Markdown(testString);
|
const md = new Markdown(testString);
|
||||||
expect(md.toHTML()).toEqual(expectedResult);
|
expect(md.toHTML()).toEqual(expectedResult);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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.
|
* If present the screen to redirect to after a successful login or register.
|
||||||
*/
|
*/
|
||||||
export async function startAnyRegistrationFlow(
|
export async function startAnyRegistrationFlow(
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
options: { go_home_on_cancel?: boolean; go_welcome_on_cancel?: boolean; screen_after?: boolean } = {},
|
options: { go_home_on_cancel?: boolean; go_welcome_on_cancel?: boolean; screen_after?: boolean } = {},
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const modal = Modal.createDialog(QuestionDialog, {
|
const modal = Modal.createDialog(QuestionDialog, {
|
||||||
|
|||||||
@@ -151,7 +151,6 @@ export const AutocompleteInput: React.FC<AutocompleteInputProps> = ({
|
|||||||
{isFocused && suggestions.length ? (
|
{isFocused && suggestions.length ? (
|
||||||
<div
|
<div
|
||||||
className="mx_AutocompleteInput_matches"
|
className="mx_AutocompleteInput_matches"
|
||||||
// eslint-disable-next-line react-compiler/react-compiler
|
|
||||||
style={{ top: editorContainerRef.current?.clientHeight }}
|
style={{ top: editorContainerRef.current?.clientHeight }}
|
||||||
data-testid="autocomplete-matches"
|
data-testid="autocomplete-matches"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -425,11 +425,7 @@ export default class ContextMenu extends React.PureComponent<React.PropsWithChil
|
|||||||
}
|
}
|
||||||
|
|
||||||
// filter props that are invalid for DOM elements
|
// filter props that are invalid for DOM elements
|
||||||
const {
|
const { hasBackground: _hasBackground, onFinished: _onFinished, ...divProps } = props;
|
||||||
hasBackground: _hasBackground, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
||||||
onFinished: _onFinished, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
||||||
...divProps
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RovingTabIndexProvider handleHomeEnd handleUpDown onKeyDown={this.onKeyDown}>
|
<RovingTabIndexProvider handleHomeEnd handleUpDown onKeyDown={this.onKeyDown}>
|
||||||
@@ -579,7 +575,6 @@ type ContextMenuTuple<T> = [
|
|||||||
(ev?: SyntheticEvent) => void,
|
(ev?: SyntheticEvent) => void,
|
||||||
(val: boolean) => void,
|
(val: boolean) => void,
|
||||||
];
|
];
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint
|
|
||||||
export const useContextMenu = <T extends HTMLElement = HTMLElement>(
|
export const useContextMenu = <T extends HTMLElement = HTMLElement>(
|
||||||
inputRef?: RefObject<T | null>,
|
inputRef?: RefObject<T | null>,
|
||||||
): ContextMenuTuple<T> => {
|
): ContextMenuTuple<T> => {
|
||||||
@@ -601,7 +596,6 @@ export const useContextMenu = <T extends HTMLElement = HTMLElement>(
|
|||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line react-compiler/react-compiler
|
|
||||||
return [button.current ? isOpen : false, button, open, close, setIsOpen];
|
return [button.current ? isOpen : false, button, open, close, setIsOpen];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ export default class IndicatorScrollbar<T extends keyof JSX.IntrinsicElements> e
|
|||||||
};
|
};
|
||||||
|
|
||||||
public render(): React.ReactNode {
|
public render(): React.ReactNode {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const { children, trackHorizontalOverflow, verticalScrollsHorizontally, className, ...otherProps } = this.props;
|
const { children, trackHorizontalOverflow, verticalScrollsHorizontally, className, ...otherProps } = this.props;
|
||||||
|
|
||||||
const leftIndicatorStyle = { left: this.state.leftIndicatorOffset };
|
const leftIndicatorStyle = { left: this.state.leftIndicatorOffset };
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ interface IProps {
|
|||||||
// transitioned to PWLU)
|
// transitioned to PWLU)
|
||||||
onRegistered: (this: void, credentials: IMatrixClientCreds) => Promise<MatrixClient>;
|
onRegistered: (this: void, credentials: IMatrixClientCreds) => Promise<MatrixClient>;
|
||||||
hideToSRUsers: boolean;
|
hideToSRUsers: boolean;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
page_type?: string;
|
page_type?: string;
|
||||||
threepidInvite?: IThreepidInvite;
|
threepidInvite?: IThreepidInvite;
|
||||||
roomOobData?: IOOBData;
|
roomOobData?: IOOBData;
|
||||||
|
|||||||
@@ -179,7 +179,6 @@ interface IState {
|
|||||||
// What the LoggedInView would be showing if visible.
|
// What the LoggedInView would be showing if visible.
|
||||||
// A member of the enum for standard pages or a string for those provided by
|
// A member of the enum for standard pages or a string for those provided by
|
||||||
// a module.
|
// a module.
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
page_type?: PageType | string;
|
page_type?: PageType | string;
|
||||||
// The ID of the room we're viewing. This is either populated directly
|
// 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
|
// 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
|
// If we're trying to just view a user ID (i.e. /user URL), this is it
|
||||||
currentUserId: string | null;
|
currentUserId: string | null;
|
||||||
// Parameters used in the registration dance with the IS
|
// Parameters used in the registration dance with the IS
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
register_client_secret?: string;
|
register_client_secret?: string;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
register_session_id?: string;
|
register_session_id?: string;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
register_id_sid?: string;
|
register_id_sid?: string;
|
||||||
isMobileRegistration?: boolean;
|
isMobileRegistration?: boolean;
|
||||||
// When showing Modal dialogs we need to set aria-hidden on the root app element
|
// When showing Modal dialogs we need to set aria-hidden on the root app element
|
||||||
|
|||||||
@@ -118,9 +118,7 @@ class LoginComponent extends React.PureComponent<IProps, IState> {
|
|||||||
"m.login.password": this.renderPasswordStep,
|
"m.login.password": this.renderPasswordStep,
|
||||||
|
|
||||||
// CAS and SSO are the same thing, modulo the url we link to
|
// 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"),
|
"m.login.cas": () => this.renderSsoStep("cas"),
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
||||||
"m.login.sso": () => this.renderSsoStep("sso"),
|
"m.login.sso": () => this.renderSsoStep("sso"),
|
||||||
"oauthNativeFlow": () => this.renderOAuth2Step(),
|
"oauthNativeFlow": () => this.renderOAuth2Step(),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -178,13 +178,11 @@ export class PasswordAuthEntry extends React.Component<IAuthEntryProps, IPasswor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-disable camelcase */
|
|
||||||
interface IRecaptchaAuthEntryProps extends IAuthEntryProps {
|
interface IRecaptchaAuthEntryProps extends IAuthEntryProps {
|
||||||
stageParams?: {
|
stageParams?: {
|
||||||
public_key?: string;
|
public_key?: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
/* eslint-enable camelcase */
|
|
||||||
|
|
||||||
export class RecaptchaAuthEntry extends React.Component<IRecaptchaAuthEntryProps> {
|
export class RecaptchaAuthEntry extends React.Component<IRecaptchaAuthEntryProps> {
|
||||||
public static LOGIN_TYPE = AuthType.Recaptcha;
|
public static LOGIN_TYPE = AuthType.Recaptcha;
|
||||||
|
|||||||
@@ -197,7 +197,6 @@ const Entry: React.FC<IEntryProps<any>> = ({ room, type, content, matrixClient:
|
|||||||
*/
|
*/
|
||||||
const transformEvent = (event: MatrixEvent, cli: MatrixClient): { type: string; content: IContent } => {
|
const transformEvent = (event: MatrixEvent, cli: MatrixClient): { type: string; content: IContent } => {
|
||||||
const {
|
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
|
"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
|
// We're taking a shallow copy here to avoid https://github.com/vector-im/element-web/issues/10924
|
||||||
...content
|
...content
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ interface IState {
|
|||||||
phase: number;
|
phase: number;
|
||||||
sasVerified: boolean;
|
sasVerified: boolean;
|
||||||
opponentProfile: {
|
opponentProfile: {
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
avatar_url?: string;
|
avatar_url?: string;
|
||||||
displayname?: string;
|
displayname?: string;
|
||||||
} | null;
|
} | null;
|
||||||
|
|||||||
@@ -801,7 +801,6 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
// Update the IS in account data. Actually using it may trigger terms.
|
// Update the IS in account data. Actually using it may trigger terms.
|
||||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
||||||
setToDefaultIdentityServer(MatrixClientPeg.safeGet());
|
setToDefaultIdentityServer(MatrixClientPeg.safeGet());
|
||||||
this.setState({ canUseIdentityServer: true, tryingIdentityServer: false });
|
this.setState({ canUseIdentityServer: true, tryingIdentityServer: false });
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ export default class EventTilePreview extends React.Component<IProps, IState> {
|
|||||||
|
|
||||||
private fakeEvent({ message }: IState): MatrixEvent {
|
private fakeEvent({ message }: IState): MatrixEvent {
|
||||||
// Fake it till we make it
|
// Fake it till we make it
|
||||||
/* eslint-disable quote-props */
|
|
||||||
const rawEvent = {
|
const rawEvent = {
|
||||||
type: "m.room.message",
|
type: "m.room.message",
|
||||||
sender: this.props.userId,
|
sender: this.props.userId,
|
||||||
@@ -86,7 +85,6 @@ export default class EventTilePreview extends React.Component<IProps, IState> {
|
|||||||
room_id: "!999999999999999999:example.org",
|
room_id: "!999999999999999999:example.org",
|
||||||
};
|
};
|
||||||
const event = new MatrixEvent(rawEvent);
|
const event = new MatrixEvent(rawEvent);
|
||||||
/* eslint-enable quote-props */
|
|
||||||
|
|
||||||
// Fake it more
|
// Fake it more
|
||||||
event.sender = {
|
event.sender = {
|
||||||
|
|||||||
@@ -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.
|
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
|
//see src/resizer for the actual resizing code, this is just the DOM for the resize handle
|
||||||
interface IResizeHandleProps {
|
interface IResizeHandleProps {
|
||||||
|
|||||||
@@ -76,11 +76,8 @@ export const Container: React.FC<{
|
|||||||
|
|
||||||
export interface IPowerLevelsContent {
|
export interface IPowerLevelsContent {
|
||||||
events?: Record<string, number>;
|
events?: Record<string, number>;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
users_default?: number;
|
users_default?: number;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
events_default?: number;
|
events_default?: number;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
state_default?: number;
|
state_default?: number;
|
||||||
ban?: number;
|
ban?: number;
|
||||||
kick?: number;
|
kick?: number;
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ export function ReadReceiptGroup({
|
|||||||
readReceiptPosition = readReceiptMap[userId];
|
readReceiptPosition = readReceiptMap[userId];
|
||||||
if (!readReceiptPosition) {
|
if (!readReceiptPosition) {
|
||||||
readReceiptPosition = {};
|
readReceiptPosition = {};
|
||||||
// eslint-disable-next-line react-compiler/react-compiler
|
|
||||||
readReceiptMap[userId] = readReceiptPosition;
|
readReceiptMap[userId] = readReceiptPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ export function useComposerFunctions(
|
|||||||
() => ({
|
() => ({
|
||||||
clear: () => {
|
clear: () => {
|
||||||
if (ref.current) {
|
if (ref.current) {
|
||||||
// eslint-disable-next-line react-compiler/react-compiler
|
|
||||||
ref.current.innerHTML = "";
|
ref.current.innerHTML = "";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
-1
@@ -12,7 +12,6 @@ export function usePlainTextInitialization(initialContent = "", ref: RefObject<H
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// always read and write the ref.current using .innerHTML for consistency in linebreak and HTML entity handling
|
// always read and write the ref.current using .innerHTML for consistency in linebreak and HTML entity handling
|
||||||
if (ref.current) {
|
if (ref.current) {
|
||||||
// eslint-disable-next-line react-compiler/react-compiler
|
|
||||||
ref.current.innerHTML = initialContent;
|
ref.current.innerHTML = initialContent;
|
||||||
}
|
}
|
||||||
}, [ref, initialContent]);
|
}, [ref, initialContent]);
|
||||||
|
|||||||
@@ -33,25 +33,19 @@ interface IBridgeStateEvent {
|
|||||||
protocol: {
|
protocol: {
|
||||||
id: string;
|
id: string;
|
||||||
displayname?: string;
|
displayname?: string;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
avatar_url?: string;
|
avatar_url?: string;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
external_url?: string;
|
external_url?: string;
|
||||||
};
|
};
|
||||||
network?: {
|
network?: {
|
||||||
id: string;
|
id: string;
|
||||||
displayname?: string;
|
displayname?: string;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
avatar_url?: string;
|
avatar_url?: string;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
external_url?: string;
|
external_url?: string;
|
||||||
};
|
};
|
||||||
channel: {
|
channel: {
|
||||||
id: string;
|
id: string;
|
||||||
displayname?: string;
|
displayname?: string;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
avatar_url?: string;
|
avatar_url?: string;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
external_url?: string;
|
external_url?: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -313,7 +313,6 @@ export class SpaceItem extends React.PureComponent<IItemProps, IItemState> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public render(): React.ReactNode {
|
public render(): React.ReactNode {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const {
|
const {
|
||||||
space,
|
space,
|
||||||
activeSpaces,
|
activeSpaces,
|
||||||
@@ -366,7 +365,6 @@ export class SpaceItem extends React.PureComponent<IItemProps, IItemState> {
|
|||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const { tabIndex, ...restDragHandleProps } = dragHandleProps || {};
|
const { tabIndex, ...restDragHandleProps } = dragHandleProps || {};
|
||||||
const selected = activeSpaces.includes(space.roomId);
|
const selected = activeSpaces.includes(space.roomId);
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ const ScopedRoomContext = createContext<EfficientContext<ContextValue> | undefin
|
|||||||
// Uses react memo and leverages splatting the value to ensure that the context is only updated when the state changes (shallow compare)
|
// 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(
|
export const ScopedRoomContextProvider = memo(
|
||||||
({ children, ...state }: { children: ReactNode } & ContextValue): JSX.Element => {
|
({ 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<ContextValue>(state), []);
|
const context = useMemo(() => new EfficientContext<ContextValue>(state), []);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
context.setState(state);
|
context.setState(state);
|
||||||
|
|||||||
@@ -51,8 +51,6 @@ import { SDKContextClass } from "./contexts/SDKContextClass.ts";
|
|||||||
import SdkConfig from "./SdkConfig";
|
import SdkConfig from "./SdkConfig";
|
||||||
|
|
||||||
// we define a number of interfaces which take their names from the js-sdk
|
// we define a number of interfaces which take their names from the js-sdk
|
||||||
/* eslint-disable camelcase */
|
|
||||||
|
|
||||||
export interface IOpts {
|
export interface IOpts {
|
||||||
dmUserId?: string;
|
dmUserId?: string;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export class MatrixDispatcher {
|
|||||||
/**
|
/**
|
||||||
* Dispatches a payload to all registered callbacks.
|
* Dispatches a payload to all registered callbacks.
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
||||||
private _dispatch = (payload: ActionPayload): void => {
|
private _dispatch = (payload: ActionPayload): void => {
|
||||||
invariant(!this.isDispatching(), "Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.");
|
invariant(!this.isDispatching(), "Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.");
|
||||||
this.startDispatching(payload);
|
this.startDispatching(payload);
|
||||||
|
|||||||
@@ -13,6 +13,5 @@ import { type ActionPayload } from "../payloads";
|
|||||||
|
|
||||||
export interface AfterLeaveRoomPayload extends ActionPayload {
|
export interface AfterLeaveRoomPayload extends ActionPayload {
|
||||||
action: Action.AfterLeaveRoom;
|
action: Action.AfterLeaveRoom;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
room_id?: Room["roomId"];
|
room_id?: Room["roomId"];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,5 @@ import { type Action } from "../actions";
|
|||||||
|
|
||||||
export interface DoAfterSyncPreparedPayload<T extends ActionPayload> extends Pick<ActionPayload, "action"> {
|
export interface DoAfterSyncPreparedPayload<T extends ActionPayload> extends Pick<ActionPayload, "action"> {
|
||||||
action: Action.DoAfterSyncPrepared;
|
action: Action.DoAfterSyncPrepared;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
deferred_action: T;
|
deferred_action: T;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import { type IJoinRoomOpts } from "matrix-js-sdk/src/matrix";
|
|||||||
import { type ActionPayload } from "../payloads";
|
import { type ActionPayload } from "../payloads";
|
||||||
import { type Action } from "../actions";
|
import { type Action } from "../actions";
|
||||||
|
|
||||||
/* eslint-disable camelcase */
|
|
||||||
export interface JoinRoomPayload extends Pick<ActionPayload, "action"> {
|
export interface JoinRoomPayload extends Pick<ActionPayload, "action"> {
|
||||||
action: Action.JoinRoom;
|
action: Action.JoinRoom;
|
||||||
|
|
||||||
@@ -24,4 +23,3 @@ export interface JoinRoomPayload extends Pick<ActionPayload, "action"> {
|
|||||||
|
|
||||||
canAskToJoin?: boolean;
|
canAskToJoin?: boolean;
|
||||||
}
|
}
|
||||||
/* eslint-enable camelcase */
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { type JoinedRoom as JoinedRoomEvent } from "@matrix-org/analytics-events
|
|||||||
import { type ActionPayload } from "../payloads";
|
import { type ActionPayload } from "../payloads";
|
||||||
import { type Action } from "../actions";
|
import { type Action } from "../actions";
|
||||||
|
|
||||||
/* eslint-disable camelcase */
|
|
||||||
export interface JoinRoomReadyPayload extends Pick<ActionPayload, "action"> {
|
export interface JoinRoomReadyPayload extends Pick<ActionPayload, "action"> {
|
||||||
action: Action.JoinRoomReady;
|
action: Action.JoinRoomReady;
|
||||||
roomId: string;
|
roomId: string;
|
||||||
@@ -19,4 +18,3 @@ export interface JoinRoomReadyPayload extends Pick<ActionPayload, "action"> {
|
|||||||
// additional parameters for the purpose of metrics & instrumentation
|
// additional parameters for the purpose of metrics & instrumentation
|
||||||
metricsTrigger: JoinedRoomEvent["trigger"];
|
metricsTrigger: JoinedRoomEvent["trigger"];
|
||||||
}
|
}
|
||||||
/* eslint-enable camelcase */
|
|
||||||
|
|||||||
@@ -9,10 +9,8 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
import { type ActionPayload } from "../payloads";
|
import { type ActionPayload } from "../payloads";
|
||||||
import { type Action } from "../actions";
|
import { type Action } from "../actions";
|
||||||
|
|
||||||
/* eslint-disable camelcase */
|
|
||||||
export interface ThreadPayload extends Pick<ActionPayload, "action"> {
|
export interface ThreadPayload extends Pick<ActionPayload, "action"> {
|
||||||
action: Action.ViewThread;
|
action: Action.ViewThread;
|
||||||
|
|
||||||
thread_id: string | null;
|
thread_id: string | null;
|
||||||
}
|
}
|
||||||
/* eslint-enable camelcase */
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { type ActionPayload } from "../payloads";
|
|||||||
|
|
||||||
export interface ViewHomePagePayload extends ActionPayload {
|
export interface ViewHomePagePayload extends ActionPayload {
|
||||||
action: Action.ViewHomePage;
|
action: Action.ViewHomePage;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
context_switch?: boolean;
|
context_switch?: boolean;
|
||||||
justRegistered?: boolean;
|
justRegistered?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,7 @@ import { type Action } from "../actions";
|
|||||||
|
|
||||||
export interface ViewRoomErrorPayload extends Pick<ActionPayload, "action"> {
|
export interface ViewRoomErrorPayload extends Pick<ActionPayload, "action"> {
|
||||||
action: Action.ViewRoomError;
|
action: Action.ViewRoomError;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
room_id: Room["roomId"] | null;
|
room_id: Room["roomId"] | null;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
room_alias?: string;
|
room_alias?: string;
|
||||||
err?: MatrixError;
|
err?: MatrixError;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import { type AtLeastOne } from "../../@types/common";
|
|||||||
|
|
||||||
export type FocusNextType = "composer" | "threadsPanel" | undefined;
|
export type FocusNextType = "composer" | "threadsPanel" | undefined;
|
||||||
|
|
||||||
/* eslint-disable camelcase */
|
|
||||||
interface BaseViewRoomPayload extends Pick<ActionPayload, "action"> {
|
interface BaseViewRoomPayload extends Pick<ActionPayload, "action"> {
|
||||||
action: Action.ViewRoom;
|
action: Action.ViewRoom;
|
||||||
|
|
||||||
@@ -58,4 +57,3 @@ export type ViewRoomPayload = BaseViewRoomPayload &
|
|||||||
room_alias?: string;
|
room_alias?: string;
|
||||||
focusNext: FocusNextType; // wat to focus after room switch. Defaults to 'composer' if undefined.
|
focusNext: FocusNextType; // wat to focus after room switch. Defaults to 'composer' if undefined.
|
||||||
}>;
|
}>;
|
||||||
/* eslint-enable camelcase */
|
|
||||||
|
|||||||
@@ -13,6 +13,5 @@ import { type Action } from "../actions";
|
|||||||
|
|
||||||
export interface ViewStartChatOrReusePayload extends Pick<ActionPayload, "action"> {
|
export interface ViewStartChatOrReusePayload extends Pick<ActionPayload, "action"> {
|
||||||
action: Action.ViewStartChatOrReuse;
|
action: Action.ViewStartChatOrReuse;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
user_id: User["userId"];
|
user_id: User["userId"];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export function useAsyncRefreshMemo<T>(fn: Fn<T>, deps: DependencyList, initialV
|
|||||||
return () => {
|
return () => {
|
||||||
discard = true;
|
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]);
|
useEffect(refresh, [refresh]);
|
||||||
return [value, refresh];
|
return [value, refresh];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ export function useEventEmitterAsyncState<T, Events extends string, Arguments ex
|
|||||||
rerunArgs.push(args);
|
rerunArgs.push(args);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
running = true; // eslint-disable-line react-hooks/exhaustive-deps
|
running = true;
|
||||||
// Note: We need to use .then notation instead of async/await,
|
// Note: We need to use .then notation instead of async/await,
|
||||||
// because async/await would cause this function to return a
|
// because async/await would cause this function to return a
|
||||||
// promise, which `useEffect` doesn't like.
|
// promise, which `useEffect` doesn't like.
|
||||||
@@ -177,7 +177,7 @@ export function useEventEmitterAsyncState<T, Events extends string, Arguments ex
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[fn, ...deps], // eslint-disable-line react-compiler/react-compiler, react-hooks/exhaustive-deps
|
[fn, ...deps], // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
);
|
);
|
||||||
|
|
||||||
// re-run when the emitter changes
|
// re-run when the emitter changes
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ const createMemberFromProfile = (userId: string, profile: IMatrixProfile): RoomM
|
|||||||
return { avatar_url: profile.avatar_url };
|
return { avatar_url: profile.avatar_url };
|
||||||
},
|
},
|
||||||
getDirectionalContent: function () {
|
getDirectionalContent: function () {
|
||||||
// eslint-disable-next-line
|
|
||||||
return this.getContent();
|
return this.getContent();
|
||||||
},
|
},
|
||||||
} as MatrixEvent;
|
} as MatrixEvent;
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ export const useNotificationState = (room: Room): [RoomNotifState | undefined, (
|
|||||||
setNotificationState(echoChamber.notificationVolume);
|
setNotificationState(echoChamber.notificationVolume);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// eslint-disable-next-line react-compiler/react-compiler
|
|
||||||
const setter = useCallback((state: RoomNotifState) => (echoChamber.notificationVolume = state), [echoChamber]);
|
const setter = useCallback((state: RoomNotifState) => (echoChamber.notificationVolume = state), [echoChamber]);
|
||||||
return [notificationState, setter];
|
return [notificationState, setter];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import {
|
|||||||
} from "matrix-js-sdk/src/matrix";
|
} from "matrix-js-sdk/src/matrix";
|
||||||
|
|
||||||
// The following interfaces take their names and member names from seshat and the spec
|
// 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. */
|
/** A record of a place to resume crawling events in a given room. */
|
||||||
export interface ICrawlerCheckpoint {
|
export interface ICrawlerCheckpoint {
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ import { Action } from "../dispatcher/actions";
|
|||||||
export class Mjolnir {
|
export class Mjolnir {
|
||||||
private static instance?: Mjolnir;
|
private static instance?: Mjolnir;
|
||||||
|
|
||||||
private _lists: BanList[] = []; // eslint-disable-line @typescript-eslint/naming-convention
|
private _lists: BanList[] = [];
|
||||||
private _roomIds: string[] = []; // eslint-disable-line @typescript-eslint/naming-convention
|
private _roomIds: string[] = [];
|
||||||
private mjolnirWatchRef?: string;
|
private mjolnirWatchRef?: string;
|
||||||
private dispatcherRef?: string;
|
private dispatcherRef?: string;
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ export class ModuleApi implements Api {
|
|||||||
return ModuleApi._instance;
|
return ModuleApi._instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
|
||||||
public async _registerLegacyModule(LegacyModule: RuntimeModuleConstructor): Promise<void> {
|
public async _registerLegacyModule(LegacyModule: RuntimeModuleConstructor): Promise<void> {
|
||||||
ModuleRunner.instance.registerModule((api) => new LegacyModule(api));
|
ModuleRunner.instance.registerModule((api) => new LegacyModule(api));
|
||||||
}
|
}
|
||||||
@@ -80,7 +79,6 @@ export class ModuleApi implements Api {
|
|||||||
) => void = legacyCustomisationsFactory(WidgetPermissionCustomisations);
|
) => void = legacyCustomisationsFactory(WidgetPermissionCustomisations);
|
||||||
public readonly _registerLegacyWidgetVariablesCustomisations =
|
public readonly _registerLegacyWidgetVariablesCustomisations =
|
||||||
legacyCustomisationsFactory(WidgetVariableCustomisations);
|
legacyCustomisationsFactory(WidgetVariableCustomisations);
|
||||||
/* eslint-enable @typescript-eslint/naming-convention */
|
|
||||||
|
|
||||||
public readonly navigation = new NavigationApi();
|
public readonly navigation = new NavigationApi();
|
||||||
public readonly openDialog = openDialog;
|
public readonly openDialog = openDialog;
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ import { MatrixClientPeg } from "./MatrixClientPeg";
|
|||||||
import SettingsStore from "./settings/SettingsStore";
|
import SettingsStore from "./settings/SettingsStore";
|
||||||
import { type IConfigOptions } from "./IConfigOptions";
|
import { type IConfigOptions } from "./IConfigOptions";
|
||||||
|
|
||||||
/* eslint-disable camelcase */
|
|
||||||
|
|
||||||
type StorageContext = {
|
type StorageContext = {
|
||||||
storageManager_persisted?: string;
|
storageManager_persisted?: string;
|
||||||
storageManager_quota?: string;
|
storageManager_quota?: string;
|
||||||
@@ -58,8 +56,6 @@ type Contexts = {
|
|||||||
storage: StorageContext;
|
storage: StorageContext;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* eslint-enable camelcase */
|
|
||||||
|
|
||||||
async function getStorageContext(): Promise<StorageContext> {
|
async function getStorageContext(): Promise<StorageContext> {
|
||||||
const result: StorageContext = {};
|
const result: StorageContext = {};
|
||||||
|
|
||||||
|
|||||||
@@ -426,7 +426,6 @@ export class OwnBeaconStore extends AsyncStoreWithClient<OwnBeaconStoreState> {
|
|||||||
const existingLiveBeaconIdsForRoom = this.getLiveBeaconIds(roomId);
|
const existingLiveBeaconIdsForRoom = this.getLiveBeaconIds(roomId);
|
||||||
await Promise.all(existingLiveBeaconIdsForRoom.map((beaconId) => this.stopBeacon(beaconId)));
|
await Promise.all(existingLiveBeaconIdsForRoom.map((beaconId) => this.stopBeacon(beaconId)));
|
||||||
|
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
const { event_id } = await doMaybeLocalRoomAction(
|
const { event_id } = await doMaybeLocalRoomAction(
|
||||||
roomId,
|
roomId,
|
||||||
(actualRoomId: string) => this.matrixClient!.unstable_createLiveBeacon(actualRoomId, beaconInfoContent),
|
(actualRoomId: string) => this.matrixClient!.unstable_createLiveBeacon(actualRoomId, beaconInfoContent),
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ export class RoomViewStore extends EventEmitter {
|
|||||||
if (this.lockedToRoomId && payload.room_id && this.lockedToRoomId !== payload.room_id) {
|
if (this.lockedToRoomId && payload.room_id && this.lockedToRoomId !== payload.room_id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// eslint-disable-line @typescript-eslint/naming-convention
|
|
||||||
switch (payload.action) {
|
switch (payload.action) {
|
||||||
// view_room:
|
// view_room:
|
||||||
// - room_alias: '#somealias:matrix.org'
|
// - room_alias: '#somealias:matrix.org'
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ import { type RoomType } from "matrix-js-sdk/src/matrix";
|
|||||||
export interface IThreepidInviteWireFormat {
|
export interface IThreepidInviteWireFormat {
|
||||||
email: string;
|
email: string;
|
||||||
signurl: string;
|
signurl: string;
|
||||||
room_name: string; // eslint-disable-line camelcase
|
room_name: string;
|
||||||
room_avatar_url: string; // eslint-disable-line camelcase
|
room_avatar_url: string;
|
||||||
inviter_name: string; // eslint-disable-line camelcase
|
inviter_name: string;
|
||||||
|
|
||||||
// TODO: Figure out if these are ever populated
|
// TODO: Figure out if these are ever populated
|
||||||
guest_access_token?: string; // eslint-disable-line camelcase
|
guest_access_token?: string;
|
||||||
guest_user_id?: string; // eslint-disable-line camelcase
|
guest_user_id?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IPersistedThreepidInvite extends IThreepidInviteWireFormat {
|
interface IPersistedThreepidInvite extends IThreepidInviteWireFormat {
|
||||||
@@ -46,7 +46,6 @@ export interface IOOBData {
|
|||||||
name?: string; // The room's name
|
name?: string; // The room's name
|
||||||
avatarUrl?: string; // The mxc:// avatar URL for the room
|
avatarUrl?: string; // The mxc:// avatar URL for the room
|
||||||
inviterName?: string; // The display name of the person who invited us to 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
|
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
|
roomType?: RoomType | string; // The type of the room, to be used until we are told better by the server
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,11 +84,7 @@ export class VoiceRecordingStore extends AsyncStoreWithClient<IState> {
|
|||||||
public disposeRecording(voiceRecordingId: string): Promise<void> {
|
public disposeRecording(voiceRecordingId: string): Promise<void> {
|
||||||
this.state[voiceRecordingId]?.destroy(); // stops internally
|
this.state[voiceRecordingId]?.destroy(); // stops internally
|
||||||
|
|
||||||
const {
|
const { [voiceRecordingId]: _toDelete, ...newState } = this.state;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
[voiceRecordingId]: _toDelete,
|
|
||||||
...newState
|
|
||||||
} = this.state;
|
|
||||||
// unexpectedly AsyncStore.updateState merges state
|
// unexpectedly AsyncStore.updateState merges state
|
||||||
// AsyncStore.reset actually just *sets*
|
// AsyncStore.reset actually just *sets*
|
||||||
return this.reset(newState);
|
return this.reset(newState);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ const ROOM_PREVIEW_CHANGED = "room_preview_changed";
|
|||||||
const MAX_EVENTS_BACKWARDS = 50;
|
const MAX_EVENTS_BACKWARDS = 50;
|
||||||
|
|
||||||
// type merging ftw
|
// 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";
|
const TAG_ANY: TAG_ANY = "im.vector.any";
|
||||||
|
|
||||||
export interface MessagePreview {
|
export interface MessagePreview {
|
||||||
|
|||||||
@@ -56,6 +56,6 @@ export interface IHangupCallApiRequest extends IWidgetApiRequest {
|
|||||||
*/
|
*/
|
||||||
export interface IViewRoomApiRequest extends IWidgetApiRequest {
|
export interface IViewRoomApiRequest extends IWidgetApiRequest {
|
||||||
data: {
|
data: {
|
||||||
room_id: string; // eslint-disable-line camelcase
|
room_id: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ interface CompoundTheme {
|
|||||||
|
|
||||||
export type CustomTheme = {
|
export type CustomTheme = {
|
||||||
name: string;
|
name: string;
|
||||||
is_dark?: boolean; // eslint-disable-line camelcase
|
is_dark?: boolean;
|
||||||
colors?: {
|
colors?: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -50,10 +50,8 @@ describe("FixedRollingArray", () => {
|
|||||||
expect(previous - current).toBe(1);
|
expect(previous - current).toBe(1);
|
||||||
|
|
||||||
if (i === 1) {
|
if (i === 1) {
|
||||||
// eslint-disable-next-line jest/no-conditional-expect
|
|
||||||
expect(previous).toBe(maxValue);
|
expect(previous).toBe(maxValue);
|
||||||
} else if (i === width) {
|
} else if (i === width) {
|
||||||
// eslint-disable-next-line jest/no-conditional-expect
|
|
||||||
expect(current).toBe(minValue);
|
expect(current).toBe(minValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export async function decryptMegolmKeyFile(data: ArrayBuffer, password: string):
|
|||||||
export async function encryptMegolmKeyFile(
|
export async function encryptMegolmKeyFile(
|
||||||
data: string,
|
data: string,
|
||||||
password: string,
|
password: string,
|
||||||
options?: { kdf_rounds?: number }, // eslint-disable-line camelcase
|
options?: { kdf_rounds?: number },
|
||||||
): Promise<ArrayBuffer> {
|
): Promise<ArrayBuffer> {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
const kdfRounds = options.kdf_rounds || 500000;
|
const kdfRounds = options.kdf_rounds || 500000;
|
||||||
|
|||||||
@@ -217,7 +217,6 @@ export async function getSessionLock(onNewInstance: () => Promise<void>): Promis
|
|||||||
window.localStorage.setItem(SESSION_LOCK_CONSTANTS.STORAGE_ITEM_CLAIMANT, sessionIdentifier);
|
window.localStorage.setItem(SESSION_LOCK_CONSTANTS.STORAGE_ITEM_CLAIMANT, sessionIdentifier);
|
||||||
|
|
||||||
// now, wait for the lock to be free.
|
// now, wait for the lock to be free.
|
||||||
// eslint-disable-next-line no-constant-condition
|
|
||||||
while (true) {
|
while (true) {
|
||||||
const remaining = checkLock();
|
const remaining = checkLock();
|
||||||
|
|
||||||
|
|||||||
@@ -33,14 +33,12 @@ describe("snakeToCamel", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("SnakedObject", () => {
|
describe("SnakedObject", () => {
|
||||||
/* eslint-disable camelcase*/
|
|
||||||
const input = {
|
const input = {
|
||||||
snake_case: "woot",
|
snake_case: "woot",
|
||||||
snakeCase: "oh no", // ensure different value from snake_case for tests
|
snakeCase: "oh no", // ensure different value from snake_case for tests
|
||||||
camelCase: "fallback",
|
camelCase: "fallback",
|
||||||
};
|
};
|
||||||
const snake = new SnakedObject(input);
|
const snake = new SnakedObject(input);
|
||||||
/* eslint-enable camelcase*/
|
|
||||||
|
|
||||||
it("should prefer snake_case keys", () => {
|
it("should prefer snake_case keys", () => {
|
||||||
expect(snake.get("snake_case")).toBe(input.snake_case);
|
expect(snake.get("snake_case")).toBe(input.snake_case);
|
||||||
|
|||||||
@@ -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");
|
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";
|
const EMBEDDED_PAGES_WK_PROPERTY = "io.element.embedded_pages";
|
||||||
|
|
||||||
/* eslint-disable camelcase */
|
|
||||||
export interface ICallBehaviourWellKnown {
|
export interface ICallBehaviourWellKnown {
|
||||||
widget_build_url?: string;
|
widget_build_url?: string;
|
||||||
ignore_dm?: boolean;
|
ignore_dm?: boolean;
|
||||||
@@ -39,7 +38,6 @@ export interface ITileServerWellKnown {
|
|||||||
export interface IEmbeddedPagesWellKnown {
|
export interface IEmbeddedPagesWellKnown {
|
||||||
home_url?: string;
|
home_url?: string;
|
||||||
}
|
}
|
||||||
/* eslint-enable camelcase */
|
|
||||||
|
|
||||||
export function getCallBehaviourWellKnown(matrixClient: MatrixClient): ICallBehaviourWellKnown {
|
export function getCallBehaviourWellKnown(matrixClient: MatrixClient): ICallBehaviourWellKnown {
|
||||||
const clientWellKnown = matrixClient.getClientWellKnown();
|
const clientWellKnown = matrixClient.getClientWellKnown();
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import { type IWidget } from "matrix-widget-api";
|
|||||||
export interface IApp extends IWidget {
|
export interface IApp extends IWidget {
|
||||||
"roomId": string;
|
"roomId": string;
|
||||||
"eventId"?: string; // not present on virtual widgets
|
"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
|
"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
|
// Whether the widget was created from `widget_build_url` and thus is a call widget of some kind
|
||||||
"io.element.managed_hybrid"?: boolean;
|
"io.element.managed_hybrid"?: boolean;
|
||||||
@@ -22,7 +21,6 @@ export interface IWidgetEvent {
|
|||||||
id: string;
|
id: string;
|
||||||
type: string;
|
type: string;
|
||||||
sender: string;
|
sender: string;
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
state_key: string;
|
state_key: string;
|
||||||
content: IApp;
|
content: IApp;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ const makeDeviceExtendedInfo = (
|
|||||||
client: clientName && [clientName, clientVersion].filter(Boolean).join(" "),
|
client: clientName && [clientName, clientVersion].filter(Boolean).join(" "),
|
||||||
});
|
});
|
||||||
|
|
||||||
/* eslint-disable max-len */
|
|
||||||
const ANDROID_UA = [
|
const ANDROID_UA = [
|
||||||
// New User Agent Implementation
|
// 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)",
|
"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),
|
||||||
makeDeviceExtendedInfo(DeviceType.Unknown, undefined, undefined, undefined, undefined),
|
makeDeviceExtendedInfo(DeviceType.Unknown, undefined, undefined, undefined, undefined),
|
||||||
];
|
];
|
||||||
/* eslint-disable max-len */
|
|
||||||
|
|
||||||
describe("parseUserAgent()", () => {
|
describe("parseUserAgent()", () => {
|
||||||
it("returns deviceType unknown when user agent is falsy", () => {
|
it("returns deviceType unknown when user agent is falsy", () => {
|
||||||
|
|||||||
@@ -119,7 +119,6 @@ export class DirectoryMember extends Member {
|
|||||||
private readonly displayName?: string;
|
private readonly displayName?: string;
|
||||||
private readonly avatarUrl?: string;
|
private readonly avatarUrl?: string;
|
||||||
|
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
public constructor(userDirResult: { user_id: string; display_name?: string; avatar_url?: string }) {
|
public constructor(userDirResult: { user_id: string; display_name?: string; avatar_url?: string }) {
|
||||||
super();
|
super();
|
||||||
this._userId = userDirResult.user_id;
|
this._userId = userDirResult.user_id;
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ export async function waitForMember(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new Promise<boolean>((resolve) => {
|
return new Promise<boolean>((resolve) => {
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
||||||
handler = function (_, __, member: RoomMember) {
|
handler = function (_, __, member: RoomMember) {
|
||||||
if (member.userId !== userId) return;
|
if (member.userId !== userId) return;
|
||||||
if (member.roomId !== roomId) return;
|
if (member.roomId !== roomId) return;
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ const monitorSyncedRule = async (
|
|||||||
if (outOfSyncRules.length) {
|
if (outOfSyncRules.length) {
|
||||||
await updateExistingPushRulesWithActions(
|
await updateExistingPushRulesWithActions(
|
||||||
matrixClient,
|
matrixClient,
|
||||||
// eslint-disable-next-line camelcase, @typescript-eslint/naming-convention
|
|
||||||
outOfSyncRules.map(({ rule_id }) => rule_id),
|
outOfSyncRules.map(({ rule_id }) => rule_id),
|
||||||
primaryRule.enabled ? primaryRule.actions : undefined,
|
primaryRule.enabled ? primaryRule.actions : undefined,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ async function pickleKeyToAesKey(pickleKey: string): Promise<Uint8Array<ArrayBuf
|
|||||||
{
|
{
|
||||||
name: "HKDF",
|
name: "HKDF",
|
||||||
hash: "SHA-256",
|
hash: "SHA-256",
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-ignore: https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/879
|
// @ts-ignore: https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/879
|
||||||
salt: new Uint8Array(32),
|
salt: new Uint8Array(32),
|
||||||
info: new Uint8Array(0),
|
info: new Uint8Array(0),
|
||||||
|
|||||||
@@ -257,7 +257,6 @@ start().catch((err) => {
|
|||||||
// with some basic styling to make the iframe full page
|
// with some basic styling to make the iframe full page
|
||||||
document.body.style.removeProperty("height");
|
document.body.style.removeProperty("height");
|
||||||
const iframe = document.createElement("iframe");
|
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
|
// @ts-ignore - typescript seems to only like the IE syntax for iframe sandboxing
|
||||||
iframe["sandbox"] = "";
|
iframe["sandbox"] = "";
|
||||||
iframe.src = supportedBrowser ? "static/unable-to-load.html" : "static/incompatible-browser.html";
|
iframe.src = supportedBrowser ? "static/unable-to-load.html" : "static/incompatible-browser.html";
|
||||||
|
|||||||
@@ -392,7 +392,6 @@ async function joinConference(audioInput?: string | null, videoInput?: string |
|
|||||||
logger.log("Got OpenID Connect token");
|
logger.log("Got OpenID Connect token");
|
||||||
|
|
||||||
if (!openIdToken?.access_token) {
|
if (!openIdToken?.access_token) {
|
||||||
// eslint-disable-line camelcase
|
|
||||||
// We've failing to get a token, don't try to init conference
|
// We've failing to get a token, don't try to init conference
|
||||||
logger.warn("Expected to have an OpenID credential, cannot initialize widget.");
|
logger.warn("Expected to have an OpenID credential, cannot initialize widget.");
|
||||||
document.getElementById("widgetActionContainer")!.innerText = "Failed to load Jitsi widget";
|
document.getElementById("widgetActionContainer")!.innerText = "Failed to load Jitsi widget";
|
||||||
|
|||||||
+1
-1
@@ -154,7 +154,7 @@ describe("BaseOngoingCallViewModel", () => {
|
|||||||
const vm = new BaseOngoingCallViewModel({ mxEvent, cli, callStore, roomId, legacyCallHandler });
|
const vm = new BaseOngoingCallViewModel({ mxEvent, cli, callStore, roomId, legacyCallHandler });
|
||||||
|
|
||||||
vm.join();
|
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(room.roomId).toStrictEqual(roomId);
|
||||||
expect(callType).toStrictEqual(CallType.Video);
|
expect(callType).toStrictEqual(CallType.Video);
|
||||||
expect(platformCallType).toStrictEqual(PlatformCallType.ElementCall);
|
expect(platformCallType).toStrictEqual(PlatformCallType.ElementCall);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import { ElementWidgetCapabilities } from "../stores/widgets/ElementWidgetCapabi
|
|||||||
import { MatrixClientPeg } from "../MatrixClientPeg";
|
import { MatrixClientPeg } from "../MatrixClientPeg";
|
||||||
import TextWithTooltip from "../components/views/elements/TextWithTooltip";
|
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";
|
const GENERIC_WIDGET_KIND: GENERIC_WIDGET_KIND = "generic";
|
||||||
|
|
||||||
type SendRecvStaticCapText = Partial<
|
type SendRecvStaticCapText = Partial<
|
||||||
|
|||||||
@@ -18,13 +18,11 @@ import WidgetStore, { type IApp } from "../stores/WidgetStore";
|
|||||||
import SdkConfig from "../SdkConfig";
|
import SdkConfig from "../SdkConfig";
|
||||||
import { getJoinedNonFunctionalMembers } from "../utils/room/getJoinedNonFunctionalMembers";
|
import { getJoinedNonFunctionalMembers } from "../utils/room/getJoinedNonFunctionalMembers";
|
||||||
|
|
||||||
/* eslint-disable camelcase */
|
|
||||||
interface IManagedHybridWidgetData {
|
interface IManagedHybridWidgetData {
|
||||||
widget_id: string;
|
widget_id: string;
|
||||||
widget: IWidget;
|
widget: IWidget;
|
||||||
layout: IStoredLayout;
|
layout: IStoredLayout;
|
||||||
}
|
}
|
||||||
/* eslint-enable camelcase */
|
|
||||||
|
|
||||||
function getWidgetBuildUrl(room: Room): string | undefined {
|
function getWidgetBuildUrl(room: Room): string | undefined {
|
||||||
const functionalMembers = getJoinedNonFunctionalMembers(room);
|
const functionalMembers = getJoinedNonFunctionalMembers(room);
|
||||||
@@ -40,7 +38,6 @@ function getWidgetBuildUrl(room: Room): string | undefined {
|
|||||||
if (isDm && wellKnown?.ignore_dm) {
|
if (isDm && wellKnown?.ignore_dm) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
/* eslint-disable-next-line camelcase */
|
|
||||||
return wellKnown?.widget_build_url;
|
return wellKnown?.widget_build_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +53,6 @@ export async function addManagedHybridWidget(room: Room): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get widget data
|
// Get widget data
|
||||||
/* eslint-disable-next-line camelcase */
|
|
||||||
const widgetBuildUrl = getWidgetBuildUrl(room);
|
const widgetBuildUrl = getWidgetBuildUrl(room);
|
||||||
if (!widgetBuildUrl) {
|
if (!widgetBuildUrl) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import { PredictableRandom } from "./test-utils/predictableRandom";
|
|||||||
import * as rageshake from "../src/rageshake/rageshake";
|
import * as rageshake from "../src/rageshake/rageshake";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// eslint-disable-next-line no-var
|
|
||||||
var IS_REACT_ACT_ENVIRONMENT: boolean;
|
var IS_REACT_ACT_ENVIRONMENT: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -417,7 +417,6 @@ type MakeEventProps = MakeEventPassThruProps & {
|
|||||||
redacts?: string;
|
redacts?: string;
|
||||||
content: IContent;
|
content: IContent;
|
||||||
room?: Room["roomId"]; // to-device messages are roomless
|
room?: Room["roomId"]; // to-device messages are roomless
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
prev_content?: IContent;
|
prev_content?: IContent;
|
||||||
unsigned?: IUnsigned;
|
unsigned?: IUnsigned;
|
||||||
status?: EventStatus;
|
status?: EventStatus;
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ describe("PictureInPictureDragger", () => {
|
|||||||
<PictureInPictureDragger>
|
<PictureInPictureDragger>
|
||||||
{[
|
{[
|
||||||
({ onStartMoving }) => (
|
({ onStartMoving }) => (
|
||||||
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
||||||
<div onMouseDown={onStartMoving} onClick={clickSpy}>
|
<div onMouseDown={onStartMoving} onClick={clickSpy}>
|
||||||
Hello
|
Hello
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ describe("<Pill>", () => {
|
|||||||
} as PillProps;
|
} as PillProps;
|
||||||
// wrap Pill with a div to allow testing of event bubbling
|
// wrap Pill with a div to allow testing of event bubbling
|
||||||
renderResult = render(
|
renderResult = render(
|
||||||
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
||||||
<SDKContext.Provider value={mockSdkContext}>
|
<SDKContext.Provider value={mockSdkContext}>
|
||||||
<div onClick={pillParentClickHandler}>
|
<div onClick={pillParentClickHandler}>
|
||||||
<Pill {...withDefault} />
|
<Pill {...withDefault} />
|
||||||
|
|||||||
@@ -214,10 +214,8 @@ describe("MessageComposer", () => {
|
|||||||
|
|
||||||
it(`should${value ? "" : " not"} display the button`, () => {
|
it(`should${value ? "" : " not"} display the button`, () => {
|
||||||
if (value) {
|
if (value) {
|
||||||
// eslint-disable-next-line jest/no-conditional-expect
|
|
||||||
expect(screen.getByLabelText(buttonLabel)).toBeInTheDocument();
|
expect(screen.getByLabelText(buttonLabel)).toBeInTheDocument();
|
||||||
} else {
|
} else {
|
||||||
// eslint-disable-next-line jest/no-conditional-expect
|
|
||||||
expect(screen.queryByLabelText(buttonLabel)).not.toBeInTheDocument();
|
expect(screen.queryByLabelText(buttonLabel)).not.toBeInTheDocument();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -240,10 +238,8 @@ describe("MessageComposer", () => {
|
|||||||
|
|
||||||
it(`should${!value || "not"} display the button`, () => {
|
it(`should${!value || "not"} display the button`, () => {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
// eslint-disable-next-line jest/no-conditional-expect
|
|
||||||
expect(screen.getByLabelText(buttonLabel)).toBeInTheDocument();
|
expect(screen.getByLabelText(buttonLabel)).toBeInTheDocument();
|
||||||
} else {
|
} else {
|
||||||
// eslint-disable-next-line jest/no-conditional-expect
|
|
||||||
expect(screen.queryByLabelText(buttonLabel)).not.toBeInTheDocument();
|
expect(screen.queryByLabelText(buttonLabel)).not.toBeInTheDocument();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
-2
@@ -347,10 +347,8 @@ describe("SendWysiwygComposer", () => {
|
|||||||
expect(leftIcon).toBeInTheDocument();
|
expect(leftIcon).toBeInTheDocument();
|
||||||
expect(leftIcon).toHaveClass("mx_E2EIcon");
|
expect(leftIcon).toHaveClass("mx_E2EIcon");
|
||||||
if (expectedLabel) {
|
if (expectedLabel) {
|
||||||
// eslint-disable-next-line jest/no-conditional-expect
|
|
||||||
expect(leftIcon).toHaveAccessibleName(expectedLabel);
|
expect(leftIcon).toHaveAccessibleName(expectedLabel);
|
||||||
} else {
|
} else {
|
||||||
// eslint-disable-next-line jest/no-conditional-expect
|
|
||||||
expect(leftIcon.querySelector("svg")).not.toBeInTheDocument();
|
expect(leftIcon.querySelector("svg")).not.toBeInTheDocument();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
-1
@@ -536,7 +536,6 @@ describe("WysiwygComposer", () => {
|
|||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
const selection = document.getSelection();
|
const selection = document.getSelection();
|
||||||
if (selection) {
|
if (selection) {
|
||||||
// eslint-disable-next-line jest/no-conditional-expect
|
|
||||||
expect(selection.focusNode?.textContent).toEqual("other");
|
expect(selection.focusNode?.textContent).toEqual("other");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ const createTransitionEndEvent = (): Event => {
|
|||||||
// TransitionEvent constructor does not exist.
|
// TransitionEvent constructor does not exist.
|
||||||
// This is needed because of the following check
|
// This is needed because of the following check
|
||||||
// https://github.com/atlassian/react-beautiful-dnd/blob/master/src/view/draggable/draggable.jsx#L130
|
// 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";
|
(event as any).propertyName = "transform";
|
||||||
|
|
||||||
return event;
|
return event;
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ describe("StorageManager", () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await populateHealthySession();
|
await populateHealthySession();
|
||||||
// eslint-disable-next-line no-global-assign
|
|
||||||
indexedDB = new IDBFactory();
|
indexedDB = new IDBFactory();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -109,13 +108,11 @@ describe("StorageManager", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not be healthy if no indexeddb", async () => {
|
it("should not be healthy if no indexeddb", async () => {
|
||||||
// eslint-disable-next-line no-global-assign
|
|
||||||
indexedDB = {} as IDBFactory;
|
indexedDB = {} as IDBFactory;
|
||||||
|
|
||||||
const result = await StorageManager.checkConsistency();
|
const result = await StorageManager.checkConsistency();
|
||||||
expect(result.healthy).toBe(false);
|
expect(result.healthy).toBe(false);
|
||||||
|
|
||||||
// eslint-disable-next-line no-global-assign
|
|
||||||
indexedDB = new IDBFactory();
|
indexedDB = new IDBFactory();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details.
|
|||||||
|
|
||||||
import { withMermaid } from "vitepress-plugin-mermaid";
|
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);
|
const [link, fragment] = href.split("#", 2);
|
||||||
if (currentPath === "index.md") {
|
if (currentPath === "index.md") {
|
||||||
if (link.startsWith("./docs/")) {
|
if (link.startsWith("./docs/")) {
|
||||||
|
|||||||
@@ -27,6 +27,5 @@ export const Theme = z.object({
|
|||||||
export type Theme = z.infer<typeof Theme>;
|
export type Theme = z.infer<typeof Theme>;
|
||||||
|
|
||||||
declare module "styled-components" {
|
declare module "styled-components" {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
||||||
export interface DefaultTheme extends Theme {}
|
export interface DefaultTheme extends Theme {}
|
||||||
}
|
}
|
||||||
|
|||||||
+104
-75
@@ -41,7 +41,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
typeAware: true,
|
typeAware: true,
|
||||||
reportUnusedDisableDirectives: "off",
|
reportUnusedDisableDirectives: "warn",
|
||||||
maxWarnings: 0,
|
maxWarnings: 0,
|
||||||
denyWarnings: true,
|
denyWarnings: true,
|
||||||
},
|
},
|
||||||
@@ -94,6 +94,15 @@ export default defineConfig({
|
|||||||
],
|
],
|
||||||
"prefer-const": ["error", { destructuring: "all" }],
|
"prefer-const": ["error", { destructuring: "all" }],
|
||||||
"import/first": "error",
|
"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",
|
"unicorn/no-instanceof-array": "error",
|
||||||
"no-restricted-globals": ["error", ...defaultRestrictedGlobals],
|
"no-restricted-globals": ["error", ...defaultRestrictedGlobals],
|
||||||
@@ -108,11 +117,16 @@ export default defineConfig({
|
|||||||
// Allow the use of underscore to show args are not used.
|
// Allow the use of underscore to show args are not used.
|
||||||
// This is helpful for seeing that a function implements
|
// This is helpful for seeing that a function implements
|
||||||
// an interface but won't be using one of it's arguments.
|
// 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
|
// Require method signatures to be explicit to help make signature changes more obvious in review
|
||||||
"typescript/explicit-function-return-type": "off",
|
"typescript/explicit-function-return-type": [
|
||||||
"typescript/explicit-member-accessibility": "off",
|
"error",
|
||||||
|
{
|
||||||
|
allowExpressions: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"typescript/explicit-member-accessibility": "error",
|
||||||
|
|
||||||
// Require us to be more explicit about type conversions to help prevent bugs
|
// Require us to be more explicit about type conversions to help prevent bugs
|
||||||
"typescript/no-base-to-string": ["error"],
|
"typescript/no-base-to-string": ["error"],
|
||||||
@@ -146,8 +160,6 @@ export default defineConfig({
|
|||||||
"typescript/no-redundant-type-constituents": "off",
|
"typescript/no-redundant-type-constituents": "off",
|
||||||
"typescript/no-useless-default-assignment": "off",
|
"typescript/no-useless-default-assignment": "off",
|
||||||
"typescript/no-duplicate-type-constituents": "off",
|
"typescript/no-duplicate-type-constituents": "off",
|
||||||
"no-unused-vars": "off",
|
|
||||||
"eslint/no-unused-vars": "off",
|
|
||||||
"typescript/no-floating-promises": "off",
|
"typescript/no-floating-promises": "off",
|
||||||
"typescript/no-implied-eval": "off",
|
"typescript/no-implied-eval": "off",
|
||||||
"typescript/no-misused-spread": "off",
|
"typescript/no-misused-spread": "off",
|
||||||
@@ -174,7 +186,71 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
overrides: [
|
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 <Heading> instead" },
|
||||||
|
{ element: "h2", message: "Use Compound <Heading> instead" },
|
||||||
|
{ element: "h3", message: "Use Compound <Heading> instead" },
|
||||||
|
{ element: "h4", message: "Use Compound <Heading> instead" },
|
||||||
|
{ element: "h5", message: "Use Compound <Heading> instead" },
|
||||||
|
{ element: "h6", message: "Use Compound <Heading> instead" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ["apps/web/**/*"],
|
||||||
rules: {
|
rules: {
|
||||||
"no-restricted-properties": [
|
"no-restricted-properties": [
|
||||||
"error",
|
"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: {
|
rules: {
|
||||||
"no-restricted-globals": [
|
// This is a common pattern for Playwright fixtures
|
||||||
"error",
|
"no-empty-pattern": "off",
|
||||||
defaultRestrictedGlobals,
|
// Playwright has a `use` method for fixtures which confuses this rule
|
||||||
{
|
"react-hooks/rules-of-hooks": "off",
|
||||||
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 <Heading> instead" },
|
|
||||||
{ element: "h2", message: "Use Compound <Heading> instead" },
|
|
||||||
{ element: "h3", message: "Use Compound <Heading> instead" },
|
|
||||||
{ element: "h4", message: "Use Compound <Heading> instead" },
|
|
||||||
{ element: "h5", message: "Use Compound <Heading> instead" },
|
|
||||||
{ element: "h6", message: "Use Compound <Heading> 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",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
files: [
|
files: [
|
||||||
"{packages,apps,modules}/*/src/**/*.{test,stories}.{ts,tsx}",
|
"{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}/*/{test,playwright,e2e}/**/*",
|
||||||
"{packages,apps,modules}/*/playwright.config.ts",
|
"{packages,apps,modules}/*/playwright.config.ts",
|
||||||
"{packages,apps,modules}/*/.storybook/**/*",
|
"{packages,apps,modules}/*/.storybook/**/*",
|
||||||
@@ -386,7 +408,6 @@ export default defineConfig({
|
|||||||
rules: {
|
rules: {
|
||||||
// Tests can be linted a little more flexibly
|
// Tests can be linted a little more flexibly
|
||||||
// We don't need super strict typing in test utilities
|
// We don't need super strict typing in test utilities
|
||||||
"no-empty-pattern": "off",
|
|
||||||
"no-import-assign": "off",
|
"no-import-assign": "off",
|
||||||
"no-unsafe-optional-chaining": "off",
|
"no-unsafe-optional-chaining": "off",
|
||||||
"typescript/no-empty-object-type": "off",
|
"typescript/no-empty-object-type": "off",
|
||||||
@@ -412,6 +433,8 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
"jsdoc/check-tag-names": "off",
|
"jsdoc/check-tag-names": "off",
|
||||||
|
"typescript/explicit-function-return-type": "off",
|
||||||
|
"typescript/explicit-member-accessibility": "off",
|
||||||
|
|
||||||
// Disable a11y rules for components in tests
|
// Disable a11y rules for components in tests
|
||||||
"jsx-a11y/role-has-required-aria-props": "off",
|
"jsx-a11y/role-has-required-aria-props": "off",
|
||||||
@@ -446,6 +469,12 @@ export default defineConfig({
|
|||||||
"storybook/no-uninstalled-addons": "error",
|
"storybook/no-uninstalled-addons": "error",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
files: ["**/*.{cjs,js}"],
|
||||||
|
rules: {
|
||||||
|
"typescript/no-require-imports": "off",
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
-1
@@ -6,7 +6,6 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// eslint-disable-next-line no-var
|
|
||||||
var __VERSION__: string; // injected by vite
|
var __VERSION__: string; // injected by vite
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
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
|
// @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";
|
import type { ModuleApi, RuntimeModule } from "@matrix-org/react-sdk-module-api";
|
||||||
|
|
||||||
@@ -19,7 +18,6 @@ export type RuntimeModuleConstructor = new (api: ModuleApi) => RuntimeModule;
|
|||||||
* @alpha
|
* @alpha
|
||||||
* @deprecated in favour of the new module API
|
* @deprecated in favour of the new module API
|
||||||
*/
|
*/
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
|
||||||
export interface LegacyModuleApiExtension {
|
export interface LegacyModuleApiExtension {
|
||||||
/**
|
/**
|
||||||
* Register a legacy module based on \@matrix-org/react-sdk-module-api
|
* Register a legacy module based on \@matrix-org/react-sdk-module-api
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ export interface Services {
|
|||||||
|
|
||||||
export const test = base.extend<TestFixtures, WorkerOptions & Services>({
|
export const test = base.extend<TestFixtures, WorkerOptions & Services>({
|
||||||
logger: [
|
logger: [
|
||||||
// eslint-disable-next-line no-empty-pattern
|
|
||||||
async ({}, use) => {
|
async ({}, use) => {
|
||||||
const logger = new Logger();
|
const logger = new Logger();
|
||||||
await use(logger);
|
await use(logger);
|
||||||
@@ -92,7 +91,6 @@ export const test = base.extend<TestFixtures, WorkerOptions & Services>({
|
|||||||
{ scope: "worker" },
|
{ scope: "worker" },
|
||||||
],
|
],
|
||||||
network: [
|
network: [
|
||||||
// eslint-disable-next-line no-empty-pattern
|
|
||||||
async ({}, use) => {
|
async ({}, use) => {
|
||||||
const network = await new Network().start();
|
const network = await new Network().start();
|
||||||
await use(network);
|
await use(network);
|
||||||
@@ -152,7 +150,6 @@ export const test = base.extend<TestFixtures, WorkerOptions & Services>({
|
|||||||
{ scope: "worker" },
|
{ scope: "worker" },
|
||||||
],
|
],
|
||||||
mas: [
|
mas: [
|
||||||
// eslint-disable-next-line no-empty-pattern
|
|
||||||
async ({}, use) => {
|
async ({}, use) => {
|
||||||
// we stub the mas fixture to allow `homeserver` to depend on it to ensure
|
// 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
|
// when it is specified by `masHomeserver` it is started before the homeserver
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export const languageAddon: Addon = {
|
|||||||
title: "Language Selector",
|
title: "Language Selector",
|
||||||
type: types.TOOL,
|
type: types.TOOL,
|
||||||
render: ({ active }) => {
|
render: ({ active }) => {
|
||||||
|
// oxlint-disable-next-line react-hooks/rules-of-hooks
|
||||||
const [globals, updateGlobals] = useGlobals();
|
const [globals, updateGlobals] = useGlobals();
|
||||||
const selectedLanguage = globals.language || "en";
|
const selectedLanguage = globals.language || "en";
|
||||||
|
|
||||||
|
|||||||
@@ -605,7 +605,6 @@ export const useRovingTabIndex = <T extends HTMLElement>(
|
|||||||
});
|
});
|
||||||
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
// eslint-disable-next-line react-compiler/react-compiler
|
|
||||||
const isActive = context.state.activeNode === nodeRef.current;
|
const isActive = context.state.activeNode === nodeRef.current;
|
||||||
return [onFocus, isActive, ref, nodeRef];
|
return [onFocus, isActive, ref, nodeRef];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import React, { type JSX, type ComponentProps, type JSXElementConstructor, useMe
|
|||||||
|
|
||||||
import styles from "./Flex.module.css";
|
import styles from "./Flex.module.css";
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
type FlexProps<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = {
|
type FlexProps<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = {
|
||||||
/**
|
/**
|
||||||
* The type of the HTML element
|
* The type of the HTML element
|
||||||
@@ -61,7 +60,6 @@ type FlexProps<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any
|
|||||||
/**
|
/**
|
||||||
* A flexbox container helper
|
* A flexbox container helper
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
export function Flex<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "div">({
|
export function Flex<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "div">({
|
||||||
as = "div",
|
as = "div",
|
||||||
display = "flex",
|
display = "flex",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { describe, it, expect, vitest } from "vitest";
|
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 { Toast } from "@vector-im/compound-web";
|
||||||
import React, { type JSX } from "react";
|
import React, { type JSX } from "react";
|
||||||
|
|
||||||
|
|||||||
@@ -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", () => {
|
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]:";
|
const test = char + "username:[1234:5678::abcd]:";
|
||||||
expect(isLinkable(test)).toEqual(true);
|
expect(isLinkable(test)).toEqual(true);
|
||||||
|
|||||||
@@ -90,13 +90,11 @@ function parseOpaqueIdsToMatrixIds({
|
|||||||
const additionalDomainpartTokens = [HYPHEN];
|
const additionalDomainpartTokens = [HYPHEN];
|
||||||
|
|
||||||
const matrixToken = linkifyjs.createTokenClass(name, { isLink: true });
|
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<linkifyjs.MultiToken>; // linkify doesn't appear to type this correctly
|
const matrixTokenState = new linkifyjs.State(matrixToken) as any as linkifyjs.State<linkifyjs.MultiToken>; // linkify doesn't appear to type this correctly
|
||||||
|
|
||||||
const matrixTokenWithPort = linkifyjs.createTokenClass(name, { isLink: true });
|
const matrixTokenWithPort = linkifyjs.createTokenClass(name, { isLink: true });
|
||||||
const matrixTokenWithPortState = new linkifyjs.State(
|
const matrixTokenWithPortState = new linkifyjs.State(
|
||||||
matrixTokenWithPort,
|
matrixTokenWithPort,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
) as any as linkifyjs.State<linkifyjs.MultiToken>; // linkify doesn't appear to type this correctly
|
) as any as linkifyjs.State<linkifyjs.MultiToken>; // linkify doesn't appear to type this correctly
|
||||||
|
|
||||||
const initialState = parser.start.tt(token);
|
const initialState = parser.start.tt(token);
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ export function useCreateAutoDisposedViewModel<B extends BaseViewModel<unknown,
|
|||||||
* Or to put it in another way, the only reason to use this hook is to create/dispose the view-model
|
* Or to put it in another way, the only reason to use this hook is to create/dispose the view-model
|
||||||
* and that is something that should only happen at the start/end of the lifecycle of this component.
|
* and that is something that should only happen at the start/end of the lifecycle of this component.
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line react-compiler/react-compiler
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
-1
@@ -78,7 +78,6 @@ export function MoreOptionContent({ vm }: MoreOptionContentProps): JSX.Element {
|
|||||||
const hasSections = snapshot.sections.length > 0;
|
const hasSections = snapshot.sections.length > 0;
|
||||||
const isInSection = useMemo(() => snapshot.sections.some((section) => section.isSelected), [snapshot.sections]);
|
const isInSection = useMemo(() => snapshot.sections.some((section) => section.isSelected), [snapshot.sections]);
|
||||||
return (
|
return (
|
||||||
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
||||||
<div onKeyDown={(e) => e.stopPropagation()}>
|
<div onKeyDown={(e) => e.stopPropagation()}>
|
||||||
{snapshot.canMarkAsRead && (
|
{snapshot.canMarkAsRead && (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
|
|||||||
-1
@@ -59,7 +59,6 @@ export function RoomListItemNotificationMenu({ vm }: RoomListItemNotificationMen
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
|
|
||||||
<div
|
<div
|
||||||
// We don't want keyboard navigation events to bubble up to the ListView changing the focused item
|
// We don't want keyboard navigation events to bubble up to the ListView changing the focused item
|
||||||
onKeyDown={(e) => e.stopPropagation()}
|
onKeyDown={(e) => e.stopPropagation()}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user