chore(root): migrate to biome
This commit is contained in:
@@ -155,7 +155,7 @@ export const metrics = {
|
||||
} as const;
|
||||
|
||||
export function isMinuteIntervalEnabledByRange(
|
||||
range: keyof typeof timeWindows
|
||||
range: keyof typeof timeWindows,
|
||||
) {
|
||||
return range === '30min' || range === 'lastHour';
|
||||
}
|
||||
@@ -165,13 +165,15 @@ export function isHourIntervalEnabledByRange(range: keyof typeof timeWindows) {
|
||||
}
|
||||
|
||||
export function getDefaultIntervalByRange(
|
||||
range: keyof typeof timeWindows
|
||||
range: keyof typeof timeWindows,
|
||||
): keyof typeof intervals {
|
||||
if (range === '30min' || range === 'lastHour') {
|
||||
return 'minute';
|
||||
} else if (range === 'today') {
|
||||
}
|
||||
if (range === 'today') {
|
||||
return 'hour';
|
||||
} else if (
|
||||
}
|
||||
if (
|
||||
range === '7d' ||
|
||||
range === '30d' ||
|
||||
range === 'lastMonth' ||
|
||||
@@ -184,12 +186,13 @@ export function getDefaultIntervalByRange(
|
||||
|
||||
export function getDefaultIntervalByDates(
|
||||
startDate: string | null,
|
||||
endDate: string | null
|
||||
endDate: string | null,
|
||||
): null | keyof typeof intervals {
|
||||
if (startDate && endDate) {
|
||||
if (isSameDay(startDate, endDate)) {
|
||||
return 'hour';
|
||||
} else if (isSameMonth(startDate, endDate)) {
|
||||
}
|
||||
if (isSameMonth(startDate, endDate)) {
|
||||
return 'day';
|
||||
}
|
||||
return 'month';
|
||||
|
||||
@@ -3,25 +3,12 @@
|
||||
"version": "0.0.1",
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@openpanel/eslint-config": "workspace:*",
|
||||
"@openpanel/prettier-config": "workspace:*",
|
||||
"@openpanel/tsconfig": "workspace:*",
|
||||
"date-fns": "^3.3.1",
|
||||
"eslint": "^8.48.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prisma": "^5.1.1",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": [
|
||||
"@openpanel/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@openpanel/prettier-config"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user