Skip to content

Commit

Permalink
style(projects): optimized code style
Browse files Browse the repository at this point in the history
  • Loading branch information
mufeng889 committed Aug 24, 2024
1 parent 48cd07e commit f5fed34
Show file tree
Hide file tree
Showing 26 changed files with 24 additions and 187 deletions.
3 changes: 3 additions & 0 deletions build/optimize/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const include = ['ahooks', 'echarts', 'i18next', 'lodash', 'immer', 'react-i18next'];

export { include };
7 changes: 1 addition & 6 deletions build/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { PluginOption } from 'vite';
import react from '@vitejs/plugin-react';
import Inspect from 'vite-plugin-inspect';
import removeConsole from 'vite-plugin-remove-console';
import checker from 'vite-plugin-checker';
import { setupAutoImport } from './auto-import';
import { setupUnocss } from './unocss';
import { setupUnPluginIcon } from './unplugin-icon';
Expand All @@ -16,11 +15,7 @@ export function setupVitePlugins(viteEnv: Env.ImportMeta) {
...setupUnPluginIcon(viteEnv),
setupElegantRouter(),
Inspect(),
removeConsole(),
checker({
typescript: true
})
removeConsole()
];

return plugins;
}
3 changes: 2 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export default defineConfig(
prettierRules: {
singleAttributePerLine: true,
trailingCommas: 'none'
}
},
ignores: ['/src/layouts/modules/global-tab/index.tsx']
},
{
rules: {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
"unplugin-auto-import": "0.18.2",
"unplugin-icons": "0.19.2",
"vite": "5.4.0",
"vite-plugin-checker": "^0.7.2",
"vite-plugin-inspect": "0.8.5",
"vite-plugin-remove-console": "2.2.0",
"vite-plugin-svg-icons": "2.0.1"
Expand Down
4 changes: 1 addition & 3 deletions packages/color/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
},
"typesVersions": {
"*": {
"*": [
"./src/*"
]
"*": ["./src/*"]
}
},
"dependencies": {
Expand Down
4 changes: 1 addition & 3 deletions packages/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
},
"typesVersions": {
"*": {
"*": [
"./src/*"
]
"*": ["./src/*"]
}
},
"dependencies": {
Expand Down
4 changes: 1 addition & 3 deletions packages/materials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
},
"typesVersions": {
"*": {
"*": [
"./src/*"
]
"*": ["./src/*"]
}
},
"dependencies": {
Expand Down
2 changes: 0 additions & 2 deletions packages/materials/src/libs/page-tab/ButtonTab.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';
import classNames from 'classnames';
import type { ButtonTabProps } from '../../types';

import styles from './index.module.css';

const ButtonTab = ({ darkMode, active, prefix, suffix, children, className, style, ...rest }: ButtonTabProps) => {
Expand Down
1 change: 0 additions & 1 deletion packages/materials/src/libs/page-tab/ChromeTab.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import classNames from 'classnames';
import type { ButtonTabProps } from '../../types';
import styles from './index.module.css';
Expand Down
2 changes: 1 addition & 1 deletion packages/materials/src/libs/page-tab/ChromeTabBg.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { memo } from 'react';
import { memo } from 'react';

// eslint-disable-next-line react/display-name
const ChromeTabBg = memo(() => {
Expand Down
4 changes: 1 addition & 3 deletions packages/ofetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
},
"typesVersions": {
"*": {
"*": [
"./src/*"
]
"*": ["./src/*"]
}
},
"dependencies": {
Expand Down
4 changes: 1 addition & 3 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
},
"typesVersions": {
"*": {
"*": [
"./src/*"
]
"*": ["./src/*"]
}
},
"devDependencies": {
Expand Down
4 changes: 1 addition & 3 deletions packages/simple-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
},
"typesVersions": {
"*": {
"*": [
"./src/*"
]
"*": ["./src/*"]
}
}
}
4 changes: 1 addition & 3 deletions packages/uno-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
},
"typesVersions": {
"*": {
"*": [
"./src/*"
]
"*": ["./src/*"]
}
}
}
4 changes: 1 addition & 3 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
},
"typesVersions": {
"*": {
"*": [
"./src/*"
]
"*": ["./src/*"]
}
},
"dependencies": {
Expand Down
126 changes: 0 additions & 126 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/hooks/common/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function useFormRules() {
}

/** create a rule for confirming the password */
function createConfirmPwdRule(from: FormInstance<{ password: string }>) {
function createConfirmPwdRule(from: FormInstance) {
const confirmPwdRule: App.Global.FormRule[] = [
{ required: true, message: $t('form.confirmPwd.required') },
{
Expand Down
1 change: 1 addition & 0 deletions src/layouts/modules/global-tab/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
import ClassNames from 'classnames';
import type BScroll from '@better-scroll/core';
import { PageTab } from '@sa/materials';
Expand Down
6 changes: 1 addition & 5 deletions src/pages/function/toggle-auth/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ export function Component() {

const userInfo = useAppSelector(selectUserInfo);


const { hasAuth } = useAuth();
const { toLogin } = useLogin();
const { loading, startLoading, endLoading } = useLoading();

const dispatch = useAppDispatch();


const [loginAccount, setLoginAccount] = useState<AccountKey>('super');

const accounts: Account[] = [
Expand Down Expand Up @@ -90,9 +88,7 @@ export function Component() {

startLoading();



router.resetRoute()
router.resetRoute();

await toLogin({ userName: account.userName, password: account.password }, false);

Expand Down
1 change: 1 addition & 0 deletions src/pages/login/reset-pwd/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Button, Form, Input, Space } from 'antd';

interface FormModel {
phone: string;
code: string;
Expand Down
Loading

0 comments on commit f5fed34

Please sign in to comment.