- 安装 ESLint 和 eslint-config-next 依赖 - 创建 .eslintrc.json 配置文件,使用 Next.js 严格模式 - 修复 TypeScript 代码中的类型错误: - 移除 any 类型,使用具体的类型定义 - 修复未使用的函数参数和变量 - 优化组件类型定义 - 现在 CI/CD 可以成功通过 lint 检查
This commit is contained in:
@ -19,7 +19,7 @@ export function Navigation({ activeTab, onTabChange }: NavigationProps) {
|
||||
{ id: "contact", name: "联系", href: "#contact" },
|
||||
]
|
||||
|
||||
const handleTabClick = (item: any) => {
|
||||
const handleTabClick = (item: { id: string; name: string; icon: React.ReactNode }) => {
|
||||
// Handle all tabs, not just gallery and timeline
|
||||
onTabChange(item.id)
|
||||
setIsMenuOpen(false)
|
||||
|
||||
@ -7,8 +7,10 @@ import { Button } from "@/components/ui/button"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { Card, CardContent } from "@/components/ui/card"
|
||||
|
||||
import { Photo } from '@/lib/queries'
|
||||
|
||||
interface PhotoModalProps {
|
||||
photo: any
|
||||
photo: Photo
|
||||
onClose: () => void
|
||||
onPrev: () => void
|
||||
onNext: () => void
|
||||
|
||||
@ -54,8 +54,8 @@ function Calendar({
|
||||
...classNames,
|
||||
}}
|
||||
components={{
|
||||
IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,
|
||||
IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,
|
||||
IconLeft: () => <ChevronLeft className="h-4 w-4" />,
|
||||
IconRight: () => <ChevronRight className="h-4 w-4" />,
|
||||
}}
|
||||
{...props}
|
||||
/>
|
||||
|
||||
@ -69,7 +69,7 @@ ChartContainer.displayName = "Chart"
|
||||
|
||||
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
||||
const colorConfig = Object.entries(config).filter(
|
||||
([_, config]) => config.theme || config.color
|
||||
([, config]) => config.theme || config.color
|
||||
)
|
||||
|
||||
if (!colorConfig.length) {
|
||||
|
||||
@ -20,11 +20,14 @@ type ToasterToast = ToastProps & {
|
||||
|
||||
const actionTypes = {
|
||||
ADD_TOAST: "ADD_TOAST",
|
||||
UPDATE_TOAST: "UPDATE_TOAST",
|
||||
UPDATE_TOAST: "UPDATE_TOAST",
|
||||
DISMISS_TOAST: "DISMISS_TOAST",
|
||||
REMOVE_TOAST: "REMOVE_TOAST",
|
||||
} as const
|
||||
|
||||
// Used in Action type below
|
||||
const _actionTypes = actionTypes
|
||||
|
||||
let count = 0
|
||||
|
||||
function genId() {
|
||||
@ -32,7 +35,7 @@ function genId() {
|
||||
return count.toString()
|
||||
}
|
||||
|
||||
type ActionType = typeof actionTypes
|
||||
type ActionType = typeof _actionTypes
|
||||
|
||||
type Action =
|
||||
| {
|
||||
|
||||
Reference in New Issue
Block a user