Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
rubben-88 committed Apr 2, 2024
1 parent bcf3326 commit c8ff512
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions frontend/src/components/SimpleTests/SimpleTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function flatten(constraint: FEConstraint): FlattedConstraint[] {
expanded: boolean | undefined
): FlattedConstraint[] {

let show = (expanded === undefined) ? false : expanded
const show = (expanded === undefined) ? false : expanded

if (!isFolder(constraint.type)) {
return [{
Expand All @@ -152,7 +152,7 @@ function flatten(constraint: FEConstraint): FlattedConstraint[] {
show: show
}]
if (constraint.sub_constraints !== undefined) {
for (let sub of constraint.sub_constraints) {
for (const sub of constraint.sub_constraints) {
list = list.concat(flatten_sub(
sub,
spacing+1,
Expand All @@ -169,9 +169,9 @@ function flatten(constraint: FEConstraint): FlattedConstraint[] {
export default function SimpleTests(
props: {
teacherOrStudent: boolean,
initialData: Object,
initialData: object,
setHasChanged: React.Dispatch<React.SetStateAction<boolean>>,
setData: React.Dispatch<React.SetStateAction<any>>
setData: React.Dispatch<React.SetStateAction<object>>
}
): JSX.Element {

Expand Down Expand Up @@ -203,9 +203,9 @@ export default function SimpleTests(
));

function getAllIds(constraint: FEConstraint): number[] {
let list = [constraint.id]
const list = [constraint.id]
if (constraint.sub_constraints !== undefined) {
for (let sub of constraint.sub_constraints) {
for (const sub of constraint.sub_constraints) {
list.concat(getAllIds(sub))
}
}
Expand Down Expand Up @@ -284,7 +284,7 @@ export default function SimpleTests(
constraint.expanded = true
}
if (constraint.sub_constraints) {
for (let sub of constraint.sub_constraints) {
for (const sub of constraint.sub_constraints) {
add(sub)
}
}
Expand All @@ -310,7 +310,7 @@ export default function SimpleTests(
}

if (constraint.sub_constraints) {
for (let sub of constraint.sub_constraints) {
for (const sub of constraint.sub_constraints) {
remove(sub)
}
}
Expand All @@ -335,7 +335,7 @@ export default function SimpleTests(
}
}
if (constraint.sub_constraints) {
for (let sub of constraint.sub_constraints) {
for (const sub of constraint.sub_constraints) {
switchDIR(sub)
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/SimpleTests/Warneable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Popup from 'reactjs-popup';
import '../../assets/styles/SimpleTests/warneable.css'
import { useState } from 'react';

export default function(props: {
export default function Warneable(props: {
text: string,
trigger: (onClick: () => void) => JSX.Element,
proceed: () => void,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ViewProjectTeacherComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function ViewProjectTeacherComponent(props: {
const minutes_array = Array.from({length: 60}, (_, index) => index.toString().padStart(2, '0'));

// SimpleTests
const [data, setData] = useState(calledData);
const [data, setData] = useState<object>(calledData);
const [hasChanged, setHasChanged] = useState(false);

return (
Expand Down

0 comments on commit c8ff512

Please sign in to comment.