Skip to content

Commit

Permalink
Fix new lint errors surfaced by eslint@9
Browse files Browse the repository at this point in the history
  • Loading branch information
darthmaim committed Dec 6, 2024
1 parent 2870b98 commit c206782
Show file tree
Hide file tree
Showing 16 changed files with 6 additions and 18 deletions.
1 change: 0 additions & 1 deletion apps/web/app/[language]/achievement/[id]/component.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/no-array-index-key */
import type { Language } from '@gw2treasures/database';
import DetailLayout from '@/components/Layout/DetailLayout';
import { db } from '@/lib/prisma';
Expand Down
1 change: 0 additions & 1 deletion apps/web/app/[language]/homestead/decorations/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @next/next/no-img-element */
import { Trans } from '@/components/I18n/Trans';
import { createDataTable } from '@gw2treasures/ui/components/Table/DataTable';
import { db } from '@/lib/prisma';
Expand Down
1 change: 0 additions & 1 deletion apps/web/app/[language]/item/[id]/_edit-content/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { db } from '@/lib/prisma';
import { ContentChance, Prisma, ReviewState } from '@gw2treasures/database';
import { revalidateTag } from 'next/cache';

// eslint-disable-next-line require-await
export async function submitToReview({ itemId, removedItems, addedItems, removedCurrencies, addedCurrencies }: { itemId: number } & EditContentOrder): Promise<EditContentSubmitError | true> {
if(removedItems.length === 0 && addedItems.length === 0 && removedCurrencies.length === 0 && addedCurrencies.length === 0) {
console.log('No changes');
Expand Down
1 change: 0 additions & 1 deletion apps/web/app/[language]/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
};
}

