Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 29 additions & 23 deletions openmetadata-ui/src/main/resources/ui/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -294,33 +294,39 @@ export default [
'jsx-a11y/no-distracting-elements': 'error',
'jsx-a11y/scope': 'error',

// --- blocking (error): brought to zero by the ESLint-cleanup stack and
// locked so they cannot regress. jsx-a11y + safe-mechanical sonarjs were
// cleared in the a11y/safe-mechanical PR; promoting to error keeps CI red
// on any new violation instead of letting the backlog silently grow back.
'jsx-a11y/control-has-associated-label': 'error',
'jsx-a11y/click-events-have-key-events': 'error',
'jsx-a11y/no-static-element-interactions': 'error',
'jsx-a11y/label-has-for': 'error',
'jsx-a11y/no-autofocus': 'error',
'jsx-a11y/anchor-has-content': 'error',
'jsx-a11y/no-noninteractive-element-interactions': 'error',
'jsx-a11y/interactive-supports-focus': 'error',
'jsx-a11y/anchor-is-valid': 'error',
'jsx-a11y/alt-text': 'error',
'jsx-a11y/no-redundant-roles': 'error',
'jsx-a11y/mouse-events-have-key-events': 'error',
'jsx-a11y/media-has-caption': 'error',
'jsx-a11y/no-noninteractive-element-to-interactive-role': 'error',
'jsx-a11y/anchor-ambiguous-text': 'error',
'sonarjs/no-collapsible-if': 'error',
'sonarjs/no-extra-arguments': 'error',
'sonarjs/no-redundant-jump': 'error',
'sonarjs/no-duplicated-branches': 'error',
'sonarjs/no-identical-functions': 'error',
'sonarjs/prefer-object-literal': 'error',
'sonarjs/no-redundant-boolean': 'error',

// --- warn tier: on, visible, not yet blocking. Counts are the measured
// backlog at the time of writing; they only go down.
// backlog at the time of writing; they only go down. Each is promoted to
// error by its own cleanup PR once its violations reach zero.
'react-hooks/exhaustive-deps': 'warn', // 1693 across 596 files
'jsx-a11y/control-has-associated-label': 'warn', // 146
'jsx-a11y/click-events-have-key-events': 'warn', // 89
'jsx-a11y/no-static-element-interactions': 'warn', // 87
'jsx-a11y/label-has-for': 'warn', // 61
'jsx-a11y/no-autofocus': 'warn', // 45
'jsx-a11y/anchor-has-content': 'warn', // 12
'jsx-a11y/no-noninteractive-element-interactions': 'warn', // 8
'jsx-a11y/interactive-supports-focus': 'warn', // 7
'jsx-a11y/anchor-is-valid': 'warn', // 5
'jsx-a11y/alt-text': 'warn', // 3
'jsx-a11y/no-redundant-roles': 'warn', // 2
'jsx-a11y/mouse-events-have-key-events': 'warn', // 2
'jsx-a11y/media-has-caption': 'warn', // 2
'jsx-a11y/no-noninteractive-element-to-interactive-role': 'warn', // 2
'jsx-a11y/anchor-ambiguous-text': 'warn', // 1
'sonarjs/no-duplicate-string': 'warn', // 640
'sonarjs/cognitive-complexity': ['warn', 15], // 85
'sonarjs/no-collapsible-if': 'warn', // 21
'sonarjs/no-extra-arguments': 'warn', // 20
'sonarjs/no-redundant-jump': 'warn', // 14
'sonarjs/no-duplicated-branches': 'warn', // 9
'sonarjs/no-identical-functions': 'warn', // 6
'sonarjs/prefer-object-literal': 'warn', // 1
'sonarjs/no-redundant-boolean': 'warn', // 1

// Complexity and structure. SonarCloud gates these on new code; these
// surface the same findings locally and in the editor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
setIsEditPost(!isEditPost);
};

