Skip to content

Commit 6bdc10f

Browse files
committed
refactor: 初步修复所有代码质量问题
1 parent d66ad9d commit 6bdc10f

File tree

65 files changed

+1243
-900
lines changed

Some content is hidden

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

65 files changed

+1243
-900
lines changed

LINT_ERROR.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
AN@DESKTOP-IKPTNP9 MINGW64 /c/Projects/OFlow/oflow-interface (main)
2+
$ bun run lint
3+
$ eslint --fix .
4+
5+
oflow-interface\LINT_ERROR.md
6+
282:37 error Label reference 'key' not found markdown/no-missing-label-refs
7+
288:37 error Label reference 'path[i' not found markdown/no-missing-label-refs
8+
289:37 error Label reference 'path[path.length - 1' not found markdown/no-missing-label-refs
9+
10+
oflow-interface\src\api\service\main\file\local\accept-mime.ts
11+
6:8 error ES2015 module syntax is preferred over namespaces @typescript-eslint/no-namespace
12+
163:9 error 'unknown' overrides all other types in this union type @typescript-eslint/no-redundant-type-constituents
13+
14+
oflow-interface\src\api\service\target\attribute\t-attributes-service-api.ts
15+
19:7 error Type parameter T is used only once in the function signature @typescript-eslint/no-unnecessary-type-parameters
16+
17+
oflow-interface\src\api\service\target\step\t-step-service-api.ts
18+
19:7 error Type parameter T is used only once in the function signature @typescript-eslint/no-unnecessary-type-parameters
19+
20+
oflow-interface\src\index.ts
21+
93:8 warning Using exported name 'AcceptMime' as identifier for default export import-x/no-named-as-default
22+
23+
oflow-interface\src\utils\crypto-utils.ts
24+
1:1 error ES2015 module syntax is preferred over namespaces @typescript-eslint/no-namespace
25+
26+
oflow-interface\src\utils\data-utils.ts
27+
5:1 error ES2015 module syntax is preferred over namespaces @typescript-eslint/no-namespace
28+
29+
oflow-interface\src\utils\file-utils.ts
30+
3:1 error ES2015 module syntax is preferred over namespaces @typescript-eslint/no-namespace
31+
32+
oflow-interface\src\utils\math-utils.ts
33+
1:1 error ES2015 module syntax is preferred over namespaces @typescript-eslint/no-namespace
34+
35+
oflow-interface\src\utils\native-event-utils.ts
36+
14:1 error ES2015 module syntax is preferred over namespaces @typescript-eslint/no-namespace
37+
38+
oflow-interface\src\utils\network-utils.ts
39+
1:1 error ES2015 module syntax is preferred over namespaces @typescript-eslint/no-namespace
40+
41+
oflow-interface\src\utils\number-utils.ts
42+
1:1 error ES2015 module syntax is preferred over namespaces @typescript-eslint/no-namespace
43+
44+
oflow-interface\src\utils\page-utils.ts
45+
3:1 error ES2015 module syntax is preferred over namespaces @typescript-eslint/no-namespace
46+
47+
oflow-interface\src\utils\rv-utils.ts
48+
3:1 error ES2015 module syntax is preferred over namespaces @typescript-eslint/no-namespace
49+
35:31 error Type parameter T is used only once in the function signature @typescript-eslint/no-unnecessary-type-parameters
50+
47:31 error Type parameter T is used only once in the function signature @typescript-eslint/no-unnecessary-type-parameters
51+
52+
oflow-interface\src\utils\throttle-utils.ts
53+
27:5 error Unsafe assignment of an `any` value @typescript-eslint/no-unsafe-assignment
54+
55+
oflow-interface\src\utils\time-utils.ts
56+
1:1 error ES2015 module syntax is preferred over namespaces @typescript-eslint/no-namespace
57+
58+
oflow-interface\src\utils\url-utils.ts
59+
4:1 error ES2015 module syntax is preferred over namespaces @typescript-eslint/no-namespace
60+
61+
oflow-interface\src\utils\vector-utils.ts
62+
7:1 error ES2015 module syntax is preferred over namespaces @typescript-eslint/no-namespace
63+
64+
✖ 23 problems (22 errors, 1 warning)

eslint.config.ts

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -39,50 +39,50 @@ const tsFile = '*.{cts,ts,tsx,mts,mtsx}'
3939

