Skip to content

Commit a5c290b

Browse files
Bump ESLint and fix issues
1 parent 1467374 commit a5c290b

27 files changed

+252
-149
lines changed

.eslintrc.cjs

-86
This file was deleted.

app/@types/global.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Namespace } from 'i18next';
1+
import type { Namespace } from 'i18next';
22

33
declare global {
44
/**
@@ -20,6 +20,6 @@ declare global {
2020
* Client-side environment variables accessible through `window.env`.
2121
*/
2222
interface Window {
23-
env: Record<string, string | undefined>;
23+
env: Record<string, string | undefined> | undefined;
2424
}
2525
}

app/@types/i18next.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import 'i18next';
22

3+
/* eslint-disable @typescript-eslint/consistent-type-imports */
4+
35
declare module 'i18next' {
46
/**
57
* Enables IntelliSense for i18n keys by defining the

app/components/app-link.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import * as React from 'react';
22

3-
import { generatePath, Link, Params, Path } from '@remix-run/react';
3+
import type { Params, Path } from '@remix-run/react';
4+
import { generatePath, Link } from '@remix-run/react';
45
import invariant from 'tiny-invariant';
56

67
import { useCurrentLanguage } from '~/hooks/use-current-language';
78
import { useI18nPath } from '~/hooks/use-i18n-path';
8-
import { Language } from '~/modules/i18n';
9+
import type { Language } from '~/modules/i18n';
910
import { cn } from '~/modules/utils';
10-
import { PageRouteId } from '~/routes';
11+
import type { PageRouteId } from '~/routes';
1112

1213
/**
1314
* The Remix <Link> props.

app/components/ui/button.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import * as React from 'react';
22

33
import { Slot } from '@radix-ui/react-slot';
4-
import { cva, type VariantProps } from 'class-variance-authority';
4+
import type { VariantProps } from 'class-variance-authority';
5+
import { cva } from 'class-variance-authority';
56

67
import { cn } from '~/modules/utils';
78

app/entry.client.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ async function hydrate() {
2626
});
2727
}
2828

29+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
2930
if (window.requestIdleCallback) {
3031
window.requestIdleCallback(hydrate);
3132
} else {

app/entry.server.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export default async function handleRequest(
6161
reject(error);
6262
},
6363
onError(error: unknown) {
64+
// eslint-disable-next-line no-param-reassign
6465
responseStatusCode = 500;
6566
// Log streaming rendering errors from inside the shell. Don't log
6667
// errors encountered during initial shell rendering since they'll

app/hooks/use-current-language.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useLocation } from '@remix-run/react';
22

33
import { getLanguage } from '~/modules/i18n';
4-
import { Language } from '~/routes';
4+
import type { Language } from '~/routes';
55

66
/**
77
* Returns the current language based on the pathname.

app/hooks/use-current-route-id.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useMatches } from '@remix-run/react';
22
import invariant from 'tiny-invariant';
33

4-
import { isRouteId, RouteId } from '~/routes';
4+
import type { RouteId } from '~/routes';
5+
import { isRouteId } from '~/routes';
56

67
/**
78
* Returns the id of the current route.

app/hooks/use-i18n-path.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import invariant from 'tiny-invariant';
22

3-
import { Language } from '~/modules/i18n';
3+
import type { Language } from '~/modules/i18n';
44
import { findRouteById } from '~/routes';
55

66
/**

app/modules/i18n.client.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
* relevant in a client-side context.
66
*/
77

8-
/* eslint-disable import/no-named-as-default-member */
9-
10-
import { UNSAFE_RouteModules as RouteModules } from '@remix-run/react';
11-
import i18next, { LanguageDetectorModule } from 'i18next';
8+
import type { UNSAFE_RouteModules as RouteModules } from '@remix-run/react';
9+
import type { LanguageDetectorModule } from 'i18next';
10+
import i18next from 'i18next';
1211
import I18NextHttpBackend from 'i18next-http-backend';
1312
import { initReactI18next } from 'react-i18next';
1413

app/modules/i18n.server.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
* - Providing a consistent i18n context for server-side rendering
99
*/
1010

11-
import { UNSAFE_RouteModules as RouteModules } from '@remix-run/react';
12-
import { createInstance as createI18NextInstance, Namespace } from 'i18next';
11+
import type { UNSAFE_RouteModules as RouteModules } from '@remix-run/react';
12+
import type { Namespace } from 'i18next';
13+
import { createInstance as createI18NextInstance } from 'i18next';
1314
import I18NexFsBackend from 'i18next-fs-backend';
1415
import { resolve } from 'node:path';
1516
import { initReactI18next } from 'react-i18next';
1617

17-
import { getI18nNamespaces, getLanguage, Language } from '~/modules/i18n';
18+
import type { Language } from '~/modules/i18n';
19+
import { getI18nNamespaces, getLanguage } from '~/modules/i18n';
1820

1921
// set to true to enable server-side i18next debug logging
2022
// ex: DEBUG_I18N_SERVER=true npm run dev

app/modules/i18n.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
* all contexts.
1010
*/
1111

12-
import { UNSAFE_RouteModules as RouteModules } from '@remix-run/react';
13-
import { Namespace } from 'i18next';
12+
import type { UNSAFE_RouteModules as RouteModules } from '@remix-run/react';
13+
import type { Namespace } from 'i18next';
1414

1515
import { isRouteHandle } from '~/modules/utils';
16-
import { Language, languages } from '~/routes';
16+
import type { Language } from '~/routes';
17+
import { languages } from '~/routes';
1718

1819
// re-export the languages from the routes modules
1920
export { languages, type Language };

app/modules/utils.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { clsx, type ClassValue } from 'clsx';
1+
import type { ClassValue } from 'clsx';
2+
import { clsx } from 'clsx';
23
import { twMerge } from 'tailwind-merge';
34

45
/**

app/root.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LoaderFunctionArgs, SerializeFrom } from '@remix-run/node';
1+
import type { LoaderFunctionArgs, SerializeFrom } from '@remix-run/node';
22
import {
33
isRouteErrorResponse,
44
Links,
@@ -23,7 +23,7 @@ export const handle = {
2323
i18nNamespaces: ['common'],
2424
} satisfies RouteHandle;
2525

26-
export async function loader({ request }: LoaderFunctionArgs) {
26+
export function loader({ request }: LoaderFunctionArgs) {
2727
const language = getLanguage(new URL(request.url).pathname);
2828

2929
return {

app/routes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* build errors.
88
*/
99

10-
import { DefineRoutesFunction } from '@remix-run/dev/dist/config/routes';
10+
import type { DefineRoutesFunction } from '@remix-run/dev/dist/config/routes';
1111

1212
/**
1313
* All languages supported by the i18n routing.

app/routes/developers/view-developer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LoaderFunctionArgs } from '@remix-run/node';
1+
import type { LoaderFunctionArgs } from '@remix-run/node';
22
import { json, useLoaderData } from '@remix-run/react';
33
import { useTranslation } from 'react-i18next';
44

0 commit comments

Comments
 (0)