Skip to content

Commit 76cbb44

Browse files
Remove unnecessary eslint-disable comments across multiple components
1 parent 37d6847 commit 76cbb44

32 files changed

+48
-41
lines changed

src/app/(auth)/layout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
21
"use client";
32
import { useAuthStore } from "@/store/Auth";
43
import { useRouter } from "next/navigation";

src/app/(auth)/login/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
21
"use client";
32
import { Label } from "@/components/ui/label";
43
import { Input } from "@/components/ui/input";

src/app/(auth)/register/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
"use client";
33
import { useAuthStore } from '@/store/Auth'
44
import React from 'react'

src/app/components/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
import React from "react";
33
import {AnimatedGridPattern} from "@/components/magicui/animated-grid-pattern";
44
import { cn } from "@/lib/utils";

src/app/components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
"use client";
33
import React from "react";
44
import { FloatingNav } from "@/components/ui/floating-navbar";

src/app/components/HeroSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
import React from "react";
33
import { HeroParallax } from "@/components/ui/hero-parallax";
44
import { databases } from "@/models/server/config";

src/app/components/HeroSectionHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
"use client";
33

44
import {IconCloud} from "@/components/magicui/icon-cloud";

src/app/components/LatestQuestions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
import QuestionCard from "@/components/QuestionCard";
33
import { answerCollection, db, questionCollection, voteCollection } from "@/models/name";
44
import { databases, users } from "@/models/server/config";

src/app/components/TopContributors.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
import { cn } from "@/lib/utils";
3+
34
import { AnimatedList } from "@/components/magicui/animated-list";
45
import { users } from "@/models/server/config";
56
import { Models, Query } from "node-appwrite";

src/app/questions/Search.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
"use client";
33

44
import { Input } from "@/components/ui/input";

src/app/questions/[quesId]/[quesName]/EditQuestion.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
"use client";
33

44
import { useAuthStore } from "@/store/Auth";

src/app/questions/[quesId]/[quesName]/edit/EditQues.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
"use client";
33

44
import QuestionForm from "@/components/QuestionForm";
@@ -16,7 +16,7 @@ const EditQues = ({ question }: { question: Models.Document }) => {
1616
if (question.authorId !== user?.$id) {
1717
router.push(`/questions/${question.$id}/${slugify(question.title)}`);
1818
}
19-
}, []);
19+
}, [question, router, user]);
2020

2121
if (user?.$id !== question.authorId) return null;
2222

src/app/questions/[quesId]/[quesName]/edit/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
21
import { db, questionCollection } from "@/models/name";
32
import { databases } from "@/models/server/config";
43
import React from "react";
54
import EditQues from "./EditQues";
65
import { Particles } from "@/components/magicui/particles";
76

