Skip to content

Commit

Permalink
Merge pull request #15 from ggindev/fix-eslint-errors
Browse files Browse the repository at this point in the history
Fix ESLint errors related to unused variables and explicit 'any' types
  • Loading branch information
ggindev authored Oct 20, 2024
2 parents 607bb33 + 2da5706 commit 27de8b7
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/app/api/domains/check-availability/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function POST(request: Request) {
try {
const isAvailable = await checkDomainAvailability(domain, provider);
results[domain] = isAvailable;
} catch (error) {
} catch {
results[domain] = false;
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/app/favorites/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use client';

import React, { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import Button from '../../components/Button';

const ERROR_FETCHING_FAVORITES = 'An error occurred while fetching favorites. Please try again.';
Expand All @@ -14,7 +13,6 @@ const FavoritesPage = () => {
const [page, setPage] = useState(1);
const [pageSize] = useState(10);
const [totalFavorites, setTotalFavorites] = useState(0);
const router = useRouter();

useEffect(() => {
const fetchFavorites = () => {
Expand Down
3 changes: 1 addition & 2 deletions src/components/DomainGeneratorForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const DomainGeneratorForm: React.FC = () => {
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState<string | null>(null);
const [availability, setAvailability] = useState<DomainAvailability>({});
const [favorites, setFavorites] = useState<string[]>([]);

const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const { name, value, type, checked } = e.target;
Expand Down Expand Up @@ -125,7 +124,7 @@ const DomainGeneratorForm: React.FC = () => {

const handlePageChange = (newPage: number) => {
setFormData(prev => ({ ...prev, page: newPage }));
handleSubmit(new Event('submit') as any);
handleSubmit(new Event('submit') as unknown as React.FormEvent);
};

const handleFavorite = async (domain: string) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function LoginForm() {
const data = await response.json();
setError(data.message || ERROR_LOGIN_FAILED);
}
} catch (err) {
} catch {
setError(ERROR_GENERIC);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function RegisterForm() {
const data = await response.json();
setError(data.message || ERROR_REGISTRATION_FAILED);
}
} catch (err) {
} catch {
setError(ERROR_GENERIC);
}
};
Expand Down
4 changes: 1 addition & 3 deletions src/services/domainGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export async function generateDomains(
includeNumbers: boolean,
includeHyphens: boolean,
page: number = 1,
pageSize: number = 10,
prefixes: string[] = [],
tlds: string[] = []
pageSize: number = 10
): Promise<DomainInfo[]> {
const characters = ALPHABET + (includeNumbers ? NUMBERS : '') + (includeHyphens ? '-' : '');
const totalLength = prefixLength + suffixLength;
Expand Down

0 comments on commit 27de8b7

Please sign in to comment.