Skip to content

Commit

Permalink
Upgrade prettier and eslint-plugin-prettier and fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rikurauhala committed Jul 26, 2024
1 parent 285cc76 commit 15e2801
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 26 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"tabWidth": 2,
"useTabs": false,
"jsxSingleQuote": false,
"trailingComma": "es5"
"trailingComma": "es5",
"parser": "typescript"
}
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@
"eslint-plugin-cypress": "^3.0.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^9.0.0",
"lint-staged": "^15.0.0",
"node-actionlint": "^1.2.2",
"nyc": "^17.0.0",
"prettier": "3.3.0",
"prettier": "3.3.3",
"stylelint": "^16.2.1",
"stylelint-config-standard": "^36.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const getMainStatsByTrackAndYear = async (

const hasGraduated = studyRightElement.graduated
const hasGraduatedFromCombinedProgramme = combinedProgramme
? studyRight.studyRightElements.find(element => element.code === combinedProgramme)?.graduated ?? false
? (studyRight.studyRightElements.find(element => element.code === combinedProgramme)?.graduated ?? false)
: false

if (hasGraduated) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ export const InteractiveDataTable = ({
<Table celled data-cy={`Table-${cypress}`}>
<Table.Header>
<Table.Row key={`random-header-row-${Math.random()}`} textAlign="center">
{titles?.map(title => (
<Table.HeaderCell key={title}>{title}</Table.HeaderCell>
))}
{titles?.map(title => <Table.HeaderCell key={title}>{title}</Table.HeaderCell>)}
</Table.Row>
</Table.Header>
<Table.Body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const PopulationCourses = ({
/>
) : (
<PopulationCourseStatsFlat
courses={pending ? null : populationSelectedStudentCourses.data ?? []}
courses={pending ? null : (populationSelectedStudentCourses.data ?? [])}
filteredStudents={filteredStudents}
studentAmountLimit={studentAmountLimit}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export const GeneralTab = ({
getRowVal: student =>
student.hopsCredits !== undefined
? student.hopsCredits
: student.studyplans?.find(plan => plan.programme_code === programmeCode)?.completed_credits ?? 0,
: (student.studyplans?.find(plan => plan.programme_code === programmeCode)?.completed_credits ?? 0),
}),
hopsCombinedProg: () => ({
key: 'credits-hopsCombinedProg',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ export const DataTable = ({ cypress, data, titles, wideTable }) => {
<div className={`table-container${wideTable ? '-wide' : ''}`}>
<Table celled data-cy={`Table-${cypress}`}>
<Table.Header>
<Table.Row>
{titles?.map(title => (
<Table.HeaderCell key={title}>{title}</Table.HeaderCell>
))}
</Table.Row>
<Table.Row>{titles?.map(title => <Table.HeaderCell key={title}>{title}</Table.HeaderCell>)}</Table.Row>
</Table.Header>
<Table.Body>
{data?.map(yearArray => (
Expand Down

0 comments on commit 15e2801

Please sign in to comment.