Skip to content

Commit d722be2

Browse files
Add prettier script and run it
1 parent bc5e574 commit d722be2

File tree

6 files changed

+21
-34
lines changed

6 files changed

+21
-34
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"build": "tsc -b && vite build",
99
"lint": "eslint .",
1010
"preview": "vite preview",
11-
"typecheck": "react-router typegen && tsc"
11+
"typecheck": "react-router typegen && tsc",
12+
"format": "prettier --write './**/*.{js,jsx,ts,tsx}'"
1213
},
1314
"dependencies": {
1415
"@react-router/node": "^7.1.1",

src/catchall.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import App from './App';
1+
import App from "./App";
22

33
export default function Component() {
4-
return <App />;
5-
}
6-
4+
return <App />;
5+
}

src/entry.client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ ReactDOM.hydrateRoot(
77
document,
88
<React.StrictMode>
99
<HydratedRouter />
10-
</React.StrictMode>
10+
</React.StrictMode>,
1111
);

src/pages/about.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import { Link } from "react-router";
22

33
export async function clientLoader() {
4-
54
const response = await fetch("https://jsonplaceholder.typicode.com/todos/1");
6-
const data = await response.json() as { userId: number; id: number; title: string; completed: boolean };
5+
const data = (await response.json()) as {
6+
userId: number;
7+
id: number;
8+
title: string;
9+
completed: boolean;
10+
};
711
console.log(data);
812

913
return {

src/root.tsx

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
1-
import {
2-
Links,
3-
Meta,
4-
Outlet,
5-
Scripts,
6-
ScrollRestoration,
7-
} from "react-router";
1+
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "react-router";
82

9-
export function Layout({
10-
children,
11-
}: {
12-
children: React.ReactNode;
13-
}) {
3+
export function Layout({ children }: { children: React.ReactNode }) {
144
return (
155
<html lang="en">
166
<head>
177
<meta charSet="UTF-8" />
18-
<meta
19-
name="viewport"
20-
content="width=device-width, initial-scale=1.0"
21-
/>
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
229
<title>My App</title>
2310
<Meta />
2411
<Links />

src/routes.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
import {
2-
type RouteConfig,
3-
route,
4-
} from "@react-router/dev/routes";
5-
6-
export default [
7-
route("/about", "./pages/about.tsx"),
8-
route("*?", "catchall.tsx"),
9-
] satisfies RouteConfig;
10-
1+
import { type RouteConfig, route } from "@react-router/dev/routes";
2+
3+
export default [
4+
route("/about", "./pages/about.tsx"),
5+
route("*?", "catchall.tsx"),
6+
] satisfies RouteConfig;

0 commit comments

Comments
 (0)