Skip to content

Commit 6edb817

Browse files
committed
Refactor: standardize quotes and clean up configuration files
- Updated all files to use single quotes for consistency. - Removed unnecessary ignore entries in biome.json. - Cleaned up imports and formatting across various components and pages. - Ensured uniformity in string handling and type definitions throughout the codebase.
1 parent 7ac1f9b commit 6edb817

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+552
-550
lines changed

biome.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"files": {
3-
"ignore": ["dist"]
4-
},
2+
"files": {},
53
"linter": {
64
"enabled": true,
75
"rules": {

rsbuild.config.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
import { defineConfig } from "@rsbuild/core";
2-
import { pluginReact } from "@rsbuild/plugin-react";
3-
import { pluginSass } from "@rsbuild/plugin-sass";
4-
import { pluginSvgr } from "@rsbuild/plugin-svgr";
1+
import { defineConfig } from '@rsbuild/core';
2+
import { pluginReact } from '@rsbuild/plugin-react';
3+
import { pluginSass } from '@rsbuild/plugin-sass';
4+
import { pluginSvgr } from '@rsbuild/plugin-svgr';
55

66
export default defineConfig({
77
html: {
8-
template: "./index.html",
9-
favicon: "./src/assets/favicon.svg",
8+
template: './index.html',
9+
favicon: './src/assets/favicon.svg',
1010
},
1111
source: {
1212
entry: {
13-
index: "./src/index.tsx",
13+
index: './src/index.tsx',
1414
},
1515
},
1616
plugins: [
1717
pluginReact(),
1818
pluginSass(),
1919
pluginSvgr({
2020
svgrOptions: {
21-
exportType: "named",
21+
exportType: 'named',
2222
},
2323
}),
2424
],

src/components/error-boundary.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Button, Result } from "antd";
2-
import { useEffect } from "react";
3-
import { useNavigate, useRouteError } from "react-router-dom";
1+
import { Button, Result } from 'antd';
2+
import { useEffect } from 'react';
3+
import { useNavigate, useRouteError } from 'react-router-dom';
44

55
interface ChunkError extends Error {
66
__webpack_chunkName?: string;
@@ -10,13 +10,13 @@ export function ErrorBoundary() {
1010
const error = useRouteError() as ChunkError;
1111
const navigate = useNavigate();
1212

13-
const message = error?.message || "";
13+
const message = error?.message || '';
1414

1515
const isChunkError =
1616
message &&
17-
(message.includes("Loading CSS chunk") ||
18-
message.includes("Loading chunk") ||
19-
message.includes("ChunkLoadError"));
17+
(message.includes('Loading CSS chunk') ||
18+
message.includes('Loading chunk') ||
19+
message.includes('ChunkLoadError'));
2020

2121
useEffect(() => {
2222
if (isChunkError) {
@@ -29,14 +29,14 @@ export function ErrorBoundary() {
2929
};
3030

3131
const handleGoHome = () => {
32-
navigate("/");
32+
navigate('/');
3333
};
3434

3535
return (
3636
<Result
3737
status="500"
3838
title="页面出错了"
39-
subTitle={message || "发生了未知错误"}
39+
subTitle={message || '发生了未知错误'}
4040
extra={
4141
<>
4242
<Button type="primary" onClick={handleRetry}>

src/components/footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Layout, Typography } from "antd";
1+
import { Layout, Typography } from 'antd';
22

33
const Footer = () => (
44
<Layout.Footer className="text-center">

src/components/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { ErrorBoundary } from "./error-boundary";
2-
export { default as Footer } from "./footer";
1+
export { ErrorBoundary } from './error-boundary';
2+
export { default as Footer } from './footer';

src/components/main-layout.tsx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import {
44
LogoutOutlined,
55
ReadOutlined,
66
UserOutlined,
7-
} from "@ant-design/icons";
8-
import { Layout, Menu, message, Row } from "antd";
9-
import type { ReactNode } from "react";
10-
import { Outlet } from "react-router-dom";
11-
import { logout } from "@/services/auth";
12-
import { useUserInfo } from "@/utils/hooks";
13-
import Footer from "./footer";
14-
import Sider from "./sider";
7+
} from '@ant-design/icons';
8+
import { Layout, Menu, message, Row } from 'antd';
9+
import type { ReactNode } from 'react';
10+
import { Outlet } from 'react-router-dom';
11+
import { logout } from '@/services/auth';
12+
import { useUserInfo } from '@/utils/hooks';
13+
import Footer from './footer';
14+
import Sider from './sider';
1515

1616
interface Style {
1717
header: React.CSSProperties;
@@ -32,7 +32,7 @@ const MainLayout = () => {
3232
selectable={false}
3333
items={[
3434
{
35-
key: "issues",
35+
key: 'issues',
3636
icon: <CommentOutlined />,
3737
label: (
3838
<ExtLink href="https://github.com/reactnativecn/react-native-pushy/issues">
@@ -41,7 +41,7 @@ const MainLayout = () => {
4141
),
4242
},
4343
{
44-
key: "document",
44+
key: 'document',
4545
icon: <ReadOutlined />,
4646
label: (
4747
<ExtLink href="https://pushy.reactnative.cn/docs/getting-started.html">
@@ -50,7 +50,7 @@ const MainLayout = () => {
5050
),
5151
},
5252
{
53-
key: "about",
53+
key: 'about',
5454
icon: <InfoCircleOutlined />,
5555
label: (
5656
<ExtLink href="https://reactnative.cn/about.html">
@@ -61,17 +61,17 @@ const MainLayout = () => {
6161
...(user
6262
? [
6363
{
64-
key: "user",
64+
key: 'user',
6565
icon: <UserOutlined />,
6666
label: user.name,
6767
children: [
6868
{
69-
key: "logout",
69+
key: 'logout',
7070
icon: <LogoutOutlined />,
71-
label: "退出登录",
71+
label: '退出登录',
7272
onClick: () => {
7373
logout();
74-
message.info("您已退出登录");
74+
message.info('您已退出登录');
7575
},
7676
},
7777
],
@@ -113,17 +113,17 @@ const ExtLink = ({ children, href }: ExtLinkProps) => (
113113

114114
const style: Style = {
115115
header: {
116-
background: "#fff",
116+
background: '#fff',
117117
height: 48,
118-
lineHeight: "46px",
119-
boxShadow: "2px 1px 4px rgba(0, 21, 41, 0.08)",
118+
lineHeight: '46px',
119+
boxShadow: '2px 1px 4px rgba(0, 21, 41, 0.08)',
120120
zIndex: 1,
121121
},
122122
body: {
123-
overflow: "auto",
124-
position: "relative",
125-
display: "flex",
126-
flexDirection: "column",
123+
overflow: 'auto',
124+
position: 'relative',
125+
display: 'flex',
126+
flexDirection: 'column',
127127
paddingBottom: 0,
128128
},
129129
};

src/components/platform-icon.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
import { cn } from "@/utils/helper";
21
import {
32
AndroidFilled,
43
AppleFilled,
54
HarmonyOSOutlined,
6-
} from "@ant-design/icons";
5+
} from '@ant-design/icons';
6+
import { cn } from '@/utils/helper';
77

88
export default function PlatformIcon({
99
platform,
1010
className,
1111
}: {
12-
platform?: "android" | "ios" | "harmony";
12+
platform?: 'android' | 'ios' | 'harmony';
1313
className?: string;
1414
}) {
1515
if (!platform) {
1616
return null;
1717
}
18-
if (platform === "android") {
19-
return <AndroidFilled className={cn("text-[#3ddc84]!", className)} />;
18+
if (platform === 'android') {
19+
return <AndroidFilled className={cn('text-[#3ddc84]!', className)} />;
2020
}
21-
if (platform === "ios") {
22-
return <AppleFilled className={cn("text-[#a6b1b7]!", className)} />;
21+
if (platform === 'ios') {
22+
return <AppleFilled className={cn('text-[#a6b1b7]!', className)} />;
2323
}
24-
return <HarmonyOSOutlined className={cn("text-[#a6b1b7]!", className)} />;
24+
return <HarmonyOSOutlined className={cn('text-[#a6b1b7]!', className)} />;
2525
}

0 commit comments

Comments
 (0)