Skip to content

Commit 77e8f0d

Browse files
afc163zombieJ
authored andcommitted
chore: prettier code (#482)
1 parent e30f3c5 commit 77e8f0d

31 files changed

+86
-81
lines changed

.dumirc.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ export default defineConfig({
1919
min-height: 300px;
2020
}
2121
`,
22-
]
22+
],
2323
});

.fatherrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import { defineConfig } from 'father';
22

33
export default defineConfig({
44
plugins: ['@rc-component/father-plugin'],
5-
});
5+
});

.github/dependabot.yml

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
version: 2
22
updates:
3-
- package-ecosystem: npm
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
time: "21:00"
8-
open-pull-requests-limit: 10
9-
ignore:
10-
- dependency-name: np
11-
versions:
12-
- 7.2.0
13-
- 7.3.0
14-
- 7.4.0
15-
- dependency-name: "@types/react-dom"
16-
versions:
17-
- 17.0.0
18-
- 17.0.1
19-
- 17.0.2
20-
- dependency-name: "@types/react"
21-
versions:
22-
- 17.0.0
23-
- 17.0.1
24-
- 17.0.2
25-
- 17.0.3
26-
- dependency-name: typescript
27-
versions:
28-
- 4.1.3
29-
- 4.1.4
30-
- 4.1.5
3+
- package-ecosystem: npm
4+
directory: '/'
5+
schedule:
6+
interval: daily
7+
time: '21:00'
8+
open-pull-requests-limit: 10
9+
ignore:
10+
- dependency-name: np
11+
versions:
12+
- 7.2.0
13+
- 7.3.0
14+
- 7.4.0
15+
- dependency-name: '@types/react-dom'
16+
versions:
17+
- 17.0.0
18+
- 17.0.1
19+
- 17.0.2
20+
- dependency-name: '@types/react'
21+
versions:
22+
- 17.0.0
23+
- 17.0.1
24+
- 17.0.2
25+
- 17.0.3
26+
- dependency-name: typescript
27+
versions:
28+
- 4.1.3
29+
- 4.1.4
30+
- 4.1.5

.github/workflows/codeql.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: "CodeQL"
1+
name: 'CodeQL'
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: ['master']
66
pull_request:
7-
branches: [ "master" ]
7+
branches: ['master']
88
schedule:
9-
- cron: "40 12 * * 0"
9+
- cron: '40 12 * * 0'
1010

1111
jobs:
1212
analyze:
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
language: [ javascript ]
23+
language: [javascript]
2424

2525
steps:
2626
- name: Checkout
@@ -38,4 +38,4 @@ jobs:
3838
- name: Perform CodeQL Analysis
3939
uses: github/codeql-action/analyze@v2
4040
with:
41-
category: "/language:${{ matrix.language }}"
41+
category: '/language:${{ matrix.language }}'

HISTORY.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# History
2-
----
2+
3+
---
34

45
## 4.1.0 / 2020-05-08
56

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,26 @@ import React from 'react';
3939
import ReactDOM from 'react-dom';
4040
import Trigger from '@rc-component/trigger';
4141

42-
ReactDOM.render((
42+
ReactDOM.render(
4343
<Trigger
4444
action={['click']}
4545
popup={<span>popup</span>}
4646
popupAlign={{
4747
points: ['tl', 'bl'],
48-
offset: [0, 3]
48+
offset: [0, 3],
4949
}}
5050
>
51-
<a href='#'>hover</a>
52-
</Trigger>
53-
), container);
51+
<a href="#">hover</a>
52+
</Trigger>,
53+
container,
54+
);
5455
```
5556

5657
## Compatibility
5758

5859
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png" alt="Electron" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Electron |
59-
| --- | --- | --- | --- | --- |
60-
| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
60+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
61+
| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
6162

6263
## Example
6364

@@ -243,7 +244,6 @@ npm start
243244
</tbody>
244245
</table>
245246

246-
247247
## Test Case
248248

249249
```

assets/index/Mask.less

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
2323
}
2424

25-
&-fade-enter,&-fade-appear {
25+
&-fade-enter,
26+
&-fade-appear {
2627
opacity: 0;
2728
.fade-effect();
2829
animation-play-state: paused;
@@ -33,7 +34,8 @@
3334
animation-play-state: paused;
3435
}
3536

36-
&-fade-enter&-fade-enter-active,&-fade-appear&-fade-appear-active {
37+
&-fade-enter&-fade-enter-active,
38+
&-fade-appear&-fade-appear-active {
3739
animation-name: rcTriggerMaskFadeIn;
3840
animation-play-state: running;
3941
}

docs/demos/body-overflow.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nav:
55
path: /demo
66
---
77

8-
<code src="../examples/body-overflow.tsx"></code>
8+
<code src="../examples/body-overflow.tsx"></code>

docs/demos/case.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nav:
55
path: /demo
66
---
77

8-
<code src="../examples/case.tsx"></code>
8+
<code src="../examples/case.tsx"></code>

docs/demos/click-nested.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nav:
55
path: /demo
66
---
77

8-
<code src="../examples/click-nested.tsx"></code>
8+
<code src="../examples/click-nested.tsx"></code>

docs/demos/clip.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nav:
55
path: /demo
66
---
77

8-
<code src="../examples/clip.tsx"></code>
8+
<code src="../examples/clip.tsx"></code>

docs/demos/container.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nav:
55
path: /demo
66
---
77

8-
<code src="../examples/container.tsx"></code>
8+
<code src="../examples/container.tsx"></code>

docs/demos/inside.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nav:
55
path: /demo
66
---
77

8-
<code src="../examples/inside.tsx"></code>
8+
<code src="../examples/inside.tsx"></code>

docs/demos/large-popup.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nav:
55
path: /demo
66
---
77

8-
<code src="../examples/large-popup.tsx"></code>
8+
<code src="../examples/large-popup.tsx"></code>

docs/demos/nested.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nav:
55
path: /demo
66
---
77

8-
<code src="../examples/nested.tsx"></code>
8+
<code src="../examples/nested.tsx"></code>

docs/demos/point.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nav:
55
path: /demo
66
---
77

8-
<code src="../examples/point.tsx"></code>
8+
<code src="../examples/point.tsx"></code>

docs/demos/shadow.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nav:
55
path: /demo
66
---
77

8-
<code src="../examples/shadow.tsx"></code>
8+
<code src="../examples/shadow.tsx"></code>

docs/demos/simple.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nav:
55
path: /demo
66
---
77

8-
<code src="../examples/simple.tsx"></code>
8+
<code src="../examples/simple.tsx"></code>

docs/demos/visible-fallback.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nav:
55
path: /demo
66
---
77

8-
<code src="../examples/visible-fallback.tsx"></code>
8+
<code src="../examples/visible-fallback.tsx"></code>

docs/examples/case.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ const Demo = () => {
115115
click,
116116
contextMenu,
117117
};
118-
119-
const actionsKeys = Object.keys(actions).filter((action) => actions[action]) as ActionType[];
118+
119+
const actionsKeys = Object.keys(actions).filter(
120+
(action) => actions[action],
121+
) as ActionType[];
120122

121123
return (
122124
<React.StrictMode>

docs/examples/nested.tsx

+3-9
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ const Test = () => {
6767
getPopupContainer={() => containerRef.current}
6868
popup={<div style={popupBorderStyle}>I am inner Trigger Popup</div>}
6969
>
70-
<span style={{ margin: 20 }}>
71-
clickToShowInnerTrigger
72-
</span>
70+
<span style={{ margin: 20 }}>clickToShowInnerTrigger</span>
7371
</Trigger>
7472
</div>
7573
);
@@ -94,9 +92,7 @@ const Test = () => {
9492
builtinPlacements={builtinPlacements}
9593
popup={<div style={popupBorderStyle}>i am a hover popup</div>}
9694
>
97-
<span style={{ margin: 20 }}>
98-
trigger
99-
</span>
95+
<span style={{ margin: 20 }}>trigger</span>
10096
</Trigger>
10197
</span>
10298
</Trigger>
@@ -108,9 +104,7 @@ const Test = () => {
108104
builtinPlacements={builtinPlacements}
109105
popup={innerTrigger}
110106
>
111-
<span style={{ margin: 20 }}>
112-
trigger
113-
</span>
107+
<span style={{ margin: 20 }}>trigger</span>
114108
</Trigger>
115109
</div>
116110

docs/examples/point.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.point-popup {
22
pointer-events: none;
3-
}
3+
}

docs/examples/point.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ const builtinPlacements = {
1212
};
1313

1414
const innerTrigger = (
15-
<div style={{ padding: 20, background: 'rgba(0, 255, 0, 0.3)' }}>This is popup</div>
15+
<div style={{ padding: 20, background: 'rgba(0, 255, 0, 0.3)' }}>
16+
This is popup
17+
</div>
1618
);
1719

1820
class Test extends React.Component {
@@ -45,7 +47,11 @@ class Test extends React.Component {
4547
{action === 'hover' && (
4648
<label>
4749
Mouse enter delay:{' '}
48-
<input type="text" value={mouseEnterDelay} onChange={this.onDelayChange} />
50+
<input
51+
type="text"
52+
value={mouseEnterDelay}
53+
onChange={this.onDelayChange}
54+
/>
4955
</label>
5056
)}
5157
<div style={{ margin: 50 }}>

docs/examples/simple.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class Test extends React.Component<any, TestState> {
200200
return null;
201201
}
202202

203-
const actions = Object.keys(state.trigger) as ActionType[]
203+
const actions = Object.keys(state.trigger) as ActionType[];
204204

205205
return (
206206
<div>

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ hero:
44
description: React Trigger Component
55
---
66

7-
<embed src="../README.md"></embed>
7+
<embed src="../README.md"></embed>

now.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
"config": { "distDir": ".doc" }
99
}
1010
]
11-
}
11+
}

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"prepublishOnly": "npm run compile && np --yolo --no-publish",
3737
"lint": "eslint src/ docs/examples/ --ext .tsx,.ts,.jsx,.js",
3838
"test": "rc-test",
39+
"prettier": "prettier --write .",
3940
"coverage": "rc-test --coverage",
4041
"now-build": "npm run build"
4142
},
@@ -55,6 +56,7 @@
5556
"father": "^4.0.0",
5657
"less": "^4.2.0",
5758
"np": "^10.0.5",
59+
"prettier": "^3.3.3",
5860
"rc-test": "^7.0.13",
5961
"react": "^18.0.0",
6062
"react-dom": "^18.0.0",

src/hooks/useAlign.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export default function useAlign(
213213
} else {
214214
const rect = target.getBoundingClientRect();
215215
rect.x = rect.x ?? rect.left;
216-
rect.y = rect.y ?? rect.top
216+
rect.y = rect.y ?? rect.top;
217217
targetRect = {
218218
x: rect.x,
219219
y: rect.y,

tests/flip.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ describe('Trigger.Align', () => {
353353
top: 100,
354354
width: 300,
355355
height: 300,
356-
} as any);
356+
}) as any;
357357

358358
const visibleArea = getVisibleArea(initArea, [affectEle]);
359359
expect(visibleArea).toEqual({

tests/rect.test.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,4 @@ describe('Trigger.Rect', () => {
7474
bottom: `100px`,
7575
});
7676
});
77-
7877
});

0 commit comments

Comments
 (0)