Skip to content

Commit 77f5605

Browse files
committed
fix: revert lint
1 parent 59e8937 commit 77f5605

4 files changed

Lines changed: 34 additions & 103 deletions

File tree

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ static/
1515
packages/common
1616
packages/ai-core
1717
site/engineering/static
18+
packages/components/**/type.ts

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
}
4949
},
5050
"lint-staged": {
51-
"packages/**/*.{ts,tsx}": [
51+
"packages/**/!(type).{ts,tsx}": [
5252
"prettier --write",
5353
"pnpm run lint:fix"
5454
]

packages/components/input-number/type.ts

Lines changed: 17 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,15 @@
44
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
55
* */
66

7-
import { InputProps } from "../input";
8-
import type { TNode } from "../common";
9-
import type {
10-
MouseEvent,
11-
KeyboardEvent,
12-
FocusEvent,
13-
FormEvent,
14-
CompositionEvent,
15-
} from "react";
7+
import { InputProps } from '../input';
8+
import type { TNode } from '../common';
9+
import type { MouseEvent, KeyboardEvent, FocusEvent, FormEvent, CompositionEvent } from 'react';
1610

1711
export interface TdInputNumberProps<T = InputNumberValue> {
1812
/**
1913
* 文本内容位置,居左/居中/居右
2014
*/
21-
align?: "left" | "center" | "right";
15+
align?: 'left' | 'center' | 'right';
2216
/**
2317
* 是否允许输入超过 `max` `min` 范围外的数字。为保障用户体验,仅在失去焦点时进行数字范围矫正。默认允许超出,数字超出范围时,输入框变红提醒
2418
* @default true
@@ -45,10 +39,7 @@ export interface TdInputNumberProps<T = InputNumberValue> {
4539
/**
4640
* 格式化输入框展示值。第二个事件参数 `context.fixedNumber` 表示处理过小数位数 `decimalPlaces` 的数字
4741
*/
48-
format?: (
49-
value: InputNumberValue,
50-
context?: { fixedNumber?: InputNumberValue }
51-
) => InputNumberValue;
42+
format?: (value: InputNumberValue, context?: { fixedNumber?: InputNumberValue }) => InputNumberValue;
5243
/**
5344
* 透传 Input 输入框组件全部属性
5445
*/
@@ -89,12 +80,12 @@ export interface TdInputNumberProps<T = InputNumberValue> {
8980
* 组件尺寸
9081
* @default medium
9182
*/
92-
size?: "small" | "medium" | "large";
83+
size?: 'small' | 'medium' | 'large';
9384
/**
9485
* 文本框状态
9586
* @default default
9687
*/
97-
status?: "default" | "success" | "warning" | "error";
88+
status?: 'default' | 'success' | 'warning' | 'error';
9889
/**
9990
* 数值改变步数,可以是小数。如果是大数,请保证数据类型为字符串
10091
* @default 1
@@ -108,7 +99,7 @@ export interface TdInputNumberProps<T = InputNumberValue> {
10899
* 按钮布局
109100
* @default row
110101
*/
111-
theme?: "column" | "row" | "normal";
102+
theme?: 'column' | 'row' | 'normal';
112103
/**
113104
* 输入框下方提示文本,会根据不同的 `status` 呈现不同的样式
114105
*/
@@ -124,60 +115,38 @@ export interface TdInputNumberProps<T = InputNumberValue> {
124115
/**
125116
* 失去焦点时触发
126117
*/
127-
onBlur?: (
128-
value: InputNumberValue,
129-
context: { e: FocusEvent<HTMLDivElement> }
130-
) => void;
118+
onBlur?: (value: InputNumberValue, context: { e: FocusEvent<HTMLDivElement> }) => void;
131119
/**
132120
* 值变化时触发,`type` 表示触发本次变化的来源
133121
*/
134122
onChange?: (value: T, context: ChangeContext) => void;
135123
/**
136124
* 回车键按下时触发
137125
*/
138-
onEnter?: (
139-
value: InputNumberValue,
140-
context: { e: KeyboardEvent<HTMLDivElement> }
141-
) => void;
126+
onEnter?: (value: InputNumberValue, context: { e: KeyboardEvent<HTMLDivElement> }) => void;
142127
/**
143128
* 获取焦点时触发
144129
*/
145-
onFocus?: (
146-
value: InputNumberValue,
147-
context: { e: FocusEvent<HTMLDivElement> }
148-
) => void;
130+
onFocus?: (value: InputNumberValue, context: { e: FocusEvent<HTMLDivElement> }) => void;
149131
/**
150132
* 键盘按下时触发
151133
*/
152-
onKeydown?: (
153-
value: InputNumberValue,
154-
context: { e: KeyboardEvent<HTMLDivElement> }
155-
) => void;
134+
onKeydown?: (value: InputNumberValue, context: { e: KeyboardEvent<HTMLDivElement> }) => void;
156135
/**
157136
* 按下字符键时触发(keydown -> keypress -> keyup)
158137
*/
159-
onKeypress?: (
160-
value: InputNumberValue,
161-
context: { e: KeyboardEvent<HTMLDivElement> }
162-
) => void;
138+
onKeypress?: (value: InputNumberValue, context: { e: KeyboardEvent<HTMLDivElement> }) => void;
163139
/**
164140
* 释放键盘时触发
165141
*/
166-
onKeyup?: (
167-
value: InputNumberValue,
168-
context: { e: KeyboardEvent<HTMLDivElement> }
169-
) => void;
142+
onKeyup?: (value: InputNumberValue, context: { e: KeyboardEvent<HTMLDivElement> }) => void;
170143
/**
171144
* 最大值或最小值校验结束后触发,`exceed-maximum` 表示超出最大值,`below-minimum` 表示小于最小值
172145
*/
173-
onValidate?: (context: {
174-
error?: "exceed-maximum" | "below-minimum";
175-
}) => void;
146+
onValidate?: (context: { error?: 'exceed-maximum' | 'below-minimum' }) => void;
176147
}
177148

178-
export type InputNumberDecimalPlaces =
179-
| number
180-
| { enableRound: boolean; places: number };
149+
export type InputNumberDecimalPlaces = number | { enableRound: boolean; places: number };
181150

182151
export type InputNumberValue = number | string;
183152

@@ -191,11 +160,4 @@ export interface ChangeContext {
191160
| CompositionEvent<HTMLDivElement>;
192161
}
193162

194-
export type ChangeSource =
195-
| "add"
196-
| "reduce"
197-
| "input"
198-
| "blur"
199-
| "enter"
200-
| "clear"
201-
| "props";
163+
export type ChangeSource = 'add' | 'reduce' | 'input' | 'blur' | 'enter' | 'clear' | 'props';

packages/components/tag-input/type.ts

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,10 @@
44
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
55
* */
66

7-
import { InputProps } from "../input";
8-
import { TagProps } from "../tag";
9-
import type { TNode, TElement, SizeEnum } from "../common";
10-
import type {
11-
MouseEvent,
12-
KeyboardEvent,
13-
ClipboardEvent,
14-
FocusEvent,
15-
FormEvent,
16-
CompositionEvent,
17-
} from "react";
7+
import { InputProps } from '../input';
8+
import { TagProps } from '../tag';
9+
import type { TNode, TElement, SizeEnum } from '../common';
10+
import type { MouseEvent, KeyboardEvent, ClipboardEvent, FocusEvent, FormEvent, CompositionEvent } from 'react';
1811

1912
export interface TdTagInputProps {
2013
/**
@@ -54,7 +47,7 @@ export interface TdTagInputProps {
5447
* 标签超出时的呈现方式,有两种:横向滚动显示 和 换行显示
5548
* @default break-line
5649
*/
57-
excessTagsDisplayType?: "scroll" | "break-line";
50+
excessTagsDisplayType?: 'scroll' | 'break-line';
5851
/**
5952
* 标签最大换行数
6053
* @default 1
@@ -114,7 +107,7 @@ export interface TdTagInputProps {
114107
/**
115108
* 输入框状态
116109
*/
117-
status?: "default" | "success" | "warning" | "error";
110+
status?: 'default' | 'success' | 'warning' | 'error';
118111
/**
119112
* 后置图标前的后置内容
120113
*/
@@ -130,11 +123,7 @@ export interface TdTagInputProps {
130123
/**
131124
* 自定义单个标签的整体节点
132125
*/
133-
tagDisplay?: TNode<{
134-
value: string | number;
135-
index: number;
136-
onClose: (context?: { e?: MouseEvent }) => void;
137-
}>;
126+
tagDisplay?: TNode<{ value: string | number; index: number; onClose: (context?: { e?: MouseEvent }) => void }>;
138127
/**
139128
* 透传 Tag 组件全部属性
140129
*/
@@ -156,19 +145,11 @@ export interface TdTagInputProps {
156145
/**
157146
* 自定义值呈现的全部内容,参数为所有标签的值
158147
*/
159-
valueDisplay?:
160-
| string
161-
| TNode<{
162-
value: TagInputValue;
163-
onClose: (index: number, item?: any) => void;
164-
}>;
148+
valueDisplay?: string | TNode<{ value: TagInputValue; onClose: (index: number, item?: any) => void }>;
165149
/**
166150
* 失去焦点时触发
167151
*/
168-
onBlur?: (
169-
value: TagInputValue,
170-
context: { inputValue: string; e: FocusEvent<HTMLInputElement> }
171-
) => void;
152+
onBlur?: (value: TagInputValue, context: { inputValue: string; e: FocusEvent<HTMLInputElement> }) => void;
172153
/**
173154
* 值变化时触发,参数 `context.trigger` 表示数据变化的触发来源;`context.index` 指当前变化项的下标;`context.item` 指当前变化项;`context.e` 表示事件参数
174155
*/
@@ -188,17 +169,11 @@ export interface TdTagInputProps {
188169
/**
189170
* 按键按下 Enter 时触发
190171
*/
191-
onEnter?: (
192-
value: TagInputValue,
193-
context: { e: KeyboardEvent<HTMLDivElement>; inputValue: string }
194-
) => void;
172+
onEnter?: (value: TagInputValue, context: { e: KeyboardEvent<HTMLDivElement>; inputValue: string }) => void;
195173
/**
196174
* 聚焦时触发
197175
*/
198-
onFocus?: (
199-
value: TagInputValue,
200-
context: { inputValue: string; e: FocusEvent<HTMLInputElement> }
201-
) => void;
176+
onFocus?: (value: TagInputValue, context: { inputValue: string; e: FocusEvent<HTMLInputElement> }) => void;
202177
/**
203178
* 输入框值发生变化时触发,`context.trigger` 表示触发输入框值变化的来源:文本输入触发、清除按钮触发、回车键触发等
204179
*/
@@ -214,10 +189,7 @@ export interface TdTagInputProps {
214189
/**
215190
* 粘贴事件,`pasteValue` 表示粘贴板的内容
216191
*/
217-
onPaste?: (context: {
218-
e: ClipboardEvent<HTMLDivElement>;
219-
pasteValue: string;
220-
}) => void;
192+
onPaste?: (context: { e: ClipboardEvent<HTMLDivElement>; pasteValue: string }) => void;
221193
/**
222194
* 移除单个标签时触发
223195
*/
@@ -233,11 +205,7 @@ export interface TagInputChangeContext {
233205
e?: MouseEvent<SVGSVGElement> | KeyboardEvent<HTMLInputElement>;
234206
}
235207

236-
export type TagInputTriggerSource =
237-
| "enter"
238-
| "tag-remove"
239-
| "backspace"
240-
| "clear";
208+
export type TagInputTriggerSource = 'enter' | 'tag-remove' | 'backspace' | 'clear';
241209

242210
export interface TagInputDragSortContext {
243211
newTags: TagInputValue;
@@ -253,7 +221,7 @@ export interface InputValueChangeContext {
253221
| MouseEvent<HTMLElement | SVGElement>
254222
| CompositionEvent<HTMLDivElement>
255223
| KeyboardEvent<HTMLInputElement>;
256-
trigger: "input" | "clear" | "enter" | "blur";
224+
trigger: 'input' | 'clear' | 'enter' | 'blur';
257225
}
258226

259227
export interface TagInputRemoveContext {
@@ -264,4 +232,4 @@ export interface TagInputRemoveContext {
264232
trigger: TagInputRemoveTrigger;
265233
}
266234

267-
export type TagInputRemoveTrigger = "tag-remove" | "backspace";
235+
export type TagInputRemoveTrigger = 'tag-remove' | 'backspace';

0 commit comments

Comments
 (0)