Skip to content

Commit 6aca5c8

Browse files
Merge pull request #45 from authts/align-biome-config
align biome config
2 parents ff3076b + 6418332 commit 6aca5c8

20 files changed

+231
-69
lines changed

api/biome.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"extends": ["../biome.json"]
4+
}

api/biome.jsonc

Lines changed: 0 additions & 34 deletions
This file was deleted.

react/biome.jsonc renamed to biome.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
22
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
38
"files": {
4-
"ignore": ["dist"]
9+
"ignore": ["**/node_modules/**", "**/dist/**"]
510
},
611
"organizeImports": {
712
"enabled": true
@@ -14,7 +19,8 @@
1419
"noVoid": "off"
1520
},
1621
"correctness": {
17-
"noNodejsModules": "off"
22+
"noNodejsModules": "off",
23+
"noUndeclaredDependencies": "off"
1824
},
1925
"suspicious": {
2026
"noConsole": "off",
@@ -31,8 +37,13 @@
3137
"javascript": {
3238
"formatter": {
3339
"quoteStyle": "single",
34-
"trailingCommas": "none"
40+
"trailingCommas": "all"
3541
},
3642
"globals": ["React"]
43+
},
44+
"css": {
45+
"formatter": {
46+
"quoteStyle": "single"
47+
}
3748
}
3849
}

package-lock.json

Lines changed: 166 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"version": "1.10.0",
33
"scripts": {
4+
"check": "biome check --write .",
45
"toc": "markdown-toc -i README.md"
56
},
67
"devDependencies": {
8+
"@biomejs/biome": "^1.9.4",
79
"markdown-toc": "^1.2.0"
810
}
911
}

react/biome.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"extends": ["../biome.json"]
4+
}

react/src/components/Alert.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import type { FC } from 'react';
2+
13
interface AlertProps {
24
variant: 'success' | 'error';
35
children: React.ReactNode;
46
}
57

6-
export const Alert: React.FC<AlertProps> = (props) => {
8+
export const Alert: FC<AlertProps> = (props) => {
79
const { variant, children } = props;
810

911
let backgroundColor: string | undefined;

react/src/components/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import type { FC } from 'react';
12
import { Route, Routes } from 'react-router-dom';
23
import { appRoutes } from '../constants.ts';
34
import { Home } from './routes/Home.tsx';
45
import { NotFound } from './routes/NotFound.tsx';
56
import { Playground } from './routes/Playground/Playground.tsx';
67

7-
export const App: React.FC = () => {
8+
export const App: FC = () => {
89
return (
910
<Routes>
1011
<Route path={appRoutes.home}>

react/src/components/Layout.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import styled from '@emotion/styled';
2-
import type { ReactNode } from 'react';
2+
import type { FC, ReactNode } from 'react';
33
import { useAuth } from 'react-oidc-context';
44
import { useNavigate } from 'react-router-dom';
55
import { appRoutes } from '../constants.ts';
@@ -51,7 +51,7 @@ interface LayoutProps {
5151
children: ReactNode;
5252
}
5353

54-
export const Layout: React.FC<LayoutProps> = (props) => {
54+
export const Layout: FC<LayoutProps> = (props) => {
5555
const { children } = props;
5656
const auth = useAuth();
5757
const navigate = useNavigate();
@@ -62,22 +62,22 @@ export const Layout: React.FC<LayoutProps> = (props) => {
6262
protected: true,
6363
action: () => {
6464
navigate(appRoutes.home);
65-
}
65+
},
6666
},
6767
{
6868
text: 'Playground',
6969
protected: true,
7070
action: () => {
7171
navigate(appRoutes.playground);
72-
}
72+
},
7373
},
7474
{
7575
text: 'Logout',
7676
protected: false,
7777
action: () => {
7878
void auth.signoutRedirect();
79-
}
80-
}
79+
},
80+
},
8181
].filter((item) => {
8282
return auth.isAuthenticated || !item.protected;
8383
});

react/src/components/ProtectedApp.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useQuery } from '@tanstack/react-query';
2-
import { type ReactNode, useEffect, useState } from 'react';
2+
import { type FC, type ReactNode, useEffect, useState } from 'react';
33
import { hasAuthParams, useAuth } from 'react-oidc-context';
44
import { Alert } from './Alert.tsx';
55

@@ -11,7 +11,7 @@ const getMetadata = async (metadataUrl?: string) => {
1111
try {
1212
response = await fetch(metadataUrl, {
1313
mode: 'no-cors',
14-
headers: { accept: 'application/jwk-set+json, application/json' }
14+
headers: { accept: 'application/jwk-set+json, application/json' },
1515
});
1616
} catch {
1717
throw new Error(`Unable to fetch metadataUrl\n\n${metadataUrl}\n\nPlease confirm your auth server is up`);
@@ -26,13 +26,13 @@ interface ProtectedAppProps {
2626
children: ReactNode;
2727
}
2828

29-
export const ProtectedApp: React.FC<ProtectedAppProps> = (props) => {
29+
export const ProtectedApp: FC<ProtectedAppProps> = (props) => {
3030
const { children } = props;
3131

3232
const { isPending: metadataIsPending, error: metadataError } = useQuery({
3333
queryKey: ['getMetadata'],
3434
retry: false,
35-
queryFn: () => getMetadata(auth.settings.metadataUrl)
35+
queryFn: () => getMetadata(auth.settings.metadataUrl),
3636
});
3737

3838
const auth = useAuth();

0 commit comments

Comments
 (0)