Skip to content

Commit

Permalink
fix: eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ttttonyhe committed Dec 10, 2024
1 parent e97db42 commit 790fa32
Show file tree
Hide file tree
Showing 11 changed files with 386 additions and 277 deletions.
1 change: 1 addition & 0 deletions apps/main/src/components/Card/Paper/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Link from "next/link"

// eslint-disable-next-line no-redeclare
type Link = {
label: string
href: string
Expand Down
1 change: 1 addition & 0 deletions apps/main/src/components/Card/WithImage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export default function CardWithImage({ item, sticky }: Props) {
}, 1000)
} catch (e) {
setSummarizing(false)
console.log(e)
}
}, [])

Expand Down
1 change: 1 addition & 0 deletions apps/main/src/components/SubscriptionBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const SubscriptionBox = ({
body: JSON.stringify({
email: email,
name: email.split("@")[0],
// eslint-disable-next-line camelcase
list_uuids: [LISTMONK_LIST_UUID],
}),
})
Expand Down
8 changes: 4 additions & 4 deletions apps/main/src/constants/propTypes.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable camelcase */
import { tuple } from "~/utilities/dataTypes"

const listTypes = tuple("index", "cate", "search")
const labelTypes = tuple("sticky", "primary", "secondary", "green", "gray")
const _ListTypes = tuple("index", "cate", "search")
const _LabelTypes = tuple("sticky", "primary", "secondary", "green", "gray")

export interface WPPost {
code: any
Expand Down Expand Up @@ -44,5 +44,5 @@ export interface WPPost {
}
}

export type ListTypes = (typeof listTypes)[number]
export type LabelTypes = (typeof labelTypes)[number]
export type ListTypes = (typeof _ListTypes)[number]
export type LabelTypes = (typeof _LabelTypes)[number]
2 changes: 1 addition & 1 deletion apps/main/src/hooks/useTimeoutFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function useTimeoutFunction(
ms: number = 0
): UseTimeoutFnReturn {
const ready = useRef<boolean | null>(false)
const timeout = useRef<ReturnType<typeof setTimeout>>()
const timeout = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)
const callback = useRef(fn)

const isReady = useCallback(() => ready.current, [])
Expand Down
12 changes: 6 additions & 6 deletions apps/main/src/lib/fetcher.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const Fetcher = async (route: string) => {
return fetch(route, {
next: {
revalidate: 24 * 3600
}
})
.then((res) => res.json())
.catch((err) => {
console.error(err)
revalidate: 24 * 3600,
},
})
.then((res) => res.json())
.catch((err) => {
console.error(err)
})
}

export default Fetcher
1 change: 1 addition & 0 deletions apps/main/src/pages/api/revalidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const revalidate = async (
await res.revalidate(path)
return res.json({ status: 401, revalidated: true })
} catch (err) {
console.log(err)
return res.status(500).json({
status: 500,
revalidated: false,
Expand Down
2 changes: 1 addition & 1 deletion apps/main/src/pages/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from "next/link"
import React from "react"
import GithubFollowerMetric from "~/components/Metrics/GithubFollowers"
import GithubStarMetric from "~/components/Metrics/GithubStars"
import JMSMetric from "~/components/Metrics/JMS"
// import JMSMetric from "~/components/Metrics/JMS"
import NexmentMetric from "~/components/Metrics/Nexment"
import PageViewsMetric from "~/components/Metrics/PageViews"
import PostsMetric from "~/components/Metrics/Posts"
Expand Down
3 changes: 2 additions & 1 deletion apps/main/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ const Home: NextPageWithLayout = () => {
<a
href="https://uwaterloo.ca"
target="_blank"
className="inline-flex items-center gap-x-1 transition-colors hover:text-blue-500 dark:hover:text-blue-500">
className="inline-flex items-center gap-x-1 transition-colors hover:text-blue-500 dark:hover:text-blue-500"
rel="noreferrer">
University of Waterloo
<span className="flex h-5 w-5">
<Icon name="externalLink" />
Expand Down
20 changes: 10 additions & 10 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
"access": "public"
},
"dependencies": {
"@next/eslint-plugin-next": "^14.2.1",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"eslint": "^8",
"eslint-config-next": "^14.2.1",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-cypress": "^2.15.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"@next/eslint-plugin-next": "^15.1.0",
"@typescript-eslint/eslint-plugin": "^8.18.0",
"@typescript-eslint/parser": "^8.18.0",
"eslint": "^9",
"eslint-config-next": "^15.1.0",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-cypress": "^4.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.1.0",
"prettier-eslint": "^16.3.0"
}
}
Loading

0 comments on commit 790fa32

Please sign in to comment.