diff --git a/docs/examples/simple.tsx b/docs/examples/simple.tsx
index 59a2641e..aa4c7033 100644
--- a/docs/examples/simple.tsx
+++ b/docs/examples/simple.tsx
@@ -200,7 +200,7 @@ class Test extends React.Component
{
return null;
}
- const actions = Object.keys(state.trigger) as ActionType[]
+ const actions = Object.keys(state.trigger) as ActionType[];
return (
diff --git a/docs/index.md b/docs/index.md
index 2782d1cf..6e9e0db6 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -4,4 +4,4 @@ hero:
description: React Trigger Component
---
-
\ No newline at end of file
+
diff --git a/now.json b/now.json
index 76d28fa1..716cff0a 100644
--- a/now.json
+++ b/now.json
@@ -8,4 +8,4 @@
"config": { "distDir": ".doc" }
}
]
-}
\ No newline at end of file
+}
diff --git a/package.json b/package.json
index b58ec3d9..55c24e14 100644
--- a/package.json
+++ b/package.json
@@ -36,6 +36,7 @@
"prepublishOnly": "npm run compile && np --yolo --no-publish",
"lint": "eslint src/ docs/examples/ --ext .tsx,.ts,.jsx,.js",
"test": "rc-test",
+ "prettier": "prettier --write .",
"coverage": "rc-test --coverage",
"now-build": "npm run build"
},
@@ -55,6 +56,7 @@
"father": "^4.0.0",
"less": "^4.2.0",
"np": "^10.0.5",
+ "prettier": "^3.3.3",
"rc-test": "^7.0.13",
"react": "^18.0.0",
"react-dom": "^18.0.0",
diff --git a/src/hooks/useAlign.ts b/src/hooks/useAlign.ts
index 6eacbf2f..8af82525 100644
--- a/src/hooks/useAlign.ts
+++ b/src/hooks/useAlign.ts
@@ -213,7 +213,7 @@ export default function useAlign(
} else {
const rect = target.getBoundingClientRect();
rect.x = rect.x ?? rect.left;
- rect.y = rect.y ?? rect.top
+ rect.y = rect.y ?? rect.top;
targetRect = {
x: rect.x,
y: rect.y,
diff --git a/tests/flip.test.tsx b/tests/flip.test.tsx
index 17fb0dd4..853ec980 100644
--- a/tests/flip.test.tsx
+++ b/tests/flip.test.tsx
@@ -353,7 +353,7 @@ describe('Trigger.Align', () => {
top: 100,
width: 300,
height: 300,
- } as any);
+ }) as any;
const visibleArea = getVisibleArea(initArea, [affectEle]);
expect(visibleArea).toEqual({
diff --git a/tests/rect.test.tsx b/tests/rect.test.tsx
index 8f708bfe..596689f0 100644
--- a/tests/rect.test.tsx
+++ b/tests/rect.test.tsx
@@ -74,5 +74,4 @@ describe('Trigger.Rect', () => {
bottom: `100px`,
});
});
-
});
diff --git a/tests/util.tsx b/tests/util.tsx
index c06684f4..c706654d 100644
--- a/tests/util.tsx
+++ b/tests/util.tsx
@@ -1,4 +1,4 @@
-import { act } from "@testing-library/react";
+import { act } from '@testing-library/react';
const autoAdjustOverflow = {
adjustX: 1,
@@ -94,7 +94,6 @@ export function getMouseEvent(type: string, values = {}): FakeMouseEvent {
return new FakeMouseEvent(type, values);
}
-
export async function awaitFakeTimer() {
for (let i = 0; i < 10; i += 1) {
await act(async () => {