From 20a5687ecd021b876fb48db1f0850d76449102e3 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 30 Aug 2024 15:21:02 +0800 Subject: [PATCH] chore: prettier code --- README.es-ES.md | 2 ++ mock/listTableList.ts | 2 +- package.json | 1 + src/app.tsx | 5 ++--- src/components/HeaderDropdown/index.tsx | 4 ++-- src/components/RightContent/index.tsx | 1 - src/components/index.ts | 2 +- src/pages/TableList/index.tsx | 1 - src/pages/User/Login/index.tsx | 6 +++--- src/pages/User/Login/login.test.tsx | 4 ++-- src/services/ant-design-pro/api.ts | 12 ++++++------ 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.es-ES.md b/README.es-ES.md index a2235612..72745aaf 100644 --- a/README.es-ES.md +++ b/README.es-ES.md @@ -87,6 +87,7 @@ Proporcionamos `pro-cli` para inicializar rápidamente la estructura del proyect npm i @ant-design/pro-cli -g pro create myapp ``` + Selecciona la versión de umi ``` @@ -95,6 +96,7 @@ Selecciona la versión de umi umi@3 ``` + > Si seleccionas la versión umi@4, los bloques completos aún no son compatibles. Si eliges umi@3, también puedes elegir la plantilla "pro". "Pro" es la plantilla básica, que solo proporciona el contenido básico de la operación del marco. "Complete" contiene todos los bloques, lo cual no es adecuado para el desarrollo secundario como una plantilla básica. diff --git a/mock/listTableList.ts b/mock/listTableList.ts index fa7af931..ef76e0f3 100644 --- a/mock/listTableList.ts +++ b/mock/listTableList.ts @@ -1,5 +1,5 @@ -import { Request, Response } from 'express'; import dayjs from 'dayjs'; +import { Request, Response } from 'express'; import { parse } from 'url'; // mock tableListDataSource diff --git a/package.json b/package.json index 15f81d99..aeb1bc87 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "6.0.0", "private": true, "description": "An out-of-box UI solution for enterprise applications", + "repository": "git@github.com:ant-design/ant-design-pro.git", "scripts": { "analyze": "cross-env ANALYZE=1 max build", "build": "max build", diff --git a/src/app.tsx b/src/app.tsx index 22fd9a9e..b4d2e221 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -1,4 +1,5 @@ -import { Footer, Question, SelectLang, AvatarDropdown, AvatarName } from '@/components'; +import { AvatarDropdown, AvatarName, Footer, Question, SelectLang } from '@/components'; +import { currentUser as queryCurrentUser } from '@/services/ant-design-pro/api'; import { LinkOutlined } from '@ant-design/icons'; import type { Settings as LayoutSettings } from '@ant-design/pro-components'; import { SettingDrawer } from '@ant-design/pro-components'; @@ -6,8 +7,6 @@ import type { RunTimeLayoutConfig } from '@umijs/max'; import { history, Link } from '@umijs/max'; import defaultSettings from '../config/defaultSettings'; import { errorConfig } from './requestErrorConfig'; -import { currentUser as queryCurrentUser } from '@/services/ant-design-pro/api'; -import React from 'react'; const isDev = process.env.NODE_ENV === 'development'; const loginPath = '/user/login'; diff --git a/src/components/HeaderDropdown/index.tsx b/src/components/HeaderDropdown/index.tsx index f89052d3..b01944ca 100644 --- a/src/components/HeaderDropdown/index.tsx +++ b/src/components/HeaderDropdown/index.tsx @@ -1,8 +1,8 @@ import { Dropdown } from 'antd'; -import type { DropDownProps } from 'antd/es/dropdown'; -import React from 'react'; import { createStyles } from 'antd-style'; +import type { DropDownProps } from 'antd/es/dropdown'; import classNames from 'classnames'; +import React from 'react'; const useStyles = createStyles(({ token }) => { return { diff --git a/src/components/RightContent/index.tsx b/src/components/RightContent/index.tsx index 20a78311..dce08aeb 100644 --- a/src/components/RightContent/index.tsx +++ b/src/components/RightContent/index.tsx @@ -1,6 +1,5 @@ import { QuestionCircleOutlined } from '@ant-design/icons'; import { SelectLang as UmiSelectLang } from '@umijs/max'; -import React from 'react'; export type SiderTheme = 'light' | 'dark'; diff --git a/src/components/index.ts b/src/components/index.ts index ca88a6d0..9c828925 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -9,4 +9,4 @@ import Footer from './Footer'; import { Question, SelectLang } from './RightContent'; import { AvatarDropdown, AvatarName } from './RightContent/AvatarDropdown'; -export { Footer, Question, SelectLang, AvatarDropdown, AvatarName }; +export { AvatarDropdown, AvatarName, Footer, Question, SelectLang }; diff --git a/src/pages/TableList/index.tsx b/src/pages/TableList/index.tsx index c2010072..14f526ac 100644 --- a/src/pages/TableList/index.tsx +++ b/src/pages/TableList/index.tsx @@ -116,7 +116,6 @@ const TableList: React.FC = () => { /> ), dataIndex: 'name', - tip: 'The rule name is the unique key', render: (dom, entity) => { return ( { return { diff --git a/src/pages/User/Login/login.test.tsx b/src/pages/User/Login/login.test.tsx index 18593f83..4ee313cf 100644 --- a/src/pages/User/Login/login.test.tsx +++ b/src/pages/User/Login/login.test.tsx @@ -1,6 +1,6 @@ -import { render, fireEvent, act } from '@testing-library/react'; +import { TestBrowser } from '@@/testBrowser'; +import { act, fireEvent, render } from '@testing-library/react'; import React from 'react'; -import { TestBrowser } from '@@/testBrowser'; // @ts-ignore import { startMock } from '@@/requestRecordMock'; diff --git a/src/services/ant-design-pro/api.ts b/src/services/ant-design-pro/api.ts index b42bdfcf..7f9d4a4f 100644 --- a/src/services/ant-design-pro/api.ts +++ b/src/services/ant-design-pro/api.ts @@ -64,10 +64,10 @@ export async function rule( export async function updateRule(options?: { [key: string]: any }) { return request('/api/rule', { method: 'POST', - data:{ + data: { method: 'update', ...(options || {}), - } + }, }); } @@ -75,10 +75,10 @@ export async function updateRule(options?: { [key: string]: any }) { export async function addRule(options?: { [key: string]: any }) { return request('/api/rule', { method: 'POST', - data:{ + data: { method: 'post', ...(options || {}), - } + }, }); } @@ -86,9 +86,9 @@ export async function addRule(options?: { [key: string]: any }) { export async function removeRule(options?: { [key: string]: any }) { return request>('/api/rule', { method: 'POST', - data:{ + data: { method: 'delete', ...(options || {}), - } + }, }); }