Skip to content

Commit 40018b1

Browse files
committed
style: 格式化代码
1 parent 1f60dfd commit 40018b1

11 files changed

Lines changed: 433 additions & 400 deletions

File tree

apps/docs/biome.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// SPDX-License-Identifier: MIT
44

55
{
6-
"$schema": "https://biomejs.dev/schemas/2.5.3/schema.json",
6+
"$schema": "https://biomejs.dev/schemas/2.5.4/schema.json",
77
"extends": "//",
88
"root": false,
99
"files": {

apps/docs/src/components/demo/illustrations/api.zh-Hans.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
"properties": [
66
{
77
"name": "gallery",
8-
"summary": "图片集\n\n\n'amico'\n\n",
9-
"type": "\"amico\" | \"undraw\" | undefined"
8+
"summary": "图片集\n\n",
9+
"remarks": "可用值包含以下可用项:\n-\n`amico`\n来自 [storyset](https://storyset.com/amico),图片比较大,统一的尺寸;\n-\n`undraw`\n来自 [undraw](https://undraw.co/illustrations),图片比较小,尺寸不统一;\n\n",
10+
"type": "\"amico\" | \"undraw\" | undefined",
11+
"def": "'amico'\n\n"
1012
},
1113
{
1214
"name": "text",

apps/docs/src/theme/demo/palettes.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function Palettes(props: { s: SchemeStore; c: Contrast; apca?: boolean })
1919
);
2020
}
2121

22-
function PaletteBlocks(props: { p: Palette; s: SchemeStore; c: Contrast, apca?: boolean }): JSX.Element {
22+
function PaletteBlocks(props: { p: Palette; s: SchemeStore; c: Contrast; apca?: boolean }): JSX.Element {
2323
const raw = props.s[0];
2424

2525
let baseRef: HTMLDivElement;
@@ -51,16 +51,24 @@ function PaletteBlocks(props: { p: Palette; s: SchemeStore; c: Contrast, apca?:
5151
setHighWCAG(Color.wcag(highS.getPropertyValue('background-color'), highS.getPropertyValue('color'), props.apca));
5252

5353
const disabledS = window.getComputedStyle(disabledRef);
54-
setDisabledWCAG(Color.wcag(disabledS.getPropertyValue('background-color'), disabledS.getPropertyValue('color'), props.apca));
54+
setDisabledWCAG(
55+
Color.wcag(disabledS.getPropertyValue('background-color'), disabledS.getPropertyValue('color'), props.apca),
56+
);
5557

5658
const focusedS = window.getComputedStyle(focusedRef);
57-
setFocusedWCAG(Color.wcag(focusedS.getPropertyValue('background-color'), focusedS.getPropertyValue('color'), props.apca));
59+
setFocusedWCAG(
60+
Color.wcag(focusedS.getPropertyValue('background-color'), focusedS.getPropertyValue('color'), props.apca),
61+
);
5862

5963
const activedS = window.getComputedStyle(activedRef);
60-
setActivedWCAG(Color.wcag(activedS.getPropertyValue('background-color'), activedS.getPropertyValue('color'), props.apca));
64+
setActivedWCAG(
65+
Color.wcag(activedS.getPropertyValue('background-color'), activedS.getPropertyValue('color'), props.apca),
66+
);
6167

6268
const selectedS = window.getComputedStyle(selectedRef);
63-
setSelectedWCAG(Color.wcag(selectedS.getPropertyValue('background-color'), selectedS.getPropertyValue('color'), props.apca));
69+
setSelectedWCAG(
70+
Color.wcag(selectedS.getPropertyValue('background-color'), selectedS.getPropertyValue('color'), props.apca),
71+
);
6472
});
6573

6674
return (

biome.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// SPDX-License-Identifier: MIT
44

55
{
6-
"$schema": "https://biomejs.dev/schemas/2.5.3/schema.json",
6+
"$schema": "https://biomejs.dev/schemas/2.5.4/schema.json",
77
"root": true,
88
"vcs": {
99
"enabled": true,

packages/admin/src/app/app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ export async function create(elementID: string, o: Options, router?: typeof Rout
2424
const routes: Array<RouteDefinition> = [
2525
{
2626
path: '/',
27-
component: props => <>{props.children}</>,
27+
component: (props: ParentProps) => <>{props.children}</>,
2828
children: [...opt.routes.public.routes, { path: '*', component: () => NotFound() }],
2929
},
3030
{
3131
path: '/',
32-
component: props => <Private>{props.children}</Private>,
32+
component: (props: ParentProps) => <Private>{props.children}</Private>,
3333

3434
// 所有的 404 都将会在 children 中匹配 *,如果是未登录,则在匹配之后跳转到登录页。
3535
children: [...opt.routes.private.routes, { path: '*', component: () => NotFound() }],

packages/core/src/errors/runtime.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
export class RuntimeError extends Error {
1212
constructor(message?: string) {
1313
super(message);
14-
this.name = 'RuntimeError'
14+
this.name = 'RuntimeError';
1515
}
1616
}
1717

@@ -24,7 +24,7 @@ export class RuntimeError extends Error {
2424
export class NetworkError extends RuntimeError {
2525
constructor(message?: string) {
2626
super(message);
27-
this.name = 'NetworkError'
27+
this.name = 'NetworkError';
2828
}
2929
}
3030

@@ -34,6 +34,6 @@ export class NetworkError extends RuntimeError {
3434
export class PermissionError extends RuntimeError {
3535
constructor(message?: string) {
3636
super(message);
37-
this.name = 'PermissionError'
37+
this.name = 'PermissionError';
3838
}
3939
}

packages/illustrations/src/common/props.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ export function buildStorySetProps(props: Props): JSX.SvgSVGAttributes<SVGSVGEle
3333

3434
export function buildUndrawProps(props: Props): JSX.SvgSVGAttributes<SVGSVGElement> {
3535
return {
36-
xmlns: "http://www.w3.org/2000/svg",
37-
role: "presentation",
36+
xmlns: 'http://www.w3.org/2000/svg',
37+
role: 'presentation',
3838
'aria-hidden': true,
3939
class: joinClass(props.palette, styles.illustration, props.class),
4040
style: props.style,
4141
ref: el => props.ref?.({ root: () => el }),
42-
}
42+
};
4343
}

packages/illustrations/src/undraw/500.tsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,27 @@ export default function UndrawError500(props: Props): JSX.Element {
1919
>
2020
<title>{props.text || l.t('_i.internalServerError')}</title>
2121
<g transform="translate(-600 -236.768)">
22-
<rect width="469" height="109" rx="8" transform="translate(729 734.232)" fill="var(--palette-3-fg-low)" opacity="0.299" />
22+
<rect
23+
width="469"
24+
height="109"
25+
rx="8"
26+
transform="translate(729 734.232)"
27+
fill="var(--palette-3-fg-low)"
28+
opacity=".3"
29+
/>
2330
<path
2431
d="M11.384,2.846a8.548,8.548,0,0,0-8.538,8.538V96.768a8.548,8.548,0,0,0,8.538,8.538h446.84a8.548,8.548,0,0,0,8.538-8.538V11.384a8.548,8.548,0,0,0-8.538-8.538H11.384m0-2.846h446.84a11.384,11.384,0,0,1,11.384,11.384V96.768a11.384,11.384,0,0,1-11.384,11.384H11.384A11.384,11.384,0,0,1,0,96.768V11.384A11.384,11.384,0,0,1,11.384,0Z"
2532
transform="translate(728.432 734.748)"
2633
fill="var(--palette-2-fg)"
2734
/>
28-
<rect width="469" height="108" rx="8" transform="translate(729 524.232)" fill="var(--palette-3-fg-low)" opacity="0.299" />
35+
<rect
36+
width="469"
37+
height="108"
38+
rx="8"
39+
transform="translate(729 524.232)"
40+
fill="var(--palette-3-fg-low)"
41+
opacity=".3"
42+
/>
2943
<path
3044
d="M11.384,2.846a8.548,8.548,0,0,0-8.538,8.538V96.768a8.548,8.548,0,0,0,8.538,8.538h446.84a8.548,8.548,0,0,0,8.538-8.538V11.384a8.548,8.548,0,0,0-8.538-8.538H11.384m0-2.846h446.84a11.384,11.384,0,0,1,11.384,11.384V96.768a11.384,11.384,0,0,1-11.384,11.384H11.384A11.384,11.384,0,0,1,0,96.768V11.384A11.384,11.384,0,0,1,11.384,0Z"
3145
transform="translate(728.432 524.136)"
@@ -81,7 +95,14 @@ export default function UndrawError500(props: Props): JSX.Element {
8195
fill="var(--palette-2-fg)"
8296
/>
8397
<g transform="translate(728.432 630.865)">
84-
<rect width="469" height="107" rx="8" transform="translate(0.569 0.367)" fill="var(--palette-3-fg-low)" opacity="0.299" />
98+
<rect
99+
width="469"
100+
height="107"
101+
rx="8"
102+
transform="translate(0.569 0.367)"
103+
fill="var(--palette-3-fg-low)"
104+
opacity=".3"
105+
/>
85106
<path
86107
d="M11.384,2.846a8.548,8.548,0,0,0-8.538,8.538V96.768a8.548,8.548,0,0,0,8.538,8.538h446.84a8.548,8.548,0,0,0,8.538-8.538V11.384a8.548,8.548,0,0,0-8.538-8.538H11.384m0-2.846h446.84a11.384,11.384,0,0,1,11.384,11.384V96.768a11.384,11.384,0,0,1-11.384,11.384H11.384A11.384,11.384,0,0,1,0,96.768V11.384A11.384,11.384,0,0,1,11.384,0Z"
87108
fill="var(--palette-2-fg)"

packages/themes/src/theme/scheme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const noVarPrefix = [
7474
'--surface',
7575

7676
'--palette-',
77-
'--default-transition-duration'
77+
'--default-transition-duration',
7878
] as const;
7979

8080
/**

0 commit comments

Comments
 (0)