// eslint-disable-next-line require-await
async function redirectToGw2Me(returnTo?: string, additionalScopes?: string) {
'use server';

Expand Down
1 change: 0 additions & 1 deletion apps/web/components/Gw2Api/Gw2ApiProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const Gw2ApiProvider: FC<Gw2ApiProviderProps> = ({ children }) => {
const router = useRouter();
const [hiddenAccounts, setHiddenAccounts] = useLocalStorageState<string[]>('accounts.hidden', []);

// eslint-disable-next-line require-await
const getAccounts = useCallback(async (requiredScopes: Scope[], optionalScopes: Scope[] = [], { includeHidden = false }: GetAccountsOptions = {}) => {
// always return [] during SSR
if(typeof window === 'undefined') {
Expand Down
1 change: 0 additions & 1 deletion apps/web/components/Gw2Api/reauthorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Scope, type AuthorizationUrlParams } from '@gw2me/client';
import { redirect } from 'next/navigation';
import 'server-only';

// eslint-disable-next-line require-await
export async function reauthorize(requiredScopes: Scope[], prompt?: AuthorizationUrlParams['prompt']) {

// build redirect url
Expand Down
1 change: 0 additions & 1 deletion apps/web/components/Layout/DetailLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const DetailLayout: FC<DetailLayoutProps> = async ({ title, icon, breadcrumb, ch
<TableOfContentContext>
<main className={[styles.main, className].filter(Boolean).join(' ')} style={color ? { '--hero-color': color } : undefined}>
<div className={infobox ? styles.headline : styles.headlineWithoutInfobox}>
{/* eslint-disable-next-line @next/next/no-img-element */}
{icon && typeof icon === 'object' && (isValidElement(icon) ? cloneElement(icon, { className: styles.icon }) : <EntityIcon icon={icon} size={48} className={styles.icon} type={iconType}/>)}
<h1 className={styles.title}>{title}</h1>
{breadcrumb && <div className={styles.breadcrumb}>{breadcrumb}</div>}
Expand Down
1 change: 0 additions & 1 deletion apps/web/components/Skill/SkillTooltip.client.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @next/next/no-img-element */
import type { FC } from 'react';
import styles from './SkillTooltip.module.css';
import { Separator } from '@gw2treasures/ui/components/Layout/Separator';
Expand Down
1 change: 0 additions & 1 deletion apps/worker/src/jobs/recipes/migrations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { Prisma } from '@gw2treasures/database';
import { toId } from '../helper/toId';
import { db } from '../../db';
Expand Down
1 change: 0 additions & 1 deletion apps/worker/src/jobs/skills/migrations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { Prisma } from '@gw2treasures/database';
import { LocalizedObject } from '../helper/types';
import { Skill } from '@gw2api/types/data/skill';
Expand Down
1 change: 0 additions & 1 deletion apps/worker/src/jobs/skins/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ interface MigratedSkin {

// eslint-disable-next-line require-await
export async function createMigrator() {
// eslint-disable-next-line require-await
return async function migrate({ de, en, es, fr }: LocalizedObject<Skin>, currentVersion = -1) {
const update: MigratedSkin = {
version: CURRENT_VERSION
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/components/Form/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ export type SwitchControlProps = {
| { type: 'radio', href?: never, replace?: never, scroll?: never, name: string, value: string }
);

export const Switch: FC<SwitchProps> & { Control: FC<SwitchControlProps> } = ({ children }) => {
export const Switch: FC<SwitchProps> & { Control: FC<SwitchControlProps> } = ({ children }: SwitchProps) => {
return (
<Composite className={styles.wrapper}>
{children}
</Composite>
);
};

Switch.Control = ({ children, active, type = 'button', href, clickAction, name, value, icon, tip, replace, scroll }) => {
Switch.Control = ({ children, active, type = 'button', href, clickAction, name, value, icon, tip, replace, scroll }: SwitchControlProps) => {
const Element = type === 'link' ? Link : type === 'radio' ? 'label' : 'button';

const element = (
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/components/Table/DataTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Table, type HeaderCellProps } from './Table';
import { Fragment, Suspense, type FC, type Key, type ReactElement, type ReactNode } from 'react';
import { Suspense, type FC, type Key, type ReactElement, type ReactNode } from 'react';
import 'server-only';
import { DataTableClient, DataTableClientCell, DataTableClientColumn, DataTableClientColumnSelection, DataTableClientRows } from './DataTable.client';
import { isDefined, isTruthy } from '@gw2treasures/helper/is';
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ export interface HeaderCellProps {
onSort?: () => void;
}

const Table: FC<TableProps> & { HeaderCell: FC<HeaderCellProps> } = ({ children, width = 'page' }) => (
const Table: FC<TableProps> & { HeaderCell: FC<HeaderCellProps> } = ({ children, width = 'page' }: TableProps) => (
<TableWrapper>
<table className={width === 'page' ? styles.table : styles.tableAuto}>
{children}
</table>
</TableWrapper>
);

Table.HeaderCell = function HeaderCell({ children, small = false, align, colSpan, sort, onSort }) {
Table.HeaderCell = function HeaderCell({ children, small = false, align, colSpan, sort, onSort }: HeaderCellProps) {
return (
<th className={small ? styles.small : undefined} align={align} colSpan={colSpan} aria-sort={sort === 'asc' ? 'ascending' : sort === 'desc' ? 'descending' : undefined}>
{sort ? (
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/components/Table/use-datatable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface DataTableProps<T> {
/** @deprecated Use DataTable instead */
export function useDataTable<T>(columns: DataTableColumn<T>[], rowKey: (row: T) => Key, groups?: (row: T) => { value: string, label: ReactNode }): FC<DataTableProps<T>> {
return memo(useMemo(() =>
function DataTable({ rows }) {
function DataTable({ rows }: DataTableProps<T>) {
const [sortBy, setSortBy] = useState<{ column: DataTableColumn<T>, reverse: boolean }>();

const sortedRows = useMemo(() => (sortBy?.column?.sort !== undefined)
Expand Down
1 change: 0 additions & 1 deletion packages/ui/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ declare module '*.module.css' {
export default classes;
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type * as CSS from 'csstype';

declare module 'csstype' {
Expand Down

0 comments on commit c206782

Please sign in to comment.