Skip to content

Commit

Permalink
fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeKarow committed Feb 15, 2024
1 parent 51b393f commit c179641
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 48 deletions.
27 changes: 13 additions & 14 deletions packages/ui/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ initializeMsw({
if (url.startsWith('/trpc' || '/api')) {
console.error(`Unhandled ${method} request to ${url}.
This exception has been only logged in the console, however, it's strongly recommended to resolve this error as you don't want unmocked data in Storybook stories.
If you wish to mock an error response, please refer to this guide: https://mswjs.io/docs/recipes/mocking-error-responses
`)
This exception has been only logged in the console, however, it's strongly recommended to resolve this error as you don't want unmocked data in Storybook stories.
If you wish to mock an error response, please refer to this guide: https://mswjs.io/docs/recipes/mocking-error-responses
`)
}
},
})
Expand Down Expand Up @@ -134,14 +134,13 @@ type PseudoStates =
| 'link'
| 'target'

type DesignParams = { name?: string } & (
| {
type: 'figma'
url: `https://${string}`
}
| {
type: 'figspec'
url: `https://${string}`
accessToken: string
}
)
type DesignParams = ({ name?: string } & DesignFigma) | DesignFigspec
type DesignFigma = {
type: 'figma'
url: `https://${string}`
}
type DesignFigspec = {
type: 'figspec'
url: `https://${string}`
accessToken: string
}
25 changes: 13 additions & 12 deletions packages/ui/components/core/Badge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -520,19 +520,20 @@ interface BadgeStylesParams {
minify?: boolean
hideBg?: boolean
}
interface BadgeOtherProps extends Omit<BadgeProps, 'variant'> {
/** Preset designs */
variant?:
| Exclude<CustomVariants, 'leader' | 'verified' | 'attribute' | 'community' | 'service' | 'national'>
| 'outline'
/**
* Item rendered on the left side of the badge. Should be either an emoji unicode string or an Icon
* component
*/
leftSection?: ReactNode
hideTooltip?: boolean
}
export type CustomBadgeProps =
| (Omit<BadgeProps, 'variant'> & {
/** Preset designs */
variant?:
| Exclude<CustomVariants, 'leader' | 'verified' | 'attribute' | 'community' | 'service' | 'national'>
| 'outline'
/**
* Item rendered on the left side of the badge. Should be either an emoji unicode string or an Icon
* component
*/
leftSection?: ReactNode
hideTooltip?: boolean
})
| BadgeOtherProps
| LeaderBadgeProps
| VerifiedBadgeProps
| AttributeTagProps
Expand Down
24 changes: 11 additions & 13 deletions packages/ui/lib/trpcResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ export type RpcSuccessResponse<Data> = {
data: Data | SuperJSONResult
}
}

type ErrorObject = {
message: string
code: number
data: {
code: string
httpStatus: number
stack: string
path: string //TQuery
}
}
export type RpcErrorResponse = {
error:
| {
message: string
code: number
data: {
code: string
httpStatus: number
stack: string
path: string //TQuery
}
}
| SuperJSONResult
error: ErrorObject | SuperJSONResult
}

// According to JSON-RPC 2.0 and tRPC documentation.
Expand Down
17 changes: 8 additions & 9 deletions packages/ui/providers/SearchState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,15 @@ export const SearchStateProvider = ({ children, initState }: SearchStateProvider
</SearchStateContext.Provider>
)
}
type RouteParams = {
params: string[]
page: string
a?: string[]
s?: string[]
sort?: string[]
}

type GetRoute = () =>
| {
params: string[]
page: string
a?: string[]
s?: string[]
sort?: string[]
}
| undefined
type GetRoute = () => RouteParams | undefined

export interface SearchStateContext {
searchState: State & { attributes: string[]; services: string[]; getRoute: GetRoute }
Expand Down

0 comments on commit c179641

Please sign in to comment.