Better eslint configuration and format some files

This commit is contained in:
prototypa
2023-08-22 22:52:01 -04:00
parent da8ef74b38
commit c1f36e9f79
10 changed files with 37 additions and 43 deletions

View File

@ -1,6 +1,6 @@
import { I18N } from '~/utils/config';
const formatter =
const formatter: Intl.DateTimeFormat =
I18N?.dateFormatter ||
new Intl.DateTimeFormat('en', {
year: 'numeric',
@ -9,13 +9,7 @@ const formatter =
timeZone: 'UTC',
});
/* eslint-disable no-mixed-spaces-and-tabs */
export const getFormattedDate = (date: Date) =>
date
? // eslint-disable-next-line @typescript-eslint/ban-ts-comment
/* @ts-ignore */
formatter.format(date)
: '';
export const getFormattedDate = (date: Date): string => (date ? formatter.format(date) : '');
export const trim = (str = '', ch?: string) => {
let start = 0,