Skip to content

Commit ac722a0

Browse files
committed
Reconfigure biome formatting
1 parent 52e9bb0 commit ac722a0

12 files changed

+202
-199
lines changed

biome.json

+18-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
{
2-
"linter": {
3-
"rules": {
4-
"style": {
5-
"noNonNullAssertion": "off"
6-
},
7-
"a11y": {
8-
"useKeyWithClickEvents": "off"
9-
},
10-
"correctness": {
11-
"useExhaustiveDependencies": "off"
12-
}
2+
"formatter": {
3+
"indentStyle": "space",
4+
"indentWidth": 2,
5+
"lineWidth": 120,
6+
"lineEnding": "lf"
7+
},
8+
"linter": {
9+
"rules": {
10+
"style": {
11+
"noNonNullAssertion": "off"
12+
},
13+
"a11y": {
14+
"useKeyWithClickEvents": "off"
15+
},
16+
"correctness": {
17+
"useExhaustiveDependencies": "off"
1318
}
1419
}
15-
}
20+
}
21+
}

eira/package.json

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
{
2-
"name": "eira",
3-
"private": true,
4-
"version": "0.0.1",
5-
"type": "module",
6-
"scripts": {
7-
"dev": "vite",
8-
"build": "tsc -b && vite build",
9-
"lint": "biome lint ./src",
10-
"preview": "vite preview"
11-
},
12-
"dependencies": {
13-
"glob": "^11.0.1",
14-
"react": "^19.1.0",
15-
"react-cookie": "^8.0.1",
16-
"react-dom": "^19.1.0",
17-
"wouter": "^3.6.0"
18-
},
19-
"devDependencies": {
20-
"@biomejs/biome": "1.9.4",
21-
"@types/node": "^22.14.0",
22-
"@types/react": "^19.1.0",
23-
"@types/react-dom": "^19.1.1",
24-
"@vitejs/plugin-react": "^4.3.4",
25-
"typescript": "5.8.3",
26-
"vite": "6.2.5",
27-
"vite-plugin-svgr": "4.3.0"
28-
}
2+
"name": "eira",
3+
"private": true,
4+
"version": "0.0.1",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc -b && vite build",
9+
"lint": "biome lint ./src",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"glob": "^11.0.1",
14+
"react": "^19.1.0",
15+
"react-cookie": "^8.0.1",
16+
"react-dom": "^19.1.0",
17+
"wouter": "^3.6.0"
18+
},
19+
"devDependencies": {
20+
"@biomejs/biome": "1.9.4",
21+
"@types/node": "^22.14.0",
22+
"@types/react": "^19.1.0",
23+
"@types/react-dom": "^19.1.1",
24+
"@vitejs/plugin-react": "^4.3.4",
25+
"typescript": "5.8.3",
26+
"vite": "6.2.5",
27+
"vite-plugin-svgr": "4.3.0"
28+
}
2929
}

eira/src/App.tsx

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import LoginPage from "./pages/login";
44
import { CookiesProvider } from "react-cookie";
55

66
function App() {
7-
return (
8-
<>
9-
<CookiesProvider>
10-
<Switch>
11-
<Route path="/" component={Index} />
12-
<Route path="/login" component={LoginPage} />
13-
</Switch>
14-
</CookiesProvider>
15-
</>
16-
);
7+
return (
8+
<>
9+
<CookiesProvider>
10+
<Switch>
11+
<Route path="/" component={Index} />
12+
<Route path="/login" component={LoginPage} />
13+
</Switch>
14+
</CookiesProvider>
15+
</>
16+
);
1717
}
1818

1919
export default App;

eira/src/main.css

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap");
22

33
:root {
4-
--primary-color: #1b1b1b;
5-
--primary-background: #fff;
4+
--primary-color: #1b1b1b;
5+
--primary-background: #fff;
66
}
77

88
body,
99
html {
10-
margin: 0;
11-
box-sizing: border-box;
10+
margin: 0;
11+
box-sizing: border-box;
1212
}
1313

1414
body {
15-
font-family: "Nunito Sans", sans-serif;
16-
font-optical-sizing: auto;
17-
font-weight: 500;
18-
font-style: normal;
19-
font-variation-settings: "wdth" 100, "YTLC" 500;
20-
color: var(--primary-color);
21-
background-color: var(--primary-background);
15+
font-family: "Nunito Sans", sans-serif;
16+
font-optical-sizing: auto;
17+
font-weight: 500;
18+
font-style: normal;
19+
font-variation-settings: "wdth" 100, "YTLC" 500;
20+
color: var(--primary-color);
21+
background-color: var(--primary-background);
2222
}

eira/src/main.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import App from "./App.tsx";
44
import React from "react";
55

66
createRoot(document.getElementById("root")!).render(
7-
<React.StrictMode>
8-
<App />
9-
</React.StrictMode>,
7+
<React.StrictMode>
8+
<App />
9+
</React.StrictMode>,
1010
);

eira/src/pages/index.tsx

+36-36
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,42 @@ import "./index.css";
55
import { useCookies } from "react-cookie";
66

