Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
yossydev committed Feb 23, 2024
1 parent c53d1b3 commit f8ec74a
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 91 deletions.
42 changes: 21 additions & 21 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
parserOptions: {
parser: "@typescript-eslint/parser",
sourceType: "module",
ecmaVersion: 2019, // Node.js 12の場合は2019、他のバージョンのNode.jsを利用している場合は場合は適宜変更する
project: ["tsconfig.eslint.json"],
tsconfigRootDir: __dirname,
},
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
rules: {
"@typescript-eslint/no-floating-promises": "off",
},
root: true,
env: {
es6: true,
node: true,
},
parserOptions: {
parser: "@typescript-eslint/parser",
sourceType: "module",
ecmaVersion: 2019, // Node.js 12の場合は2019、他のバージョンのNode.jsを利用している場合は場合は適宜変更する
project: ["tsconfig.eslint.json"],
tsconfigRootDir: __dirname,
},
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
rules: {
"@typescript-eslint/no-floating-promises": "off",
},
};
22 changes: 11 additions & 11 deletions app/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import {} from "hono";

type Head = {
title?: string;
title?: string;
};

declare module "hono" {
interface Env {
Variables: {};
Bindings: {};
}
interface ContextRenderer {
(
content: string | Promise<string>,
head?: Head,
): Response | Promise<Response>;
}
interface Env {
Variables: {};
Bindings: {};
}
interface ContextRenderer {
(
content: string | Promise<string>,
head?: Head,
): Response | Promise<Response>;
}
}
16 changes: 8 additions & 8 deletions app/islands/counter.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useState } from 'hono/jsx'
import { useState } from "hono/jsx";

export default function Counter() {
const [count, setCount] = useState(0)
return (
<div>
<p>{count}</p>
<button onClick={() => setCount(count + 1)}>Increment</button>
</div>
)
const [count, setCount] = useState(0);
return (
<div>
<p>{count}</p>
<button onClick={() => setCount(count + 1)}>Increment</button>
</div>
);
}
32 changes: 16 additions & 16 deletions app/routes/_renderer.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { Style } from 'hono/css'
import { jsxRenderer } from 'hono/jsx-renderer'
import { Script } from 'honox/server'
import { Style } from "hono/css";
import { jsxRenderer } from "hono/jsx-renderer";
import { Script } from "honox/server";

export default jsxRenderer(({ children, title }) => {
return (
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{title}</title>
<Script src="/app/client.ts" async />
<Style />
</head>
<body>{children}</body>
</html>
)
})
return (
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{title}</title>
<Script src="/app/client.ts" async />
<Style />
</head>
<body>{children}</body>
</html>
);
});
16 changes: 8 additions & 8 deletions app/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { createRoute } from "honox/factory";
import Counter from "../islands/counter";

export default createRoute((c) => {
const name = c.req.query("name") ?? "Hono";
return c.render(
<div>
<h1 className="text-3xl font-bold underline">Hello world! {name}</h1>
<Counter />
</div>,
{ title: name },
);
const name = c.req.query("name") ?? "Hono";
return c.render(
<div>
<h1 className="text-3xl font-bold underline">Hello world! {name}</h1>
<Counter />
</div>,
{ title: name },
);
});
10 changes: 5 additions & 5 deletions app/server.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { showRoutes } from 'hono/dev'
import { createApp } from 'honox/server'
import { showRoutes } from "hono/dev";
import { createApp } from "honox/server";

const app = createApp()
const app = createApp();

showRoutes(app)
showRoutes(app);

export default app
export default app;
10 changes: 5 additions & 5 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
10 changes: 5 additions & 5 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ["./app/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
},
plugins: [],
content: ["./app/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
},
plugins: [],
};
6 changes: 3 additions & 3 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"include": ["./app/"],
"exclude": ["node_modules"]
"extends": "./tsconfig.json",
"include": ["./app/"],
"exclude": ["node_modules"]
}
18 changes: 9 additions & 9 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import client from "honox/vite/client";
import { defineConfig } from "vite";

export default defineConfig(({ mode }) => {
if (mode === "client") {
return {
plugins: [client()],
};
} else {
return {
plugins: [honox(), pages()],
};
}
if (mode === "client") {
return {
plugins: [client()],
};
} else {
return {
plugins: [honox(), pages()],
};
}
});

0 comments on commit f8ec74a

Please sign in to comment.