Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump the lint group in /frontend with 4 updates #6062

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0",
"@eslint/compat": "^1.2.0",
"@eslint/js": "^9.15.0",
"@eslint/js": "^9.16.0",
"@playwright/test": "^1.49.0",
"@sentry/webpack-plugin": "^2.22.5",
"@testing-library/dom": "^10.4.0",
Expand All @@ -104,7 +104,7 @@
"css-loader": "^7.1.1",
"csstype": "^3.1.2",
"esbuild": "^0.24.0",
"eslint": "^9.15.0",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-expressions": "^1.3.2",
Expand All @@ -127,14 +127,14 @@
"postcss": "^8.4.31",
"postcss-loader": "^8.1.0",
"postcss-preset-env": "^10.1.1",
"prettier": "^3.3.2",
"prettier": "^3.4.1",
"style-loader": "^4.0.0",
"ts-jest": "^29.2.2",
"ts-loader": "^9.5.0",
"ts-node": "^10.9.1",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "~5.7.2",
"typescript-eslint": "^8.15.0",
"typescript-eslint": "^8.16.0",
"webpack": "5.96.1",
"webpack-cli": "^5.1.4",
"webpack-pwa-manifest": "^4.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ export const reservationForm = mapped(
)
return index === -1
? []
: toDailyReservationRequest(
: (toDailyReservationRequest(
childId,
date,
timesValue[index].day
) ?? []
) ?? [])
})
}
case 'irregularTimes':
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/citizen-frontend/navigation/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ const HeaderContainer = styled.header`

@media (min-width: ${desktopMin}) {
position: static;
grid: minmax(${headerHeightDesktop}px, min-content) / max-content max-content auto;
grid:
minmax(${headerHeightDesktop}px, min-content)
/ max-content max-content auto;
height: ${headerHeightDesktop}px;
background-color: transparent;
box-shadow: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,8 @@ const DecisionEditor = React.memo(function DecisionEditor({
items={units}
selectedItem={
selectedUnit
? units.find((u) => u.id === selectedUnit.value()) ?? null
? (units.find((u) => u.id === selectedUnit.value()) ??
null)
: null
}
getItemLabel={(u) => u?.name ?? ''}
Expand Down Expand Up @@ -841,9 +842,9 @@ const DecisionEditor = React.memo(function DecisionEditor({
filterItems={filterEmployees}
selectedItem={
preparer1EmployeeId
? employees.find(
? (employees.find(
(e) => e.id === preparer1EmployeeId.value()
) ?? null
) ?? null)
: null
}
onChange={(e) => preparer1EmployeeId.set(e?.id ?? null)}
Expand Down Expand Up @@ -875,9 +876,9 @@ const DecisionEditor = React.memo(function DecisionEditor({
items={employees}
selectedItem={
preparer2EmployeeId
? employees.find(
? (employees.find(
(e) => e.id === preparer2EmployeeId.value()
) ?? null
) ?? null)
: null
}
getItemLabel={formatEmployeeName}
Expand Down Expand Up @@ -913,9 +914,9 @@ const DecisionEditor = React.memo(function DecisionEditor({
items={decisionMakers}
selectedItem={
decisionMakerEmployeeId
? decisionMakers.find(
? (decisionMakers.find(
(e) => e.id === decisionMakerEmployeeId.value()
) ?? null
) ?? null)
: null
}
getItemLabel={formatEmployeeName}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ export const DailyServiceTimesReadOnly = React.memo(
return (
<div>
<Gap size="xs" />
{i18n.childInformation.dailyServiceTimes.weekdays.monday}–
{i18n.childInformation.dailyServiceTimes.weekdays.friday}{' '}
{
i18n.childInformation.dailyServiceTimes.weekdays.monday
}–{i18n.childInformation.dailyServiceTimes.weekdays.friday}{' '}
{times.regularTimes.format()}
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function ServiceNeedEditorRow({
partWeek:
selectedOption && selectedOption.partWeek !== null
? selectedOption.partWeek
: editedServiceNeed?.partWeek ?? false
: (editedServiceNeed?.partWeek ?? false)
}
},
i18n.validationErrors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ export function ReplacementInfo({
<div>
<span data-qa="sent-at">{invoice.sentAt?.format()}</span>
{' ('}
<span data-qa="sent-by">{invoice.sentBy?.name}</span>)
<span data-qa="sent-by">
{invoice.sentBy?.name}
</span>)
</div>
</div>
</FixedSpaceColumn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ const ChildSection = React.memo(function ChildSection({
childId={child.id}
row={
editTarget?.correctionId
? corrections.find(
? (corrections.find(
(c) => c.data.id === editTarget.correctionId
)?.data ?? null
)?.data ?? null)
: null
}
products={products}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ export default React.memo(function PersonDetails({
/>
</>
) : (
person.ophPersonOid ?? ''
(person.ophPersonOid ?? '')
)
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ export default React.memo(function AttendanceReservation() {

const tableComponents = entries.map(([groupId, rowsByTime]) => {
const groupName = showGroupTitle
? filteredGroups.find((group) => group.id === groupId)?.name ??
i18n.reports.attendanceReservation.ungrouped
? (filteredGroups.find((group) => group.id === groupId)?.name ??
i18n.reports.attendanceReservation.ungrouped)
: undefined
return (
<TableScrollable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ export default React.memo(function AttendanceReservationByChild() {
fullDayAbsence: item.fullDayAbsence ? 'Poissa' : '',
reservationStartTime: item.fullDayAbsence
? ''
: item.reservation?.start.format() ?? '-',
: (item.reservation?.start.format() ?? '-'),
reservationEndTime: item.fullDayAbsence
? ''
: item.reservation?.end.format() ?? '-'
: (item.reservation?.end.format() ?? '-')
}
: []
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ function calculateAverages(
const dateKey = toOccupancyKey(date)
const dividend =
usedValues === 'headcount'
? row.occupancies[dateKey]?.headcount ?? 0
: row.occupancies[dateKey]?.percentage ?? 0
? (row.occupancies[dateKey]?.headcount ?? 0)
: (row.occupancies[dateKey]?.percentage ?? 0)
const divider =
usedValues === 'headcount'
? 1
Expand Down Expand Up @@ -453,8 +453,8 @@ export default React.memo(function Occupancies() {
selectedItem={
filters.careAreaId === undefined
? careAreaAll
: areas.find((area) => area.id === filters.careAreaId) ??
null
: (areas.find((area) => area.id === filters.careAreaId) ??
null)
}
placeholder={i18n.reports.occupancies.filters.areaPlaceholder}
getItemLabel={(item) => item.name}
Expand Down Expand Up @@ -623,8 +623,8 @@ export default React.memo(function Occupancies() {
filters.type,
filters.careAreaId === undefined
? i18n.common.all
: areas.find((area) => area.id == filters.careAreaId)
?.name ?? ''
: (areas.find((area) => area.id == filters.careAreaId)
?.name ?? '')
)}
/>
<TableScrollable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,9 @@ const getFormTree = (tree: TreeNode[]) => {
.map((group) => [
group.key,
hasUncheckedChildren(group)
? group.children
? (group.children
?.filter((child) => child.checked)
.map((child) => child.key) ?? []
.map((child) => child.key) ?? [])
: null
]) ?? []
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ const getTreeSelectionAsRecord = (tree: TreeNode[]) =>
.map((group) => [
group.key,
hasUncheckedChildren(group)
? group.children
? (group.children
?.filter((child) => child.checked)
.map((child) => child.key) ?? []
.map((child) => child.key) ?? [])
: null
]) ?? []
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default React.memo(function OccupancyContainer({
items={[null, ...activeGroups]}
selectedItem={
groupIds !== null && groupIds.length > 0
? activeGroups.find((g) => g.id === groupIds[0]) ?? null
? (activeGroups.find((g) => g.id === groupIds[0]) ?? null)
: null
}
onChange={(g) => setGroupIds(g ? [g.id] : null)}
Expand Down Expand Up @@ -152,14 +152,14 @@ export default React.memo(function OccupancyContainer({
) : (
<SimpleOccupanciesForSingleDay
unitId={unitId}
groupId={groupIds !== null ? groupIds[0] ?? null : null}
groupId={groupIds !== null ? (groupIds[0] ?? null) : null}
date={startDate}
/>
)
) : (
<OccupanciesForDateRange
unitId={unitId}
groupId={groupIds !== null ? groupIds[0] ?? null : null}
groupId={groupIds !== null ? (groupIds[0] ?? null) : null}
from={startDate}
to={endDate}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default React.memo(function ChildDayAttendance({
const actualOperationTimes = hasShiftCare
? dateInfo.isHoliday && !dateInfo.shiftCareOpenOnHoliday
? null
: dateInfo.shiftCareOperatingTimes ?? dateInfo.normalOperatingTimes
: (dateInfo.shiftCareOperatingTimes ?? dateInfo.normalOperatingTimes)
: dateInfo.isHoliday
? null
: dateInfo.normalOperatingTimes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default React.memo(function ChildDayReservation({
const actualOperationTimes = hasShiftCare
? dateInfo.isHoliday && !dateInfo.shiftCareOpenOnHoliday
? null
: dateInfo.shiftCareOperatingTimes ?? dateInfo.normalOperatingTimes
: (dateInfo.shiftCareOperatingTimes ?? dateInfo.normalOperatingTimes)
: dateInfo.isHoliday
? null
: dateInfo.normalOperatingTimes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,12 @@ const MarkDepartedInner = React.memo(function MarkDepartedWithChild({
absenceTypeNonbillable:
expectedCategories?.includes('NONBILLABLE') &&
absences?.nonBillable !== 'NO_ABSENCE'
? absences?.nonBillable ?? null
? (absences?.nonBillable ?? null)
: null,
absenceTypeBillable:
expectedCategories.includes('BILLABLE') &&
absences?.billable !== 'NO_ABSENCE'
? absences?.billable ?? null
? (absences?.billable ?? null)
: null
}
})
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/employee-mobile-frontend/messages/state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const MessageContextProvider = React.memo(
const { user } = useContext(UserContext)
const pinLoggedEmployeeId = user
.map((u) =>
u && u.pinLoginActive ? u.employeeId ?? undefined : undefined
u && u.pinLoginActive ? (u.employeeId ?? undefined) : undefined
)
.getOrElse(undefined)
const shouldFetch = !!unitId && !!pinLoggedEmployeeId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,8 @@ const StaffAttendanceEditor = ({
appearance="inline"
text={
groupIdDomValue !== emptyGroupIdDomValue
? groups.find((group) => group.id === groupIdDomValue)
?.name ?? '-'
? (groups.find((group) => group.id === groupIdDomValue)
?.name ?? '-')
: i18n.attendances.noGroup
}
onClick={() => groupEditMode.update(() => true)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ export function apiDataToFormData(
vtjSiblings: vtjSiblingsSiblingBasis,
siblingName: siblingBasisFromVtj
? ''
: application.form.preferences.siblingBasis?.siblingName ?? '',
: (application.form.preferences.siblingBasis?.siblingName ?? ''),
siblingSsn: siblingBasisFromVtj
? ''
: application.form.preferences.siblingBasis?.siblingSsn ?? '',
: (application.form.preferences.siblingBasis?.siblingSsn ?? ''),
siblingUnit: application.form.preferences.siblingBasis?.siblingUnit ?? '',
preferredUnits: application.form.preferences.preferredUnits
},
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib-common/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ export function useSelectMutation<ArgA, DataA, SelectA, ArgB, DataB, SelectB>(
: mutationB.api(arg.value).then((r) => second(r)),
invalidateQueryKeys: (arg: Either<ArgA, ArgB>): QueryKey[] =>
arg.tag === 'first'
? mutationA.invalidateQueryKeys?.(arg.value) ?? []
: mutationB.invalidateQueryKeys?.(arg.value) ?? []
? (mutationA.invalidateQueryKeys?.(arg.value) ?? [])
: (mutationB.invalidateQueryKeys?.(arg.value) ?? [])
}),
[mutationA, mutationB]
)
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/lib-components/layout/flex-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ export const FixedSpaceFlexWrap = styled.div<FixedSpaceFlexWrapProps>`
justify-content: flex-start;
align-items: flex-start;

margin-bottom: -${(p) => (p.verticalSpacing ? defaultMargins[p.verticalSpacing] : defaultMargins.s)};
margin-right: -${(p) => (p.horizontalSpacing ? defaultMargins[p.horizontalSpacing] : defaultMargins.s)};
margin-bottom: -${(p) =>
p.verticalSpacing ? defaultMargins[p.verticalSpacing] : defaultMargins.s};
margin-right: -${(p) =>
p.horizontalSpacing
? defaultMargins[p.horizontalSpacing]
: defaultMargins.s};

> * {
margin-bottom: ${(p) =>
Expand Down
Loading