Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-md committed Oct 8, 2024
1 parent ac8ec96 commit 4883972
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion components/ApiReference/Method.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Chip, type SxProps } from '@mui/material'

const MethodChip: React.FC<{ method?: string, sx?: SxProps }> = ({
const MethodChip: React.FC<{ method?: string; sx?: SxProps }> = ({
method,
sx,
...props
Expand Down
2 changes: 1 addition & 1 deletion components/ApiReference/Path.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useContext } from 'react'
import Method from './Method'
import { NetworkContext } from './Network'

const Path: React.FC<{ path: string, method: string }> = ({ path, method }) => {
const Path: React.FC<{ path: string; method: string }> = ({ path, method }) => {
const [network] = useContext(NetworkContext)
return (
<Grid
Expand Down
2 changes: 1 addition & 1 deletion components/ApiReference/Property.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AccordionSummary } from '@mui/material'
import Link from '@mui/material/Link'

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const Property: React.FC<{ property: any, required?: boolean }> = ({
const Property: React.FC<{ property: any; required?: boolean }> = ({
property,
required
}) => {
Expand Down
20 changes: 10 additions & 10 deletions components/ApiReference/Response.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Hr from '../Hr'
import { MdxHeading } from '../../lib/mdx'

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const Response: React.FC<{ response: any, index: number }> = ({
const Response: React.FC<{ response: any; index: number }> = ({
response,
index
}) => {
Expand All @@ -21,15 +21,15 @@ const Response: React.FC<{ response: any, index: number }> = ({
type === undefined
? []
: Object.entries(
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
type === 'object'
? response.schema?.properties
: response.schema?.items
).map(([key, value]) => ({
name: key,
value,
required: response.schema?.required?.includes(key)
}))
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
type === 'object'
? response.schema?.properties
: response.schema?.items
).map(([key, value]) => ({
name: key,
value,
required: response.schema?.required?.includes(key)
}))

return (
<>
Expand Down
8 changes: 6 additions & 2 deletions components/Events/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const EventsPage: React.FC = () => {
</Typography>
<Typography className={css.body} sx={{ mt: '50px' }}>
We proudly support this event by sponsoring{' '}
{eventData.bounties.length} submission tracks for a total of{' '}$10,000
{eventData.bounties.length} submission tracks for a total of $10,000
{/*
{eventData.bounties[0].prize.currency}
{eventData.bounties
Expand Down Expand Up @@ -214,7 +214,11 @@ const EventsPage: React.FC = () => {
/>
))}
</Grid>
<Link href={eventData.bountyUrl} target='_blank' rel='noopener noreferrer'>
<Link
href={eventData.bountyUrl}
target='_blank'
rel='noopener noreferrer'
>
<Typography className={css.link}>
Learn more at bounty&apos;s page{' '}
{<ArrowForwardIosIcon sx={{ width: '16px' }} />}
Expand Down
6 changes: 3 additions & 3 deletions components/Footer/useOpenPositions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ interface SecondaryLocation {
}

export type OpenPositionsResponse = SWRResponse<
Position[],
unknown,
SWRConfiguration<Position[], unknown, BareFetcher<Position[]>> | undefined
Position[],
unknown,
SWRConfiguration<Position[], unknown, BareFetcher<Position[]>> | undefined
>

const enum EmploymentType {
Expand Down
6 changes: 1 addition & 5 deletions components/RemovedContentCallout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ const RemovedContentCallout: React.FC<{

if (!isContentRemoved) return

return (
<Callout type="warning">
{description}
</Callout>
)
return <Callout type='warning'>{description}</Callout>
}

export default RemovedContentCallout
16 changes: 7 additions & 9 deletions components/ResourceHub/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ export const ProjectCard = (resource: KnowledgeResource): JSX.Element => {
height: '100%'
}}
className={css.card}
onClick={
() => {
sendGAEvent('event', 'resource_hub_link', {
resource_url: resource.url,
resource_type: resource.type,
resource_name: resource.name
})
}
}
onClick={() => {
sendGAEvent('event', 'resource_hub_link', {
resource_url: resource.url,
resource_type: resource.type,
resource_name: resource.name
})
}}
>
<a
href={resource.url}
Expand Down
8 changes: 4 additions & 4 deletions lib/mdx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ const getMarkdownHeaderComponent: (
headingLevel: number
) => React.FC<{ children: ReactNode }> =
headingLevel =>
// eslint-disable-next-line @typescript-eslint/promise-function-async
({ children }) =>
MdxHeading({ headingLevel, children })
// eslint-disable-next-line @typescript-eslint/promise-function-async
({ children }) =>
MdxHeading({ headingLevel, children })

export const useCurrentTocIndex: (
headings: Heading[],
Expand Down Expand Up @@ -166,7 +166,7 @@ export const useCurrentTocIndex: (
nextHeadingNode.offsetTop - navHeight <
document.documentElement.scrollTop + window.innerHeight
setCurrentIndex(
isNextHeadingInView ? nextHeading?.link ?? '' : active?.link ?? ''
isNextHeadingInView ? (nextHeading?.link ?? '') : (active?.link ?? '')
)
} else setCurrentIndex(_headings[0]?.children?.[0]?.link ?? '')
}, [headings, navHeight])
Expand Down
20 changes: 10 additions & 10 deletions lib/storage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Storage {
private readonly prefix: string
private readonly storage?: BrowserStorage

constructor (storage?: BrowserStorage, prefix = LS_NAMESPACE) {
constructor(storage?: BrowserStorage, prefix = LS_NAMESPACE) {
this.prefix = prefix
this.storage = storage
}
Expand Down Expand Up @@ -63,14 +63,14 @@ const local = new Storage(

export const localItem = <T>(
key: string
): { get: () => T | null, set: (value: T) => void, remove: () => void } => ({
get: () => local.getItem<T>(key),
set: (value: T) => {
local.setItem<T>(key, value)
},
remove: () => {
local.removeItem(key)
}
})
): { get: () => T | null; set: (value: T) => void; remove: () => void } => ({
get: () => local.getItem<T>(key),
set: (value: T) => {
local.setItem<T>(key, value)
},
remove: () => {
local.removeItem(key)
}
})

export default local
4 changes: 3 additions & 1 deletion styles/emotion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export const createEmotionCache = (): EmotionCache => {
let insertionPoint

if (typeof document !== 'undefined') {
const emotionInsertionPoint = document.querySelector<HTMLMetaElement>('meta[name="emotion-insertion-point"]')
const emotionInsertionPoint = document.querySelector<HTMLMetaElement>(
'meta[name="emotion-insertion-point"]'
)
insertionPoint = emotionInsertionPoint ?? undefined
}

Expand Down

0 comments on commit 4883972

Please sign in to comment.