diff --git a/src/components/icons/InsertLink.jsx b/src/components/icons/InsertLink.jsx index 90b53b58f..52a55762e 100644 --- a/src/components/icons/InsertLink.jsx +++ b/src/components/icons/InsertLink.jsx @@ -1,5 +1,6 @@ import React from 'react'; +// eslint-disable-next-line react/function-component-definition export default function InsertLink() { return ( { const { enableInContextSidebar } = useContext(DiscussionContext); const userCanAddThreadInBlackoutDate = useUserCanAddThreadInBlackoutDate(); return ( @@ -40,8 +40,10 @@ function HoverCard({
); -} +}; HoverCard.propTypes = { intl: intlShape.isRequired, @@ -118,6 +120,7 @@ HoverCard.propTypes = { onFollow: PropTypes.func, addResponseCommentButtonMessage: PropTypes.string.isRequired, isClosedPost: PropTypes.bool.isRequired, + // eslint-disable-next-line react/forbid-prop-types endorseIcons: PropTypes.objectOf(PropTypes.any), }; diff --git a/src/discussions/discussions-home/DiscussionContent.jsx b/src/discussions/discussions-home/DiscussionContent.jsx index 3d2764d2d..a46e7c422 100644 --- a/src/discussions/discussions-home/DiscussionContent.jsx +++ b/src/discussions/discussions-home/DiscussionContent.jsx @@ -9,7 +9,7 @@ import { Routes } from '../../data/constants'; import { PostCommentsView } from '../post-comments'; import { PostEditor } from '../posts'; -function DiscussionContent() { +const DiscussionContent = () => { const postEditorVisible = useSelector((state) => state.threads.postEditorVisible); return ( @@ -32,6 +32,6 @@ function DiscussionContent() { ); -} +}; export default injectIntl(DiscussionContent); diff --git a/src/discussions/discussions-home/DiscussionsHome.jsx b/src/discussions/discussions-home/DiscussionsHome.jsx index b0ed0668c..747baf33c 100644 --- a/src/discussions/discussions-home/DiscussionsHome.jsx +++ b/src/discussions/discussions-home/DiscussionsHome.jsx @@ -32,7 +32,7 @@ import DiscussionSidebar from './DiscussionSidebar'; import useFeedbackWrapper from './FeedbackWrapper'; import InformationBanner from './InformationBanner'; -export default function DiscussionsHome() { +const DiscussionsHome = () => { const location = useLocation(); const postActionBarRef = useRef(null); const postEditorVisible = useSelector(selectPostEditorVisible); @@ -67,6 +67,7 @@ export default function DiscussionsHome() { }, [path]); return ( + // eslint-disable-next-line react/jsx-no-constructed-context-values } ); -} +}; + +export default DiscussionsHome; diff --git a/src/discussions/learners/LearnersView.test.jsx b/src/discussions/learners/LearnersView.test.jsx index 45631178c..44ef2ca8e 100644 --- a/src/discussions/learners/LearnersView.test.jsx +++ b/src/discussions/learners/LearnersView.test.jsx @@ -1,3 +1,4 @@ +/* eslint-disable default-param-last */ import React from 'react'; import { @@ -200,7 +201,8 @@ describe('LearnersView', () => { username: ['learner-1', 'learner-2'], }, - ])('should have a search bar with a clear button and \'$output\' results found text.', + ])( + 'should have a search bar with a clear button and \'$output\' results found text.', async ({ searchText, output, learnersCount, username, }) => { @@ -226,7 +228,8 @@ describe('LearnersView', () => { expect(clearButton).toBeInTheDocument(); expect(leaners).toHaveLength(learnersCount); }); - }); + }, + ); test('When click on the clear button it should move to a list of all learners.', async () => { await setUpLearnerMockResponse(); @@ -256,7 +259,8 @@ describe('LearnersView', () => { expect(learners).toHaveLength(3); }); - it('should display reported and previously reported message by passing activeFlags or inactiveFlags', + it( + 'should display reported and previously reported message by passing activeFlags or inactiveFlags', async () => { await setUpLearnerMockResponse(2, 2, 1, ['learner-1', 'learner-2'], '', 1, 1); await assignPrivilages(true); @@ -273,7 +277,8 @@ describe('LearnersView', () => { expect(reportedIcon).toBeInTheDocument(); expect(reported).toBeInTheDocument(); expect(previouslyReported).toBeInTheDocument(); - }); + }, + ); it('should display load more button and display more learners by clicking on button.', async () => { await setUpLearnerMockResponse(); diff --git a/src/discussions/topics/utils.js b/src/discussions/topics/utils.js index fcc3f9614..2eead336b 100644 --- a/src/discussions/topics/utils.js +++ b/src/discussions/topics/utils.js @@ -10,7 +10,7 @@ export default function countFilteredTopics(topicsSelector, provider) { ? item.name.toLowerCase().includes(query) : true )); - count += nonCoursewareTopicsList?.length; + count += nonCoursewareTopicsList?.length ?? 0; // Counting legacy topics if (provider === DiscussionProvider.LEGACY) { const categories = topicsSelector?.categoryIds;