const onUpdate = async (message: string) => {

Check warning on line 89 in openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/CommentCard.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

The 'onUpdate' function makes the dependencies of useCallback Hook (at line 98) change on every render. Move it inside the useCallback callback. Alternatively, wrap the definition of 'onUpdate' in its own useCallback() Hook
const updatedPost = { ...feed, message };
const patch = compare(feed, updatedPost);
updateFeed(feed.id, post.id, false, patch);
Expand Down Expand Up @@ -124,16 +124,17 @@
markdown={getFrontEndFormat(post.message)}
/>
);
}, [isEditPost, postMessage, handleSave]);

Check warning on line 127 in openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/CommentCard.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useMemo has missing dependencies: 'defaultValue' and 'post.message'. Either include them or remove the dependency array

return (
<div
className={classNames('d-flex justify-start relative reply-card gap-2', {
'reply-card-border-bottom': !isLastReply,
})}
data-testid="feed-reply-card"
role="presentation"
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}>

Check warning on line 137 in openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/CommentCard.component.tsx

View check run for this annotation

SonarQubeCloud / [open-metadata-ui] SonarCloud Code Analysis

Use <img alt=...> instead of the "presentation" role to ensure accessibility across all devices.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ui&issues=AZ_RSKMUr05lXYHPhGpp&open=AZ_RSKMUr05lXYHPhGpp&pullRequest=30989
<div className="profile-picture">
<UserPopOverCard userName={post.from ?? ''}>
<div className="d-flex items-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
return jest.fn(({ onSave, onTextChange }) => (
<div data-testid="feed-editor">
<input
aria-label="Editor input"
data-testid="editor-input"
onChange={(e) => onTextChange(e.target.value)}
/>
Expand Down Expand Up @@ -106,7 +107,7 @@

const createMockFeed = (): Thread => ({
id: 'thread-123',
href: 'http://test',

Check warning on line 110 in openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/CommentCard.test.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

Using http protocol is insecure. Use https instead
threadTs: 1234567890,
about: '<#E::table::test>',
createdBy: 'testuser',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jest.mock('../FeedEditor/FeedEditor', () => ({
<div
data-testid="feed-editor"
ref={ref}
role="presentation"
onChange={onChangeHandler}
onClick={onSave}>
FeedEditor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,11 @@
};

const onSaveHandler = () => {
if (editorRef.current) {
if (editorRef.current?.getEditorContent()) {
setEditorValue('');
editorRef.current?.clearEditorContent();
const message = getBackendFormat(
editorRef.current?.getEditorContent()
);
onSave && onSave(message);
}
if (editorRef.current && editorRef.current?.getEditorContent()) {

Check warning on line 73 in openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedEditor/ActivityFeedEditor.tsx

View check run for this annotation

SonarQubeCloud / [open-metadata-ui] SonarCloud Code Analysis

Prefer using an optional chain expression instead, as it's more concise and easier to read.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ui&issues=AZ_RSJ_Ur05lXYHPhGpk&open=AZ_RSJ_Ur05lXYHPhGpk&pullRequest=30989
setEditorValue('');
editorRef.current?.clearEditorContent();
const message = getBackendFormat(editorRef.current?.getEditorContent());
onSave && onSave(message);
}
};

Expand All @@ -92,9 +88,10 @@
}));

return (
<div
className={classNames('relative', className)}
role="presentation"
onClick={(e) => e.stopPropagation()}>

Check warning on line 94 in openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedEditor/ActivityFeedEditor.tsx

View check run for this annotation

SonarQubeCloud / [open-metadata-ui] SonarCloud Code Analysis

Use <img alt=...> instead of the "presentation" role to ensure accessibility across all devices.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ui&issues=AZ_RSJ_Ur05lXYHPhGpl&open=AZ_RSJ_Ur05lXYHPhGpl&pullRequest=30989
<FeedEditor
defaultValue={defaultValue}
editorClass={editorClass}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,11 @@
};

const onSaveHandler = () => {
if (editorRef.current) {
if (editorRef.current?.getEditorContent()) {
setEditorValue('');
editorRef.current?.clearEditorContent();
const message = getBackendFormat(
editorRef.current?.getEditorContent()
);
onSave && onSave(message);
}
if (editorRef.current && editorRef.current?.getEditorContent()) {

Check warning on line 73 in openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedEditor/ActivityFeedEditorNew.tsx

View check run for this annotation

SonarQubeCloud / [open-metadata-ui] SonarCloud Code Analysis

Prefer using an optional chain expression instead, as it's more concise and easier to read.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ui&issues=AZ_RSKG8r05lXYHPhGpm&open=AZ_RSKG8r05lXYHPhGpm&pullRequest=30989
setEditorValue('');
editorRef.current?.clearEditorContent();
const message = getBackendFormat(editorRef.current?.getEditorContent());
onSave && onSave(message);
}
};

Expand All @@ -92,10 +88,11 @@
}));

return (
<div
className={classNames('relative', className)}
data-testid="activity-feed-editor-new"
role="presentation"
onClick={(e) => e.stopPropagation()}>

Check warning on line 95 in openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedEditor/ActivityFeedEditorNew.tsx

View check run for this annotation

SonarQubeCloud / [open-metadata-ui] SonarCloud Code Analysis

Use <img alt=...> instead of the "presentation" role to ensure accessibility across all devices.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ui&issues=AZ_RSKG8r05lXYHPhGpn&open=AZ_RSKG8r05lXYHPhGpn&pullRequest=30989
<FeedEditor
defaultValue={defaultValue}
editorClass={editorClass}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ describe('ActivityFeedProvider', () => {
});

await act(async () => {
// eslint-disable-next-line sonarjs/no-extra-arguments -- deferred test resolver
resolveSlowRequest({
data: [{ ...mockActivityEvents[0], summary: 'Stale result' }],
paging: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ jest.mock('react-quill-new', () => ({
mockCaptureQuillProps(props);

return (
<div data-testid="react-quill" onKeyDown={props.onKeyDown}>
<div
data-testid="react-quill"
role="textbox"
tabIndex={0}
onKeyDown={props.onKeyDown}>
editor
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
showThread = true,
isActive,
hidePopover = false,
}: TaskFeedCardProps) => {

Check warning on line 62 in openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/TaskFeedCard/TaskFeedCard.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

{"message":"Function has a complexity of 12 which is greater than 10 authorized.","cost":2,"secondaryLocations":[{"line":62,"column":22,"endLine":62,"endColumn":24,"message":"+1"},{"line":74,"column":48,"endLine":74,"endColumn":50,"message":"+1"},{"line":75,"column":71,"endLine":75,"endColumn":72,"message":"+1"},{"line":175,"column":18,"endLine":175,"endColumn":19,"message":"+1"},{"line":188,"column":41,"endLine":188,"endColumn":43,"message":"+1"},{"line":194,"column":25,"endLine":194,"endColumn":27,"message":"+1"},{"line":203,"column":23,"endLine":203,"endColumn":24,"message":"+1"},{"line":206,"column":32,"endLine":206,"endColumn":34,"message":"+1"},{"line":227,"column":44,"endLine":227,"endColumn":45,"message":"+1"},{"line":246,"column":22,"endLine":246,"endColumn":23,"message":"+1"},{"line":257,"column":37,"endLine":257,"endColumn":39,"message":"+1"},{"line":257,"column":22,"endLine":257,"endColumn":24,"message":"+1"}]}
const navigate = useNavigate();
const { t } = useTranslation();
const { showDrawer, setActiveThread } = useActivityFeedProvider();
Expand Down Expand Up @@ -99,7 +99,7 @@
}

return null;
}, [feed]);

Check warning on line 102 in openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/TaskFeedCard/TaskFeedCard.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array

const showReplies = () => {
showDrawer?.(feed);
Expand Down Expand Up @@ -139,7 +139,7 @@
</Button>
</EntityPopOverCard>
) : null,
[isEntityDetailsAvailable, entityFQN, entityType, taskDetails]

Check warning on line 142 in openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/TaskFeedCard/TaskFeedCard.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useMemo has missing dependencies: 'handleTaskLinkClick', 't', and 'taskColumnName'. Either include them or remove the dependency array
);

const handleMouseEnter = () => {
Expand Down Expand Up @@ -220,9 +220,19 @@
</UserPopOverCard>
))}
</div>
<div
className="d-flex items-center thread-count cursor-pointer m-l-xs"
onClick={!hidePopover ? showReplies : noop}>
role="button"
tabIndex={0}
onClick={!hidePopover ? showReplies : noop}
onKeyDown={(e) => {
if (
(e.key === 'Enter' || e.key === ' ') &&
!hidePopover
) {
showReplies();
}
}}>

Check warning on line 235 in openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/TaskFeedCard/TaskFeedCard.component.tsx

View check run for this annotation

SonarQubeCloud / [open-metadata-ui] SonarCloud Code Analysis

Use <input type="button">, <input type="image">, <input type="reset">, <input type="submit">, or <button> instead of the "button" role to ensure accessibility across all devices.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ui&issues=AZ_RSKL9r05lXYHPhGpo&open=AZ_RSKL9r05lXYHPhGpo&pullRequest=30989
<ThreadIcon width={20} />{' '}
<span className="text-xs p-t-xss p-l-xss">
{postLength}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
const [searchText, setSearchText] = useState('');
const [options, setOptions] = useState<Array<SelectOption>>([]);

const selectedOptions =

Check warning on line 60 in openmetadata-ui/src/main/resources/ui/src/components/Alerts/DestinationFormItem/TeamAndUserSelectItem/TeamAndUserSelectItem.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

The 'selectedOptions' logical expression could make the dependencies of useCallback Hook (at line 95) change on every render. To fix this, wrap the initialization of 'selectedOptions' in its own useMemo() Hook
Form.useWatch<Webhook['receivers']>(['destinations', ...fieldName], form) ??
[];

Expand Down Expand Up @@ -114,7 +114,7 @@
[onSearch]
);

const debouncedOnSearch = useCallback(debounce(handleSearch, 500), [

Check warning on line 117 in openmetadata-ui/src/main/resources/ui/src/components/Alerts/DestinationFormItem/TeamAndUserSelectItem/TeamAndUserSelectItem.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead
handleSearch,
]);

Expand All @@ -137,6 +137,7 @@
<Row gutter={[8, 8]}>
<Col span={24}>
<Input
// eslint-disable-next-line jsx-a11y/no-autofocus -- search box must focus when dropdown opens
autoFocus
data-testid="search-input"
placeholder={t('label.search-by-type', {
Expand All @@ -160,7 +161,7 @@
</Card>
);
},
[options, entityType, searchText, loadingOptions]

Check warning on line 164 in openmetadata-ui/src/main/resources/ui/src/components/Alerts/DestinationFormItem/TeamAndUserSelectItem/TeamAndUserSelectItem.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useCallback has missing dependencies: 'destinationNumber' and 't'. Either include them or remove the dependency array
);

const handleMenuItemClick: MenuItemProps['onClick'] = useCallback(
Expand All @@ -175,7 +176,7 @@

form.setFieldValue(['destinations', ...fieldName], updatedValues);
},
[selectedOptions]

Check warning on line 179 in openmetadata-ui/src/main/resources/ui/src/components/Alerts/DestinationFormItem/TeamAndUserSelectItem/TeamAndUserSelectItem.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useCallback has missing dependencies: 'fieldName' and 'form'. Either include them or remove the dependency array
);

const handleTriggerClick = useCallback(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ jest.mock('@openmetadata/ui-core-components', () => {
defaultValue?: string;
}) => (
<input
aria-label={inputDataTestId ?? tid}
data-testid={inputDataTestId ?? tid}
defaultValue={defaultValue}
value={value ?? ''}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jest.mock('@openmetadata/ui-core-components', () => {
data-testid={tid}
value={value ?? ''}
onChange={(e) => onChange?.(e.target.value)}>
<option value="" />
<option aria-label="Empty option" value="" />
{items.map((item) => (
<option disabled={item.isDisabled} key={item.id} value={item.id}>
{item.label}
Expand Down Expand Up @@ -134,13 +134,17 @@ jest.mock('@openmetadata/ui-core-components', () => {
defaultValue?: string;
}) => (
<div>
{label && <label>{label}</label>}
<input
data-testid={inputDataTestId ?? tid}
defaultValue={defaultValue}
value={value ?? ''}
onChange={(e) => onChange?.(e.target.value)}
/>
<label htmlFor={inputDataTestId ?? tid}>
{label}
<input
aria-label="Input"
data-testid={inputDataTestId ?? tid}
defaultValue={defaultValue}
id={inputDataTestId ?? tid}
value={value ?? ''}
onChange={(e) => onChange?.(e.target.value)}
/>
</label>
</div>
),
Select: SelectBase,
Expand All @@ -153,10 +157,12 @@ jest.mock('@openmetadata/ui-core-components', () => {
isSelected?: boolean;
label?: ReactNode;
}) => (
<label>
<label htmlFor="notify-downstream-toggle">
<input
aria-label="Notify downstream"
checked={isSelected ?? false}
data-testid="notify-downstream-toggle"
id="notify-downstream-toggle"
type="checkbox"
onChange={(e) => onChange?.(e.target.checked)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jest.mock('@openmetadata/ui-core-components', () => ({
}) => (
<input
readOnly
aria-label="Select"
checked={isSelected ?? false}
data-testid={tid}
type="checkbox"
Expand All @@ -70,6 +71,8 @@ jest.mock('@openmetadata/ui-core-components', () => ({
autoFocus?: boolean;
}) => (
<input
aria-label="Search"
// eslint-disable-next-line jsx-a11y/no-autofocus -- mock forwards the autofocus prop under test
autoFocus={autoFocus}
data-testid={inputDataTestId ?? tid}
placeholder={placeholder}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import { useFormContext, useWatch } from 'react-hook-form';
import { useTranslation } from 'react-i18next';

import { handleKeyboardActivation } from '../../../../utils/KeyboardUtil';
import { SelectOption } from '../../../common/AsyncSelectList/AsyncSelectList.interface';
import { TeamAndUserSelectItemV2Props } from './TeamAndUserSelectItemV2.interface';

Expand Down Expand Up @@ -112,15 +113,18 @@

return (
<div className="tw:relative tw:w-full">
<div
className={[
'tw:flex tw:min-h-9 tw:w-full tw:cursor-pointer tw:flex-wrap tw:items-center',
'tw:gap-1.5 tw:rounded-lg tw:bg-primary tw:px-3 tw:py-2',
'tw:shadow-xs tw:outline-1 tw:-outline-offset-1 tw:outline-primary',
].join(' ')}
data-testid={`team-user-select-trigger-${destinationNumber}`}
ref={triggerRef}
onClick={handleTriggerClick}>
role="button"
tabIndex={0}
onClick={handleTriggerClick}
onKeyDown={handleKeyboardActivation(handleTriggerClick)}>

Check warning on line 127 in openmetadata-ui/src/main/resources/ui/src/components/Alerts/DestinationFormItemV2/TeamAndUserSelectItemV2/TeamAndUserSelectItemV2.tsx

View check run for this annotation

SonarQubeCloud / [open-metadata-ui] SonarCloud Code Analysis

Use <input type="button">, <input type="image">, <input type="reset">, <input type="submit">, or <button> instead of the "button" role to ensure accessibility across all devices.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ui&issues=AZ_RSLu0r05lXYHPhGp2&open=AZ_RSLu0r05lXYHPhGp2&pullRequest=30989
{isEmpty(selectedOptions) ? (
<span
className="tw:text-sm tw:text-placeholder"
Expand Down Expand Up @@ -151,6 +155,7 @@
data-testid={`team-user-select-dropdown-${destinationNumber}`}
ref={dropdownRef}>
<Input
// eslint-disable-next-line jsx-a11y/no-autofocus -- search box must focus when dropdown opens
autoFocus
data-testid="search-input"
inputDataTestId="search-input-field"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,17 +274,18 @@
}, [i18n]);

return (
<div
className={classNames('block-editor-wrapper', {
'block-editor-wrapper--bar-menu': menuType === 'bar',
'block-editor-wrapper--bubble-menu': menuType === 'bubble',
})}
id="block-editor-wrapper"
ref={editorWrapperRef}
role="presentation"
onDragEnter={handleDragEnter}
onDragLeave={handleDragLeave}
onDragOver={(e) => e.preventDefault()}
onDrop={handleDrop}>

Check warning on line 288 in openmetadata-ui/src/main/resources/ui/src/components/BlockEditor/BlockEditor.tsx

View check run for this annotation

SonarQubeCloud / [open-metadata-ui] SonarCloud Code Analysis

Use <img alt=...> instead of the "presentation" role to ensure accessibility across all devices.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ui&issues=AZ_RSIz5r05lXYHPhGpX&open=AZ_RSIz5r05lXYHPhGpX&pullRequest=30989
{showInlineAlert && errorMessage && (
<Banner
className="border-radius"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const ImageAttachment = ({
})}
data-testid="image-container">
{displaySrc ? (
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- lifecycle, not interaction
<img
alt={alt ?? ''}
data-testid="uploaded-image-node"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const MathEquationComponent: FC<NodeViewProps> = ({
{isEditing ? (
<div className="math-equation-edit-input-wrapper">
<Input.TextArea
// eslint-disable-next-line jsx-a11y/no-autofocus -- focus required to edit equation inline
autoFocus
bordered={false}
className="math-equation-input"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ export const Focus = Extension.create<FocusOptions>({
}

maxLevels += 1;

return;
});
}

Expand Down Expand Up @@ -96,8 +94,6 @@ export const Focus = Extension.create<FocusOptions>({
class: this.options.className,
})
);

return;
});

return DecorationSet.create(doc, decorations);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const EmbedLinkElement: FC<ImagePopoverContentProps> = ({
{({ field, fieldState }) => (
<>
<Input
// eslint-disable-next-line jsx-a11y/no-autofocus -- focus the URL input when the embed link popover opens
autoFocus
hint={fieldState.error?.message}
inputDataTestId="embed-input"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,15 @@ const renderItems = () => {
return true;
}

if (props.event.key === 'Enter') {
if (
suggestionProps.items.filter((item) =>
item.title
.toLowerCase()
.startsWith(suggestionProps.query.toLowerCase())
).length === 0
) {
this.onExit();
}
if (
props.event.key === 'Enter' &&
suggestionProps.items.filter((item) =>
item.title
.toLowerCase()
.startsWith(suggestionProps.query.toLowerCase())
).length === 0
) {
this.onExit();
}

return (component?.ref as SlashCommandRef)?.onKeyDown(props) || false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ const LinkModal: FC<LinkModalProps> = ({
layout="vertical"
onFinish={handleSubmit}>
<Form.Item label="Link" name="href">
<Input autoFocus />
<Input
// eslint-disable-next-line jsx-a11y/no-autofocus -- focus the link input when the modal opens
autoFocus
/>
</Form.Item>
</Form>
</Modal>
Expand Down
Loading
Loading