Skip to content

Commit d96a10d

Browse files
committed
style: prettier code
1 parent 789647c commit d96a10d

File tree

5 files changed

+30
-39
lines changed

5 files changed

+30
-39
lines changed

.eslintrc

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
"@typescript-eslint/explicit-module-boundary-types": 0,
3434
"@typescript-eslint/no-empty-function": 0,
3535
"@typescript-eslint/no-non-null-assertion": 0,
36-
"@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": true }]
36+
"@typescript-eslint/no-unused-vars": [
37+
"error",
38+
{ "vars": "all", "args": "after-used", "ignoreRestSiblings": true }
39+
]
3740
}
3841
}
3942
],

antdv-demo

components/select/__tests__/index.test.js

+8-22
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,12 @@ describe('Select', () => {
3737
attachTo: 'body',
3838
});
3939
await asyncExpect(() => {
40-
wrapper
41-
.findAll('.ant-select-selector')[0]
42-
.element.dispatchEvent(new MouseEvent('mousedown'));
40+
wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
4341
});
4442

4543
await asyncExpect(() => {
4644
expect($$('.ant-select-item-option').length).toBe(0);
47-
expect($$('.ant-empty-description')[0].innerHTML).toBe(
48-
'No Data',
49-
);
45+
expect($$('.ant-empty-description')[0].innerHTML).toBe('No Data');
5046
}, 100);
5147
});
5248

@@ -60,9 +56,7 @@ describe('Select', () => {
6056
attachTo: 'body',
6157
});
6258
await asyncExpect(() => {
63-
wrapper
64-
.findAll('.ant-select-selector')[0]
65-
.element.dispatchEvent(new MouseEvent('mousedown'));
59+
wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
6660
});
6761

6862
await asyncExpect(() => {
@@ -79,9 +73,7 @@ describe('Select', () => {
7973
attachTo: 'body',
8074
});
8175
await asyncExpect(() => {
82-
wrapper
83-
.findAll('.ant-select-selector')[0]
84-
.element.dispatchEvent(new MouseEvent('mousedown'));
76+
wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
8577
});
8678

8779
await asyncExpect(() => {
@@ -98,9 +90,7 @@ describe('Select', () => {
9890
sync: false,
9991
});
10092
await asyncExpect(() => {
101-
wrapper
102-
.findAll('.ant-select-selector')[0]
103-
.element.dispatchEvent(new MouseEvent('mousedown'));
93+
wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
10494
});
10595

10696
await asyncExpect(() => {
@@ -135,11 +125,9 @@ describe('Select', () => {
135125
expect(getStyle($$('.ant-select-dropdown')[0], 'display')).toBe('block');
136126
}, 100);
137127
await asyncExpect(() => {
138-
wrapper
139-
.findAll('.ant-select-selector')[0]
140-
.element.dispatchEvent(new MouseEvent('mousedown'));
128+
wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
141129
});
142-
await asyncExpect(()=>{
130+
await asyncExpect(() => {
143131
expect(onDropdownVisibleChange).toHaveBeenLastCalledWith(false);
144132
});
145133
await asyncExpect(() => {
@@ -149,9 +137,7 @@ describe('Select', () => {
149137

150138
await asyncExpect(() => {
151139
expect(getStyle($$('.ant-select-dropdown')[0], 'display')).toBe('none');
152-
wrapper
153-
.findAll('.ant-select-selector')[0]
154-
.element.dispatchEvent(new MouseEvent('mousedown'));
140+
wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
155141
expect(onDropdownVisibleChange).toHaveBeenLastCalledWith(true);
156142
expect(getStyle($$('.ant-select-dropdown')[0], 'display')).toBe('none');
157143
}, 500);

components/vc-tree-select/src/Base/BaseSelector.jsx

+13-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,14 @@ export default function() {
104104
}
105105
const clearIcon = getComponent(this, 'clearIcon');
106106
return (
107-
<span key="clear" unselectable="on" aria-hidden="true" style="user-select: none;" class={`${prefixCls}-clear`} onClick={onSelectorClear}>
107+
<span
108+
key="clear"
109+
unselectable="on"
110+
aria-hidden="true"
111+
style="user-select: none;"
112+
class={`${prefixCls}-clear`}
113+
onClick={onSelectorClear}
114+
>
108115
{clearIcon}
109116
</span>
110117
);
@@ -117,7 +124,11 @@ export default function() {
117124
}
118125
const inputIcon = getComponent(this, 'inputIcon');
119126
return (
120-
<span key="arrow" class={`${prefixCls}-arrow`} style={{ outline: 'none', userSelect: 'none' }}>
127+
<span
128+
key="arrow"
129+
class={`${prefixCls}-arrow`}
130+
style={{ outline: 'none', userSelect: 'none' }}
131+
>
121132
{inputIcon}
122133
</span>
123134
);

components/vc-tree-select/src/Selector/MultipleSelector/index.jsx

+4-13
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,7 @@ const MultipleSelector = {
8181
this.__emit('choiceAnimationLeave', ...args);
8282
},
8383
renderSelection() {
84-
const {
85-
selectorValueList,
86-
labelInValue,
87-
maxTagCount,
88-
} = this.$props;
84+
const { selectorValueList, labelInValue, maxTagCount } = this.$props;
8985
const children = getSlot(this);
9086
const {
9187
vcTreeSelect: { onMultipleSelectorRemove },
@@ -140,14 +136,9 @@ const MultipleSelector = {
140136
}
141137

142138
selectedValueNodes.push(
143-
<SearchInput
144-
key="SearchInput"
145-
{...this.$props}
146-
{...this.$attrs}
147-
ref={this.inputRef}
148-
>
149-
{children}
150-
</SearchInput>,
139+
<SearchInput key="SearchInput" {...this.$props} {...this.$attrs} ref={this.inputRef}>
140+
{children}
141+
</SearchInput>,
151142
);
152143

153144
return selectedValueNodes;

0 commit comments

Comments
 (0)