update eslint

This commit is contained in:
Jonas Lochmann
2026-02-16 01:00:00 +01:00
parent abb2d1657e
commit a13656b27d
11 changed files with 1160 additions and 853 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
/*
* server component for the TimeLimit App
* Copyright (C) 2019 - 2024 Jonas Lochmann
* Copyright (C) 2019 - 2026 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -27,7 +27,7 @@ export const createUmzug = (sequelize: Sequelize) => (
resolve: ({ name, path }) => {
if (!path) throw new Error()
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const migration = require(path)
return {
@@ -1,6 +1,6 @@
/*
* server component for the TimeLimit App
* Copyright (C) 2019 - 2023 Jonas Lochmann
* Copyright (C) 2019 - 2026 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -89,7 +89,6 @@ export async function dispatchAddUsedTimeVersion2 ({ deviceId, action, cache, ev
addUsedTimeForADifferentUserThanTheCurrentUserOfTheDevice = true
}
// eslint-disable-next-line no-inner-declarations
async function handle (start: number, end: number) {
const lengthInMinutes = (end - start) + 1
const lengthInMs = lengthInMinutes * 1000 * 60
@@ -215,10 +214,10 @@ export async function dispatchAddUsedTimeVersion2 ({ deviceId, action, cache, ev
const fittingDurationItemsLastUsageFiltered =
hasTrustedTimestamp ?
fittingDurationItems.filter((it) => {
fittingDurationItems.filter((it) => (
action.trustedTimestamp - item.timeToAdd <=
parseInt(it.lastUsage, 10) + it.sessionPauseDuration - tolerance
}) : fittingDurationItems
)) : fittingDurationItems
return fittingDurationItemsLastUsageFiltered
.map((it) => it.lastSessionDuration)
@@ -1,6 +1,6 @@
/*
* server component for the TimeLimit App
* Copyright (C) 2019 - 2022 Jonas Lochmann
* Copyright (C) 2019 - 2026 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -48,7 +48,8 @@ export const dispatchChildChangePassword = async ({ action, childUserId, cache }
{
const clear = cache.getSecondPasswordHashOfChild.cache.clear
clear && clear()
if (clear) clear()
}
cache.invalidiateUserList = true
@@ -1,6 +1,6 @@
/*
* server component for the TimeLimit App
* Copyright (C) 2019 - 2022 Jonas Lochmann
* Copyright (C) 2019 - 2026 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -55,7 +55,8 @@ export async function dispatchChangeParentPassword ({ action, cache }: {
{
const clear = cache.getSecondPasswordHashOfParent.cache.clear
clear && clear()
if (clear) clear()
}
cache.invalidiateUserList = true
@@ -1,6 +1,6 @@
/*
* server component for the TimeLimit App
* Copyright (C) 2019 - 2022 Jonas Lochmann
* Copyright (C) 2019 - 2026 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -47,7 +47,8 @@ export async function dispatchSetChildPassword ({ action, cache }: {
{
const clear = cache.getSecondPasswordHashOfChild.cache.clear
clear && clear()
if (clear) clear()
}
cache.invalidiateUserList = true
+2 -2
View File
@@ -1,6 +1,6 @@
/*
* server component for the TimeLimit App
* Copyright (C) 2019 - 2022 Jonas Lochmann
* Copyright (C) 2019 - 2026 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -56,7 +56,7 @@ export const createWebsocketHandler = ({ connectedDevicesManager, database }: {
const importantSyncForAllListener = () => {
setTimeout(() => {
socket.connected && socket.emit('should sync', { isImportant: true })
if (socket.connected) socket.emit('should sync', { isImportant: true })
}, Math.random() * 1000 * 60 /* wait up to one minute */)
}