Skip to content

Commit c457f78

Browse files
authored
eslint unused imports (#141)
* summarize * auth/callback * A_C * s_u * mv page * - ( ) * unused imports
1 parent 06009b4 commit c457f78

20 files changed

+161
-66
lines changed

web/.eslintrc.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
{
2-
"extends": "next/core-web-vitals"
2+
"extends": "next/core-web-vitals",
3+
"plugins": ["unused-imports"],
4+
"rules": {
5+
"unused-imports/no-unused-imports": "error",
6+
"unused-imports/no-unused-vars": [
7+
"warn",
8+
{ "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" }
9+
]
10+
}
311
}

web/app/(api)/posts/route.ts

-20
This file was deleted.

web/app/(landing)/LandingBody.tsx web/app/LandingBody.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useRouter } from 'next/navigation';
55
import { useSearchParams } from 'next/navigation';
66
import { useEffect, useState } from 'react';
77

8-
import { type Example } from '@/app/(landing)/page';
8+
import { type Example } from '@/app/page';
99
import { MarqueeCard } from '@/components/MarqueeCard';
1010
import { SummaryCard } from '@/components/SummaryCard';
1111
import { Marquee } from '@/components/layout/Marquee';
@@ -16,7 +16,7 @@ import {
1616
getYouTubeURL,
1717
isValidYouTubeUrl,
1818
} from '@/lib/helpers';
19-
import { useFocusShortcut, useUser } from '@/lib/hooks';
19+
import { useUser } from '@/lib/hooks';
2020

2121
export default function LandingBody({ examples }: { examples: Example[] }) {
2222
const searchParams = useSearchParams();
@@ -103,7 +103,7 @@ export default function LandingBody({ examples }: { examples: Example[] }) {
103103
try {
104104
setLoading(true);
105105
const response = await fetch(
106-
`/summarize?video_id=${encodeURIComponent(video_id)}&save=${saveHistory}`
106+
`/api/summarize?video_id=${encodeURIComponent(video_id)}&save=${saveHistory}`
107107
);
108108
const summary = await response.json();
109109
setSummary(summary);
File renamed without changes.

web/app/(api)/summarize/route.ts web/app/api/summarize/route.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NextRequest } from 'next/server';
22

3-
import { fetchTranscript } from '@/app/(api)/summarize/fetchTranscript';
4-
import { summarizeTranscript } from '@/app/(api)/summarize/summarizeTranscript';
3+
import { fetchTranscript } from '@/app/api/summarize/fetchTranscript';
4+
import { summarizeTranscript } from '@/app/api/summarize/summarizeTranscript';
55
import { createClient } from '@/utils/supabase/server';
66

77
async function getYouTubeTranscript(video_id: string) {

web/app/(marketing)/blog/[slug]/page.tsx web/app/blog/[slug]/page.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import Link from 'next/link';
22
import { notFound } from 'next/navigation';
33

44
import { PostBody } from '@/components/mdx/post-body';
5-
import { Button } from '@/components/ui/button';
65
import { AppConfig } from '@/lib/constants';
76
import { getPost } from '@/lib/get-posts';
87

File renamed without changes.

web/app/login/page.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import Link from 'next/link';
44

55
import { GoogleIcon } from '@/components/icons/GoogleIcon';
6+
import { AppConfig } from '@/lib/constants';
67
import { createClient } from '@/utils/supabase/client';
78

89
export default function Login() {
@@ -13,7 +14,7 @@ export default function Login() {
1314
const { error } = await supabase.auth.signInWithOAuth({
1415
provider: 'google',
1516
options: {
16-
redirectTo: `${window.location.origin}/auth/callback`,
17+
redirectTo: `${window.location.origin}${AppConfig.SITE_MAP.AUTH_CALLBACK}`,
1718
},
1819
});
1920
if (error) {

web/app/(landing)/page.tsx web/app/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Suspense } from 'react';
22

3-
import LandingBody from '@/app/(landing)/LandingBody';
3+
import LandingBody from '@/app/LandingBody';
44
import { getThumbnail, getYouTubeURL } from '@/lib/helpers';
55
import { createClient } from '@/utils/supabase/server';
66

File renamed without changes.
File renamed without changes.

web/app/(marketing)/pricing/page.tsx web/app/pricing/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Suspense } from 'react';
22

3-
import { PricingBody } from '@/app/(marketing)/pricing/PricingBody';
3+
import { PricingBody } from '@/app/pricing/PricingBody';
44
import CheckoutButton from '@/components/CheckoutButton';
55
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
66

web/components/MarqueeCard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Example } from '@/app/(landing)/page';
1+
import { type Example } from '@/app/page';
22

33
export type MarqueeCardProps = {
44
example: Example;

web/components/auth/LoginDialog.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function LoginDialog() {
2525
const { error } = await supabase.auth.signInWithOAuth({
2626
provider: 'google',
2727
options: {
28-
redirectTo: `${window.location.origin}/auth/callback`,
28+
redirectTo: `${window.location.origin}${AppConfig.SITE_MAP.AUTH_CALLBACK}`,
2929
},
3030
});
3131
if (error) {

web/lib/constants.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ export const AppConfig = {
77
'Summarize YouTube videos for free with summa.tube. Quickly generate summaries for any video, saving you time and helping you capture key points instantly.',
88
},
99
CONTACT_EMAIL: '[email protected]',
10-
SITE_URL: 'https://summa.tube',
10+
SITE_URL: 'https://www.summa.tube',
1111
SITE_MAP: {
1212
HOME: '/',
1313
PRIVACY: '/policies/privacy',
1414
TERMS: '/policies/terms',
1515
HISTORY: '/history',
1616
BLOG: '/blog',
1717
PRICING: '/pricing',
18+
AUTH_CALLBACK: '/api/auth/callback',
1819
},
1920
SOCIAL: {
2021
GITHUB: 'https://github.com/adnjoo/summatube',

0 commit comments

Comments
 (0)