Skip to content

Commit 48047cc

Browse files
committed
Apply Prettier
1 parent 93dfee2 commit 48047cc

34 files changed

+530
-477
lines changed

examples/tanstack-start/app.config.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import { lingui } from "@lingui/vite-plugin";
2-
import { defineConfig } from '@tanstack/react-start/config'
3-
import tsConfigPaths from 'vite-tsconfig-paths'
1+
import { lingui } from "@lingui/vite-plugin"
2+
import { defineConfig } from "@tanstack/react-start/config"
3+
import tsConfigPaths from "vite-tsconfig-paths"
44

55
export default defineConfig({
66
tsr: {
7-
appDirectory: 'src',
7+
appDirectory: "src",
88
},
99
react: {
10-
babel: {
11-
plugins: ["@lingui/babel-plugin-lingui-macro"],
12-
},
13-
},
10+
babel: {
11+
plugins: ["@lingui/babel-plugin-lingui-macro"],
12+
},
13+
},
1414
vite: {
1515
plugins: [
1616
lingui(),
1717
tsConfigPaths({
18-
projects: ['./tsconfig.json'],
18+
projects: ["./tsconfig.json"],
1919
}),
2020
],
2121
},
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { defineConfig } from "@lingui/cli";
1+
import { defineConfig } from "@lingui/cli"
22

33
export default defineConfig({
4-
catalogs: [
5-
{
6-
include: ["src"],
7-
path: "<rootDir>/src/locales/{locale}/messages",
8-
},
9-
],
10-
locales: ["fr", "en"],
11-
sourceLocale: "en",
12-
});
4+
catalogs: [
5+
{
6+
include: ["src"],
7+
path: "<rootDir>/src/locales/{locale}/messages",
8+
},
9+
],
10+
locales: ["fr", "en"],
11+
sourceLocale: "en",
12+
})

examples/tanstack-start/src/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
22
createStartAPIHandler,
33
defaultAPIFileRouteHandler,
4-
} from '@tanstack/react-start/api'
4+
} from "@tanstack/react-start/api"
55

66
export default createStartAPIHandler(defaultAPIFileRouteHandler)

examples/tanstack-start/src/client.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/// <reference types="vinxi/types/client" />
2-
import { i18n } from "@lingui/core";
3-
import { hydrateRoot } from 'react-dom/client'
4-
import { StartClient } from '@tanstack/react-start'
5-
import { dynamicActivate } from "./modules/lingui/i18n";
2+
import { i18n } from "@lingui/core"
3+
import { hydrateRoot } from "react-dom/client"
4+
import { StartClient } from "@tanstack/react-start"
5+
import { dynamicActivate } from "./modules/lingui/i18n"
66

7-
import { createRouter } from './router'
7+
import { createRouter } from "./router"
88

99
// The lang should be set by the server
10-
dynamicActivate(document.documentElement.lang);
10+
dynamicActivate(document.documentElement.lang)
1111

1212
const router = createRouter({ i18n })
1313

examples/tanstack-start/src/components/DefaultCatchBoundary.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { Trans } from '@lingui/react/macro'
1+
import { Trans } from "@lingui/react/macro"
22
import {
33
ErrorComponent,
44
Link,
55
rootRouteId,
66
useMatch,
77
useRouter,
8-
} from '@tanstack/react-router'
9-
import type { ErrorComponentProps } from '@tanstack/react-router'
8+
} from "@tanstack/react-router"
9+
import type { ErrorComponentProps } from "@tanstack/react-router"
1010

1111
export function DefaultCatchBoundary({ error }: ErrorComponentProps) {
1212
const router = useRouter()
@@ -15,7 +15,7 @@ export function DefaultCatchBoundary({ error }: ErrorComponentProps) {
1515
select: (state) => state.id === rootRouteId,
1616
})
1717

18-
console.error('DefaultCatchBoundary Error:', error)
18+
console.error("DefaultCatchBoundary Error:", error)
1919

2020
return (
2121
<div className="min-w-0 flex-1 p-4 flex flex-col items-center justify-center gap-6">

examples/tanstack-start/src/components/NotFound.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
import { Trans } from '@lingui/react/macro'
2-
import { Link } from '@tanstack/react-router'
1+
import { Trans } from "@lingui/react/macro"
2+
import { Link } from "@tanstack/react-router"
33

44
export function NotFound({ children }: { children?: any }) {
55
return (
66
<div className="space-y-2 p-2">
77
<div className="text-gray-600 dark:text-gray-400">
8-
{children || <p><Trans>The page you are looking for does not exist.</Trans></p>}
8+
{children || (
9+
<p>
10+
<Trans>The page you are looking for does not exist.</Trans>
11+
</p>
12+
)}
913
</div>
1014
<p className="flex items-center gap-2 flex-wrap">
1115
<button

examples/tanstack-start/src/components/PostError.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ErrorComponent, ErrorComponentProps } from '@tanstack/react-router'
1+
import { ErrorComponent, ErrorComponentProps } from "@tanstack/react-router"
22

33
export function PostErrorComponent({ error }: ErrorComponentProps) {
44
return <ErrorComponent error={error} />

examples/tanstack-start/src/components/UserError.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ErrorComponent, ErrorComponentProps } from '@tanstack/react-router'
1+
import { ErrorComponent, ErrorComponentProps } from "@tanstack/react-router"
22

33
export function UserErrorComponent({ error }: ErrorComponentProps) {
44
return <ErrorComponent error={error} />

examples/tanstack-start/src/global-middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { registerGlobalMiddleware } from '@tanstack/react-start'
2-
import { logMiddleware } from './utils/loggingMiddleware'
1+
import { registerGlobalMiddleware } from "@tanstack/react-start"
2+
import { logMiddleware } from "./utils/loggingMiddleware"
33

44
registerGlobalMiddleware({
55
middleware: [logMiddleware],
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
import { i18n } from "@lingui/core";
1+
import { i18n } from "@lingui/core"
22

33
export const locales = {
4-
en: "English",
5-
fr: "French",
6-
};
4+
en: "English",
5+
fr: "French",
6+
}
77

8-
export const isLocaleValid = (locale: string) => Object.keys(locales).includes(locale);
8+
export const isLocaleValid = (locale: string) =>
9+
Object.keys(locales).includes(locale)
910

10-
export const defaultLocale = "en";
11+
export const defaultLocale = "en"
1112

1213
/**
1314
* We do a dynamic import of just the catalog that we need
1415
* @param locale any locale string
1516
*/
1617
export async function dynamicActivate(locale: string) {
17-
const { messages } = await import(`../../locales/${locale}/messages.po`);
18-
i18n.load(locale, messages);
19-
i18n.activate(locale);
18+
const { messages } = await import(`../../locales/${locale}/messages.po`)
19+
i18n.load(locale, messages)
20+
i18n.activate(locale)
2021
}

0 commit comments

Comments
 (0)