Skip to content

Commit

Permalink
fix: linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
francisvaut committed Apr 18, 2024
1 parent b3e5d45 commit 4c7836a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions frontend/src/components/projects/ProjectCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ const { submissionStatus, getSubmissionStatusByProject } = useSubmissionStatus()
/**
* Return True if the user is in a group in this project.
*/
function isInGroup(): Boolean {
return props.studentGroups.some(group => props.projectGroups.includes(group));
function isInGroup(): boolean {
return props.studentGroups.some((group) => props.projectGroups.includes(group));
}
/* Watchers */
watch(
props.course,
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/components/projects/ProjectList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ const { student, getStudentByID } = useStudents();
* Get the groups of the corresponding users
*/
function getUserGroups(): Group[] {
if (user.value?.isStudent()) {
return (student.value?.groups || []);
if (user.value !== null && user.value?.isStudent()) {
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
return student.value !== null && student.value.groups !== null ? student.value?.groups : [];
}
return [];
}
Expand All @@ -46,7 +47,7 @@ watch(
user,
() => {
if (user.value !== null && user.value.isStudent()) {
getStudentByID(user.value.id)
getStudentByID(user.value.id);
}
},
{
Expand Down

0 comments on commit 4c7836a

Please sign in to comment.