引入 husky,并全局重新格式化

This commit is contained in:
2025-06-07 11:49:57 +08:00
parent 05fce179c9
commit c7527177b0
89 changed files with 2140 additions and 1899 deletions

View File

@@ -13,7 +13,6 @@ type ApiResponse<T = undefined> = {
data: T
}
type PageRecord<T = unknown> = {
total: number
page: number

View File

@@ -37,9 +37,9 @@ export type Resource<T extends 1 | 2 = 1 | 2> = {
updated_at: Date
} & (
T extends 1 ? {
type: 1
short: ResourceShort
} :
type: 1
short: ResourceShort
} :
T extends 2 ? {
type: 2
long: ResourceLong

View File

@@ -2,5 +2,5 @@
import {useState} from 'react'
export function useStatus() {
return useState<'done'|'fail'|'load'>('load')
return useState<'done' | 'fail' | 'load'>('load')
}

View File

@@ -14,10 +14,10 @@ export type LayoutActions = {
export const createLayoutStore = () => {
return createStore<LayoutStore>()(setState => ({
navbar: true,
toggleNavbar: () => setState(state => {
toggleNavbar: () => setState((state) => {
return {navbar: !state.navbar}
}),
setNavbar: (navbar) => setState(_ => {
setNavbar: navbar => setState((_) => {
return {navbar}
}),
}))

View File

@@ -2,7 +2,6 @@ import {User} from '@/lib/models'
import {createStore} from 'zustand/vanilla'
import {getProfile} from '@/actions/auth'
export type ProfileStore = ProfileState & ProfileActions
export type ProfileState = {
@@ -10,10 +9,10 @@ export type ProfileState = {
}
export type ProfileActions = {
refreshProfile: () => Promise<void>
refreshProfile: () => Promise<void>
}
export const createProfileStore = (init: User|null) => {
export const createProfileStore = (init: User | null) => {
return createStore<ProfileStore>()(setState => ({
profile: init,
refreshProfile: async () => {
@@ -24,4 +23,3 @@ export const createProfileStore = (init: User|null) => {
},
}))
}

View File

@@ -3,4 +3,3 @@ import {ClassNameValue, twMerge} from 'tailwind-merge'
export function merge(...inputs: ClassNameValue[]) {
return twMerge(inputs)
}