4040
const tsConfig = ENABLE_TYPE_CHECKED
4141
? [
42-
{
43-
files: [`**/${scriptFile}`],
44-
languageOptions: {
45-
parserOptions: {
46-
projectService: true,
47-
tsconfigRootDir: __dirname,
42+
{
43+
files: [`**/${scriptFile}`],
44+
languageOptions: {
45+
parserOptions: {
46+
projectService: true,
47+
tsconfigRootDir: __dirname,
48+
},
4849
},
4950
},
50-
},
51-
{
52-
...tseslint.configs.strictTypeChecked[0],
53-
files: [`**/${scriptFile}`],
54-
},
55-
{
56-
...tseslint.configs.strictTypeChecked[1],
57-
files: [`**/${tsFile}`],
58-
},
59-
{
60-
...tseslint.configs.strictTypeChecked[2],
61-
files: [`**/${scriptFile}`],
62-
},
63-
{
64-
...tseslint.configs.stylisticTypeChecked[2],
65-
files: [`**/${scriptFile}`],
66-
},
67-
]
51+
{
52+
...tseslint.configs.strictTypeChecked[0],
53+
files: [`**/${scriptFile}`],
54+
},
55+
{
56+
...tseslint.configs.strictTypeChecked[1],
57+
files: [`**/${tsFile}`],
58+
},
59+
{
60+
...tseslint.configs.strictTypeChecked[2],
61+
files: [`**/${scriptFile}`],
62+
},
63+
{
64+
...tseslint.configs.stylisticTypeChecked[2],
65+
files: [`**/${scriptFile}`],
66+
},
67+
]
6868
: [
69-
{
70-
...tseslint.configs.strict[0],
71-
files: [`**/${scriptFile}`],
72-
},
73-
{
74-
...tseslint.configs.strict[1],
75-
files: [`**/${tsFile}`],
76-
},
77-
{
78-
...tseslint.configs.strict[2],
79-
files: [`**/${scriptFile}`],
80-
},
81-
{
82-
...tseslint.configs.stylistic[2],
83-
files: [`**/${scriptFile}`],
84-
},
85-
]
69+
{
70+
...tseslint.configs.strict[0],
71+
files: [`**/${scriptFile}`],
72+
},
73+
{
74+
...tseslint.configs.strict[1],
75+
files: [`**/${tsFile}`],
76+
},
77+
{
78+
...tseslint.configs.strict[2],
79+
files: [`**/${scriptFile}`],
80+
},
81+
{
82+
...tseslint.configs.stylistic[2],
83+
files: [`**/${scriptFile}`],
84+
},
85+
]
8686

8787
const scriptConfig: ConfigArray = tseslint.config([
8888
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@
8484
"dependencies": {
8585
"eslint-plugin-unused-imports": "^4.1.4"
8686
}
87-
}
87+
}
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import { SelectProps } from 'antd'
22

33
export interface AntSelectProps extends SelectProps {
4-
value?: any
5-
onChange?: (value: any, option: any) => void
4+
value?: string | number | string[] | number[]
5+
onChange?: (
6+
value: string | number | string[] | number[],
7+
option: Record<string, unknown> | Record<string, unknown>[],
8+
) => void
69
showSearch?: boolean
7-
onClick?: (value: any) => void
10+
onClick?: (value: string | number | string[] | number[]) => void
811
className?: string
912
classNameInner?: string
1013
placeholder?: string
1114
optionFilterProp?: string
12-
filterOption?: (input: any, option: any) => boolean
13-
filterSort?: (optionA: any, optionB: any) => any
15+
filterOption?: (input: string, option: Record<string, unknown>) => boolean
16+
filterSort?: (optionA: Record<string, unknown>, optionB: Record<string, unknown>) => number
1417
size?: 'small' | 'middle' | 'large' | undefined
15-
options?: any
18+
options?: { label: string; value: string | number; [key: string]: unknown }[]
1619
}

src/api/components/ant/ant-switch-props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { SwitchProps } from 'antd'
22

33
export interface AntSwitchProps extends SwitchProps {
44
value: boolean
5-
onChange: (value: any) => void
5+
onChange: (value: boolean) => void
66
className?: string | undefined
77
}

src/api/components/rsd/rsd-button-props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { DivProps } from '../interface/base-types'
22

33
export interface RsdButtonProps extends DivProps {
4-
onClick: (e: any) => void
4+
onClick: (e: MouseEvent) => void
55
dashed?: boolean
66
text: string
77
tip?: string
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import { ReactNode } from 'react'
2+
13
import { DivProps } from '@/api/components/interface/base-types'
24

35
export interface RsdCheckableButtonProps extends DivProps {
46
value: boolean
5-
onChange: (value: any) => void
7+
onChange: (value: boolean) => void
68
label: string
79
className?: string
810
theme?: string
9-
children?: any
11+
children?: ReactNode
1012
}

src/api/components/rsd/rsd-checkbox-props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DivProps } from '@/api/components/interface/base-types'
22

33
export interface RsdCheckboxProps extends DivProps {
44
value: boolean
5-
onChange: (value: any) => void
5+
onChange: (value: boolean) => void
66
label: string
77
className?: string
88
theme?: string

src/api/components/rsd/rsd-color-props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DivProps } from '@/api/components/interface/base-types'
22

33
export interface RsdColorProps extends DivProps {
44
value: string | null
5-
onChange: (value: any) => void
5+
onChange: (value: string | null) => void
66
label: string
77
disableAlpha?: boolean
88
className?: string

src/api/components/rsd/rsd-input-props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DivProps } from '../interface/base-types'
22

33
export interface RsdInputProps extends DivProps {
44
value: string
5-
onChange: (value: any) => void
5+
onChange: (value: string) => void
66
type?: 'text' | 'number' | 'password'
77
placeholder?: string
88
className?: string

0 commit comments

Comments
 (0)