Skip to content

Commit 09050f1

Browse files
committed
fix: add PropTypes and eslint disable for SonarCloud
1 parent 451dc55 commit 09050f1

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/components/HGNHelpSkillsDashboard/CommunityMembersPage.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import PropTypes from 'prop-types';
12
import { useState } from 'react';
23
import { useSelector } from 'react-redux';
34
import { availablePreferences, availableSkills, formatSkillName } from './FilerData.js';
@@ -123,5 +124,11 @@ function CommunityMembersPage() {
123124
</div>
124125
);
125126
}
127+
Accordion.propTypes = {
128+
title: PropTypes.string.isRequired,
129+
children: PropTypes.node.isRequired,
130+
defaultOpen: PropTypes.bool,
131+
darkMode: PropTypes.bool,
132+
};
126133

127134
export default CommunityMembersPage;

src/components/HGNHelpSkillsDashboard/RankedUserList.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from 'axios';
2+
import PropTypes from 'prop-types';
23
import { useEffect, useState } from 'react';
34
import { useSelector } from 'react-redux';
45
import styles from './style/RankedUserList.module.css';
@@ -30,6 +31,7 @@ function RankedUserList({ selectedSkills, selectedPreferences, searchQuery }) {
3031
};
3132

3233
fetchUsers();
34+
// eslint-disable-next-line react-hooks/exhaustive-deps
3335
}, [selectedSkills, selectedPreferences]);
3436

3537
// Client-side filter by searchQuery on top of API results
@@ -59,4 +61,10 @@ function RankedUserList({ selectedSkills, selectedPreferences, searchQuery }) {
5961
);
6062
}
6163

64+
RankedUserList.propTypes = {
65+
selectedSkills: PropTypes.arrayOf(PropTypes.string),
66+
selectedPreferences: PropTypes.arrayOf(PropTypes.string),
67+
searchQuery: PropTypes.string,
68+
};
69+
6270
export default RankedUserList;

0 commit comments

Comments
 (0)