77
function Index() {
8-
const [user, setUser] = useState<UserDataT>();
9-
const [, navigate] = useLocation();
10-
const [cookies, , removeCookie] = useCookies(["session"]);
11-
12-
async function fetchUser() {
13-
let resp: Response;
14-
15-
if (!cookies.session) {
16-
return navigate("/login");
17-
}
18-
19-
try {
20-
resp = await fetch("/users/@me", { credentials: "include" });
21-
} catch (error) {
22-
console.error(error);
23-
return navigate("/login");
24-
}
25-
26-
if (!resp.ok) {
27-
throw new Error(`Unable to fetch user data from API: ${resp.status}`);
28-
}
29-
30-
const data: UserDataT = await resp.json();
31-
if (!data) {
32-
removeCookie("session", cookies.session);
33-
return navigate("/login");
34-
}
35-
36-
setUser(data);
37-
}
38-
39-
useEffect(() => {
40-
fetchUser();
41-
}, []);
42-
43-
return <>{user?.name}</>;
8+
const [user, setUser] = useState<UserDataT>();
9+
const [, navigate] = useLocation();
10+
const [cookies, , removeCookie] = useCookies(["session"]);
11+
12+
async function fetchUser() {
13+
let resp: Response;
14+
15+
if (!cookies.session) {
16+
return navigate("/login");
17+
}
18+
19+
try {
20+
resp = await fetch("/users/@me", { credentials: "include" });
21+
} catch (error) {
22+
console.error(error);
23+
return navigate("/login");
24+
}
25+
26+
if (!resp.ok) {
27+
throw new Error(`Unable to fetch user data from API: ${resp.status}`);
28+
}
29+
30+
const data: UserDataT = await resp.json();
31+
if (!data) {
32+
removeCookie("session", cookies.session);
33+
return navigate("/login");
34+
}
35+
36+
setUser(data);
37+
}
38+
39+
useEffect(() => {
40+
fetchUser();
41+
}, []);
42+
43+
return <>{user?.name}</>;
4444
}
4545

4646
export default Index;

eira/src/pages/login.tsx

+27-27
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,41 @@ import { useLocation } from "wouter";
44
import { useCookies } from "react-cookie";
55

66
function LoginPage() {
7-
const [, navigate] = useLocation();
8-
const [cookies, , removeCookie] = useCookies(["session"]);
7+
const [, navigate] = useLocation();
8+
const [cookies, , removeCookie] = useCookies(["session"]);
99

10-
async function fetchUser() {
11-
let resp: Response;
10+
async function fetchUser() {
11+
let resp: Response;
1212

13-
if (!cookies.session) {
14-
return;
15-
}
13+
if (!cookies.session) {
14+
return;
15+
}
1616

17-
try {
18-
resp = await fetch("/users/@me", { credentials: "include" });
19-
} catch (error) {
20-
console.error(error);
21-
return;
22-
}
17+
try {
18+
resp = await fetch("/users/@me", { credentials: "include" });
19+
} catch (error) {
20+
console.error(error);
21+
return;
22+
}
2323

24-
if (!resp.ok) {
25-
throw new Error(`Unable to fetch user data from API: ${resp.status}`);
26-
}
24+
if (!resp.ok) {
25+
throw new Error(`Unable to fetch user data from API: ${resp.status}`);
26+
}
2727

28-
const data: UserDataT = await resp.json();
29-
if (!data) {
30-
removeCookie("session", cookies.session);
31-
return;
32-
}
28+
const data: UserDataT = await resp.json();
29+
if (!data) {
30+
removeCookie("session", cookies.session);
31+
return;
32+
}
3333

34-
return navigate("/");
35-
}
34+
return navigate("/");
35+
}
3636

37-
useEffect(() => {
38-
fetchUser();
39-
}, []);
37+
useEffect(() => {
38+
fetchUser();
39+
}, []);
4040

41-
return <>Login</>;
41+
return <>Login</>;
4242
}
4343

4444
export default LoginPage;

eira/src/types/responses.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
export interface ApplicationDataT {
2-
application_id: string;
3-
client_id: string;
4-
application_name: string;
5-
scopes: string;
6-
bot_scopes: string;
7-
auths: number;
8-
allowed: string | null;
2+
application_id: string;
3+
client_id: string;
4+
application_name: string;
5+
scopes: string;
6+
bot_scopes: string;
7+
auths: number;
8+
allowed: string | null;
99
}
1010

1111
export interface UserDataT {
12-
id: number;
13-
twitch_id: number;
14-
name: string;
15-
token: string | null;
16-
applications: ApplicationDataT[];
12+
id: number;
13+
twitch_id: number;
14+
name: string;
15+
token: string | null;
16+
applications: ApplicationDataT[];
1717
}

eira/tsconfig.app.json

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"compilerOptions": {
3-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4-
"target": "ES2020",
5-
"useDefineForClassFields": true,
6-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
7-
"module": "ESNext",
8-
"skipLibCheck": true,
2+
"compilerOptions": {
3+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4+
"target": "ES2020",
5+
"useDefineForClassFields": true,
6+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
7+
"module": "ESNext",
8+
"skipLibCheck": true,
99

10-
/* Bundler mode */
11-
"moduleResolution": "bundler",
12-
"allowImportingTsExtensions": true,
13-
"isolatedModules": true,
14-
"moduleDetection": "force",
15-
"noEmit": true,
16-
"jsx": "react-jsx",
10+
/* Bundler mode */
11+
"moduleResolution": "bundler",
12+
"allowImportingTsExtensions": true,
13+
"isolatedModules": true,
14+
"moduleDetection": "force",
15+
"noEmit": true,
16+
"jsx": "react-jsx",
1717

18-
/* Linting */
19-
"strict": true,
20-
"noUnusedLocals": true,
21-
"noUnusedParameters": true,
22-
"noFallthroughCasesInSwitch": true,
23-
"noUncheckedSideEffectImports": true
24-
},
25-
"include": ["src"]
18+
/* Linting */
19+
"strict": true,
20+
"noUnusedLocals": true,
21+
"noUnusedParameters": true,
22+
"noFallthroughCasesInSwitch": true,
23+
"noUncheckedSideEffectImports": true
24+
},
25+
"include": ["src"]
2626
}

0 commit comments

Comments
 (0)