Sfoglia il codice sorgente

Fix eslint warnings

Matt Westcott 3 anni fa
parent
commit
9d19c2aa13

+ 1 - 0
client/src/components/CommentApp/main.tsx

@@ -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 }));

+ 3 - 1
client/src/components/Sidebar/Sidebar.stories.tsx

@@ -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();

+ 4 - 1
client/src/components/Sidebar/Sidebar.tsx

@@ -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" />}

+ 2 - 0
client/src/entrypoints/admin/comments.js

@@ -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) {

+ 0 - 2
client/src/entrypoints/admin/wagtailadmin.test.js

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