Skip to content

Commit e6b768d

Browse files
committed
chore: fix lint
1 parent 3b8b162 commit e6b768d

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

biome.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"files": {
3+
"ignoreUnknown": true,
4+
"ignore": [
5+
".dumi/*",
6+
"dist/*",
7+
"es/**/*",
8+
"lib/**/*",
9+
"node_modules",
10+
"server",
11+
"package.json",
12+
".dumirc.ts"
13+
]
14+
}
15+
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"build": "dumi build",
2727
"compile": "father build",
2828
"coverage": "rc-test --coverage",
29-
"lint": "eslint src/ docs/examples/ --ext .tsx,.ts,.jsx,.js",
29+
"lint": "biome lint",
3030
"prepublishOnly": "npm run compile && np --yolo --no-publish",
3131
"start": "dumi dev",
3232
"test": "rc-test"
@@ -35,6 +35,7 @@
3535
"@babel/runtime": "^7.18.3"
3636
},
3737
"devDependencies": {
38+
"@biomejs/biome": "^1.9.4",
3839
"@rc-component/father-plugin": "^1.0.0",
3940
"@testing-library/jest-dom": "^5.16.4",
4041
"@testing-library/react": "^16.1.0",
@@ -45,7 +46,6 @@
4546
"antd": "^5.22.6",
4647
"cross-env": "^7.0.1",
4748
"dumi": "^2.1.0",
48-
"eslint": "^7.0.0",
4949
"father": "^4.0.0",
5050
"np": "^6.2.0",
5151
"rc-test": "^7.0.13",

src/index.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import { unstableSetRender } from 'antd';
22
import { createRoot } from 'react-dom/client';
33

4-
unstableSetRender((node, container) => {
5-
(container as any)._reactRoot ||= createRoot(container);
6-
const root: ReturnType<typeof createRoot> = (container as any)._reactRoot;
4+
type RenderType = Parameters<typeof unstableSetRender>[0];
5+
type ContainerType = Parameters<RenderType>[1] & {
6+
_reactRoot?: ReturnType<typeof createRoot>;
7+
};
8+
9+
unstableSetRender((node, container: ContainerType) => {
10+
container._reactRoot ||= createRoot(container);
11+
const root: ReturnType<typeof createRoot> = container._reactRoot;
712
root.render(node);
813
return async () => {
914
// Wait for timeout to avoid React render race.

0 commit comments

Comments
 (0)