chore: strengthen backend eslint profile

This commit is contained in:
2026-09-28 16:37:01 +03:00
committed by ksv741
parent 53b2794963
commit a970eaaf7a
179 changed files with 4485 additions and 2716 deletions
@@ -1,15 +1,16 @@
import { MILLISECONDS_PER_SECOND } from '../../../../common/time';
import type {
TbankCandle,
TbankTimestamp,
} from '../../../../integrations/tbank/tbank.api';
import { MILLISECONDS_PER_SECOND } from '../../../../common/time';
const MOSCOW_OFFSET_MS = 10_800_000;
export function timestamp(value?: TbankTimestamp): string | null {
export function timestamp(value?: TbankTimestamp): null | string {
const seconds = Number(value?.seconds);
return Number.isFinite(seconds) && seconds > 0
? new Date(seconds * MILLISECONDS_PER_SECOND).toISOString()
: null;
return Number.isFinite(seconds) && seconds > 0 ?
new Date(seconds * MILLISECONDS_PER_SECOND).toISOString() :
null;
}
export function moscowDay(iso: string): string {
return new Date(Date.parse(iso) + MOSCOW_OFFSET_MS)
@@ -19,7 +20,7 @@ export function moscowDay(iso: string): string {
export function previousClose(
candles: TbankCandle[],
priceAt: string,
): TbankCandle | null {
): null | TbankCandle {
return (
candles
.filter((candle) => {
@@ -32,6 +33,6 @@ export function previousClose(
);
})
.sort((a, b) => Number(b.time?.seconds) - Number(a.time?.seconds))[0] ??
null
null
);
}