Fix eslint warnings

pull/7285/head
Matt Westcott 2021-06-10 21:37:36 +01:00 zatwierdzone przez Matt Westcott
rodzic 7a03c125de
commit 9d19c2aa13
5 zmienionych plików z 10 dodań i 4 usunięć

Wyświetl plik

@ -338,6 +338,7 @@ export class CommentApp {
}
// If this is the initial focused comment. Focus and pin it
// eslint-disable-next-line no-warning-comments
// TODO: Scroll to this comment
if (initialFocusedCommentId && comment.pk === initialFocusedCommentId) {
this.store.dispatch(setFocusedComment(commentId, { updatePinnedComment: true, forceFocus: true }));

Wyświetl plik

@ -201,7 +201,9 @@ interface RenderSidebarStoryOptions {
strings?: Strings;
}
function renderSidebarStory(modules: ModuleDefinition[], { rtl = false, strings = null }: RenderSidebarStoryOptions = {}) {
function renderSidebarStory(
modules: ModuleDefinition[], { rtl = false, strings = null }: RenderSidebarStoryOptions = {}
) {
// Enable focus outlines so we can test them
React.useEffect(() => {
initFocusOutline();

Wyświetl plik

@ -115,7 +115,10 @@ export const Sidebar: React.FunctionComponent<SidebarProps> = (
);
return (
<aside className={'sidebar' + (slim ? ' sidebar--slim' : '')} onMouseEnter={onMouseEnterHandler} onMouseLeave={onMouseLeaveHandler}>
<aside
className={'sidebar' + (slim ? ' sidebar--slim' : '')}
onMouseEnter={onMouseEnterHandler} onMouseLeave={onMouseLeaveHandler}
>
<div className="sidebar__inner">
<button onClick={onClickCollapseToggle} className="button sidebar__collapse-toggle">
{collapsed ? <Icon name="angle-double-right" /> : <Icon name="angle-double-left" />}

Wyświetl plik

@ -112,6 +112,7 @@ window.comments = (() => {
onUnfocus() {
this.node.classList.add('button-secondary');
this.node.ariaLabel = STRINGS.FOCUS_COMMENT;
// eslint-disable-next-line no-warning-comments
// TODO: ensure comment is focused accessibly when this is clicked,
// and that screenreader users can return to the annotation point when desired
}
@ -213,6 +214,7 @@ window.comments = (() => {
}
}
});
// eslint-disable-next-line no-warning-comments
return unsubscribeWidget; // TODO: listen for widget deletion and use this
}
updateVisibility(newShown) {

Wyświetl plik

@ -1,7 +1,5 @@
jest.mock('../..');
const wagtail = require('../..');
document.addEventListener = jest.fn();
require('./wagtailadmin');