Enable some more oxlint rules (#34193)

* Enable some more oxlint rules

* Iterate

* Iterate

* Update packages/shared-components/src/room/timeline/event-tile/EventTileView/E2ePadlock/E2ePadlock.tsx

Co-authored-by: Hubert Chathi <hubert@uhoreg.ca>

---------

Co-authored-by: Hubert Chathi <hubert@uhoreg.ca>
This commit is contained in:
Michael Telatynski
2026-08-10 12:25:55 +00:00
committed by GitHub
co-authored by Hubert Chathi
parent 4807ff1568
commit d54cddcb1d
26 changed files with 115 additions and 76 deletions
@@ -165,6 +165,7 @@ const groupedVariant: ListTestVariant = {
<div
className="mx_group_header"
data-testid={`group-header-${header.id}`}
// oxlint-disable-next-line jsx-a11y/no-noninteractive-tabindex
tabIndex={context.tabIndexKey === header.id ? 0 : -1}
onFocus={(e) => onFocus(header, e)}
>
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import React, { type JSX } from "react";
import { type JSX } from "react";
import { Text, type HTMLReactParserOptions } from "html-react-parser";
type Replacer = HTMLReactParserOptions["replace"];
@@ -28,7 +28,7 @@ export function applyReplacerOnString(
const arr = Array.isArray(input) ? input : [input];
return arr.map((item, index): JSX.Element => {
if (typeof item === "string") {
return <React.Fragment key={index}>{(replacer(new Text(item), 0) as JSX.Element) || item}</React.Fragment>;
return (replacer(new Text(item), 0) as JSX.Element) || item;
}
return item;
});
@@ -31,6 +31,7 @@ export function SasEmoji({ emoji, className }: Props): JSX.Element {
const { language } = useI18n();
const emojiBlocks = emoji.map((emoji, i) => (
// oxlint-disable-next-line react/no-array-index-key
<div className={styles.segment} key={i}>
<div className={styles.emoji} aria-hidden={true}>
{emoji}
@@ -102,6 +102,7 @@ export const RoomListPrimaryFilters = memo(function RoomListPrimaryFilters({
>
{visibleFilterIds.map((filterId, index) => (
<ChatFilter
// oxlint-disable-next-line react/no-array-index-key
key={`${filterId}-${index}`}
role="option"
tabIndex={0}
@@ -69,6 +69,8 @@ export function E2ePadlock({ icon, title, className }: Readonly<E2ePadlockProps>
data-testid="e2e-padlock"
className={classNames(styles.e2ePadlock, iconClasses[icon], className)}
role="img"
// This is only tab indexed to act as a tooltip trigger
// oxlint-disable-next-line jsx-a11y/no-noninteractive-tabindex
tabIndex={0}
aria-label={_t("timeline|e2e_state")}
>
@@ -257,6 +257,7 @@ export function FileBodyView({ vm, refIFrame, refLink, className }: Readonly<Fil
* We'll use it to learn how the download button
* would have been styled if it was rendered inline.
* this violates multiple eslint rules so ignore it completely */}
{/* oxlint-disable-next-line jsx-a11y/control-has-associated-label */}
<Button size="md" kind="secondary" Icon={DownloadIcon} as="a" ref={refLink} />
</div>
{/*