Skip to content

Commit ae4ac3d

Browse files
fix: clean lint warnings in touched files
1 parent c55abb4 commit ae4ac3d

5 files changed

Lines changed: 55 additions & 50 deletions

File tree

src/components/blogCarousel/blogCard.tsx

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
"use client";
2+
import React from "react";
23
import Link from "@docusaurus/Link";
3-
import { Card, CardContent } from "../ui/card";
44
import { getAuthorProfiles, getAuthorTooltip } from "../../utils/authors";
55

6-
declare const require: any;
7-
const React = require("react");
6+
interface BlogCardProps {
7+
type: string;
8+
date?: string;
9+
title: string;
10+
content: string;
11+
imageUrl: string;
12+
id: string;
13+
authors?: string[];
14+
}
815

9-
const BlogCard = ({ type, date, title, content, imageUrl, id, authors }) => {
10-
const [isHovered, setIsHovered] = React.useState(false);
16+
const BlogCard = ({
17+
type,
18+
title,
19+
content,
20+
imageUrl,
21+
id,
22+
authors,
23+
}: BlogCardProps) => {
1124
const authorProfiles = getAuthorProfiles(authors || []);
1225

1326
if (!id || !type) {
@@ -37,11 +50,7 @@ const BlogCard = ({ type, date, title, content, imageUrl, id, authors }) => {
3750
const category = getCategory(title);
3851

3952
return (
40-
<div
41-
onMouseEnter={() => setIsHovered(true)}
42-
onMouseLeave={() => setIsHovered(false)}
43-
className="relative h-full overflow-hidden transition-all duration-300"
44-
>
53+
<div className="relative h-full overflow-hidden transition-all duration-300">
4554
<div className="article-card h-full">
4655
{/* Category Badge */}
4756
<div className="card-category">{category}</div>
@@ -64,7 +73,7 @@ const BlogCard = ({ type, date, title, content, imageUrl, id, authors }) => {
6473
<div className="card-meta">
6574
<div className="card-author">
6675
{/* Stacked Author Avatars */}
67-
{authorProfiles.length > 0 && (
76+
{authorProfiles.length > 0 &&
6877
(() => {
6978
const max = 3;
7079
const visible = authorProfiles.slice(0, max);
@@ -102,8 +111,7 @@ const BlogCard = ({ type, date, title, content, imageUrl, id, authors }) => {
102111
)}
103112
</div>
104113
);
105-
})()
106-
)}
114+
})()}
107115

108116
{/* Author Names */}
109117
<div className="author-name-group">

src/components/discussions/DiscussionCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import { motion } from "framer-motion";
3-
import { MessageCircle, ThumbsUp, Calendar, Tag, User } from "lucide-react";
3+
import { MessageCircle, ThumbsUp, Calendar, Tag } from "lucide-react";
44

55
export interface Discussion {
66
id: string;

src/pages/blogs/index.tsx

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
declare const require: any;
2-
const React = require("react");
1+
import React, { type ChangeEvent } from "react";
32
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
43
import Layout from "@theme/Layout";
54
import Link from "@docusaurus/Link";
@@ -47,7 +46,7 @@ export default function Blogs() {
4746
setFilteredBlogs(filtered);
4847
}, [searchTerm, selectedCategory]);
4948

50-
const handleSearchChange = (e: any) => {
49+
const handleSearchChange = (e: ChangeEvent<HTMLInputElement>) => {
5150
setSearchTerm(e.target.value);
5251
};
5352

@@ -146,7 +145,11 @@ export default function Blogs() {
146145
onClick={() => setSearchTerm("")}
147146
aria-label="Clear search"
148147
>
149-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
148+
<svg
149+
viewBox="0 0 24 24"
150+
fill="none"
151+
stroke="currentColor"
152+
>
150153
<line x1="18" y1="6" x2="6" y2="18"></line>
151154
<line x1="6" y1="6" x2="18" y2="18"></line>
152155
</svg>
@@ -219,17 +222,16 @@ export default function Blogs() {
219222
{filteredBlogs.length > 0
220223
? `Found ${filteredBlogs.length} article${filteredBlogs.length !== 1 ? "s" : ""}`
221224
: `No articles found`}
222-
{selectedCategory !== "All" &&
223-
` in ${selectedCategory}`}
225+
{selectedCategory !== "All" && ` in ${selectedCategory}`}
224226
{searchTerm && ` for "${searchTerm}"`}
225227
</p>
226228
</div>
227229
)}
228230

229231
<div className="articles-grid">
230232
{filteredBlogs.length > 0 ? (
231-
filteredBlogs.map((blog, index) => (
232-
<BlogCard key={blog.id ?? blog.slug} blog={blog} index={index} />
233+
filteredBlogs.map((blog) => (
234+
<BlogCard key={blog.id ?? blog.slug} blog={blog} />
233235
))
234236
) : (
235237
<div className="no-results">
@@ -257,7 +259,7 @@ export default function Blogs() {
257259
);
258260
}
259261

260-
const BlogCard = ({ blog, index }) => {
262+
const BlogCard = ({ blog }: { blog: (typeof blogs)[number] }) => {
261263
const authors = getAuthorProfiles(blog.authors || []);
262264

263265
return (
@@ -276,7 +278,7 @@ const BlogCard = ({ blog, index }) => {
276278
<div className="card-meta">
277279
<div className="card-author">
278280
{/* Stacked Author Avatars */}
279-
{authors.length > 0 && (
281+
{authors.length > 0 &&
280282
(() => {
281283
const max = 3;
282284
const visible = authors.slice(0, max);
@@ -314,28 +316,27 @@ const BlogCard = ({ blog, index }) => {
314316
)}
315317
</div>
316318
);
317-
})()
318-
)}
319+
})()}
319320

320321
{/* Author Names */}
321322
<div className="author-name-group">
322-
{authors.map((author, authorIndex) => (
323-
<span key={author.id} className="author-item">
324-
{authorIndex > 0 && (
325-
<span className="author-separator">&</span>
326-
)}
327-
<Link
328-
href={author.githubUrl}
329-
className="author-name author-link"
330-
target="_blank"
331-
rel="noopener noreferrer"
332-
data-author-tooltip={getAuthorTooltip(author.id)}
333-
aria-label={`Open ${author.name} on GitHub`}
334-
>
335-
{author.name}
336-
</Link>
337-
</span>
338-
))}
323+
{authors.map((author, authorIndex) => (
324+
<span key={author.id} className="author-item">
325+
{authorIndex > 0 && (
326+
<span className="author-separator">&</span>
327+
)}
328+
<Link
329+
href={author.githubUrl}
330+
className="author-name author-link"
331+
target="_blank"
332+
rel="noopener noreferrer"
333+
data-author-tooltip={getAuthorTooltip(author.id)}
334+
aria-label={`Open ${author.name} on GitHub`}
335+
>
336+
{author.name}
337+
</Link>
338+
</span>
339+
))}
339340
</div>
340341
</div>
341342
<span className="card-read-time">5 min read</span>

src/theme/Navbar/Content/index.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import React, {
2-
type ReactNode,
3-
useMemo,
4-
Component,
5-
type ReactElement,
6-
} from "react";
1+
import React, { type ReactNode, useMemo } from "react";
72
import { useThemeConfig, ErrorCauseBoundary } from "@docusaurus/theme-common";
83
import { splitNavbarItems } from "@docusaurus/theme-common/internal";
94
import NavbarItem, { type Props as NavbarItemConfig } from "@theme/NavbarItem";
@@ -23,7 +18,7 @@ function SafeMobileSidebarToggle(): ReactNode {
2318
// If it fails, the error will be caught by Docusaurus's error boundary
2419
try {
2520
return <NavbarMobileSidebarToggle />;
26-
} catch (error) {
21+
} catch {
2722
// This won't catch hook errors, but it's here for other potential errors
2823
console.warn("Mobile sidebar toggle unavailable");
2924
return null;

src/types/global.d.ts

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
// Global type declarations for better TypeScript compatibility
23

34
// CSS modules and side-effect imports

0 commit comments

Comments
 (0)