7+
// { params: { quesId: string; quesName: string } }
8+
89
const Page = async ({ params }: { params: { quesId: string; quesName: string } }) => {
910
const question = await databases.getDocument(db, questionCollection, params.quesId);
1011

src/app/questions/[quesId]/[quesName]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
import Answers from "@/components/Answers";
33
import Comments from "@/components/Comments";
44
import { MarkdownPreview } from "@/components/RTE";

src/app/questions/ask/AddQues.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
"use client";
33

44
import QuestionForm from "@/components/QuestionForm";

src/app/questions/ask/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
import React from "react";
33
import AddQues from "./AddQues";
44
import { Particles } from "@/components/magicui/particles";

src/app/questions/page.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
import { databases, users } from "@/models/server/config";
33
import { answerCollection, db, voteCollection, questionCollection } from "@/models/name";
44
import { Query } from "node-appwrite";
@@ -17,20 +17,25 @@ const Page = async ({
1717
}: {
1818
searchParams: { page?: string; tag?: string; search?: string };
1919
}) => {
20-
searchParams.page ||= "1";
20+
const searchForParams = await searchParams;
21+
const params = {
22+
page: searchForParams?.page || "1",
23+
tag: searchForParams?.tag || "",
24+
search: searchForParams?.search || ""
25+
}
2126

2227
const queries = [
2328
Query.orderDesc("$createdAt"),
24-
Query.offset((+searchParams.page - 1) * 25),
29+
Query.offset((+params?.page - 1) * 25),
2530
Query.limit(25),
2631
];
2732

28-
if (searchParams.tag) queries.push(Query.equal("tags", searchParams.tag));
29-
if (searchParams.search)
33+
if (params.tag) queries.push(Query.equal("tags", params.tag));
34+
if (params.search)
3035
queries.push(
3136
Query.or([
32-
Query.search("title", searchParams.search),
33-
Query.search("content", searchParams.search),
37+
Query.search("title", params.search),
38+
Query.search("content", params.search),
3439
])
3540
);
3641

src/app/users/[userId]/[userSlug]/EditButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
"use client";
33

44
import { useAuthStore } from "@/store/Auth";

src/app/users/[userId]/[userSlug]/Navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
"use client";
33

44
import Link from "next/link";

src/app/users/[userId]/[userSlug]/answers/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
import { Particles } from "@/components/magicui/particles";
33
import Pagination from "@/components/Pagination";
44
import { MarkdownPreview } from "@/components/RTE";

src/app/users/[userId]/[userSlug]/edit/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
import { Particles } from "@/components/magicui/particles";
33
import React from "react";
44

src/app/users/[userId]/[userSlug]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
import { avatars } from "@/models/client/config";
33
import { users } from "@/models/server/config";
44
import { UserPrefs } from "@/store/Auth";

src/app/users/[userId]/[userSlug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
import { databases, users } from "@/models/server/config";
33
import { UserPrefs } from "@/store/Auth";
44
import React from "react";

src/app/users/[userId]/[userSlug]/questions/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
import Pagination from "@/components/Pagination";
33
import QuestionCard from "@/components/QuestionCard";
44
import { answerCollection, db, questionCollection, voteCollection } from "@/models/name";

src/app/users/[userId]/[userSlug]/votes/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
import Pagination from "@/components/Pagination";
33
import { answerCollection, db, questionCollection, voteCollection } from "@/models/name";
44
import { databases } from "@/models/server/config";

src/components/Answers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22
"use client";
33

4-
import { Models } from "appwrite";
4+
import { Models } from "appwrite";
55
import React from "react";
66
import VoteButtons from "./VoteButtons";
77
import { useAuthStore } from "@/store/Auth";

src/components/Pagination.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
"use client";
33

44
import { usePathname, useRouter, useSearchParams } from "next/navigation";

src/components/QuestionCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
"use client";
33

44
import React from "react";

src/components/RTE.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
"use client";
33

44
import dynamic from "next/dynamic";

src/components/magicui/animated-grid-pattern.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
"use client";
23

34
import { motion } from "motion/react";
@@ -34,7 +35,6 @@ export function AnimatedGridPattern({
3435
className,
3536
maxOpacity = 0.5,
3637
duration = 4,
37-
repeatDelay = 0.5,
3838
...props
3939
}: AnimatedGridPatternProps) {
4040
const id = useId();
@@ -76,12 +76,12 @@ export function AnimatedGridPattern({
7676
if (dimensions.width && dimensions.height) {
7777
setSquares(generateSquares(numSquares));
7878
}
79-
}, [dimensions, numSquares]);
79+
}, [dimensions, numSquares, generateSquares]);
8080

8181
// Resize observer to update container dimensions
8282
useEffect(() => {
8383
const resizeObserver = new ResizeObserver((entries) => {
84-
for (let entry of entries) {
84+
for (const entry of entries) {
8585
setDimensions({
8686
width: entry.contentRect.width,
8787
height: entry.contentRect.height,

src/components/magicui/icon-cloud.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
"use client";
23

34
import React, { useEffect, useRef, useState } from "react";
@@ -24,7 +25,7 @@ function easeOutCubic(t: number): number {
2425
export function IconCloud({ icons, images }: IconCloudProps) {
2526
const canvasRef = useRef<HTMLCanvasElement>(null);
2627
const [iconPositions, setIconPositions] = useState<Icon[]>([]);
27-
const [rotation, setRotation] = useState({ x: 0, y: 0 });
28+
const [rotation] = useState({ x: 0, y: 0 });
2829
const [isDragging, setIsDragging] = useState(false);
2930
const [lastMousePos, setLastMousePos] = useState({ x: 0, y: 0 });
3031
const [mousePos, setMousePos] = useState({ x: 0, y: 0 });
@@ -37,7 +38,7 @@ export function IconCloud({ icons, images }: IconCloudProps) {
3738
startTime: number;
3839
duration: number;
3940
} | null>(null);
40-
const animationFrameRef = useRef<number>();
41+
const animationFrameRef = useRef<number | undefined>(undefined);
4142
const rotationRef = useRef(rotation);
4243
const iconCanvasesRef = useRef<HTMLCanvasElement[]>([]);
4344
const imagesLoadedRef = useRef<boolean[]>([]);

src/components/ui/floating-navbar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
"use client";
23
import React, { JSX, useState } from "react";
34
import { motion, AnimatePresence, useScroll, useMotionValueEvent } from "framer-motion";

0 commit comments

Comments
 (0)