Skip to content

Commit bfd8748

Browse files
Linting
1 parent a260ae4 commit bfd8748

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

docs-v2/middleware.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { NextResponse } from 'next/server'
2-
import type { NextRequest } from 'next/server'
1+
import { NextResponse } from "next/server"
2+
import type { NextRequest } from "next/server"
33

44
/**
55
* Middleware to handle 404s by redirecting to the home page
@@ -10,19 +10,19 @@ export function middleware(request: NextRequest) {
1010
// We only want to handle 404s, not other pages
1111
// This check isn't foolproof but helps avoid redirecting existing pages
1212
const pathname = request.nextUrl.pathname
13-
13+
1414
// Check if this is a static asset or API route - we don't want to redirect these
1515
if (
16-
pathname.startsWith('/_next') ||
17-
pathname.startsWith('/api/') ||
18-
pathname.startsWith('/images/') ||
19-
pathname.includes('.') // Likely a file, e.g. favicon.ico
16+
pathname.startsWith("/_next") ||
17+
pathname.startsWith("/api/") ||
18+
pathname.startsWith("/images/") ||
19+
pathname.includes(".") // Likely a file, e.g. favicon.ico
2020
) {
2121
return NextResponse.next()
2222
}
2323

2424
// Return a 301 (permanent) redirect to the home page
25-
return NextResponse.redirect(new URL('/', request.url), 301)
25+
return NextResponse.redirect(new URL("/", request.url), 301)
2626
}
2727

2828
// Configure which paths this middleware will run on
@@ -36,6 +36,6 @@ export const config = {
3636
* 3. Static files (images, etc)
3737
* 4. System paths like _next, favicon.ico, etc.
3838
*/
39-
'/((?!_next|api|images|favicon.ico).*)',
39+
"/((?!_next|api|images|favicon.ico).*)",
4040
],
41-
}
41+
}

docs-v2/pages/404.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ export default function Custom404() {
1515
const redirectTimeout = setTimeout(() => {
1616
router.replace("/")
1717
}, 100)
18-
18+
1919
return () => clearTimeout(redirectTimeout)
20-
}, [router])
20+
}, [
21+
router,
22+
])
2123

2224
return (
2325
<div style={{

0 commit comments

Comments
 (0)