diff --git a/packages/hooks/src/useTextSelection/demo/demo3.tsx b/packages/hooks/src/useTextSelection/demo/demo3.tsx
index 5226abe405..a9a7c26942 100644
--- a/packages/hooks/src/useTextSelection/demo/demo3.tsx
+++ b/packages/hooks/src/useTextSelection/demo/demo3.tsx
@@ -10,7 +10,7 @@ import React, { useRef } from 'react';
import { useTextSelection } from 'ahooks';
export default () => {
- const ref = useRef();
+ const ref = useRef(null);
const selection = useTextSelection(ref);
return (
diff --git a/packages/hooks/src/useVirtualList/demo/demo1.tsx b/packages/hooks/src/useVirtualList/demo/demo1.tsx
index 242d608353..e825fca182 100644
--- a/packages/hooks/src/useVirtualList/demo/demo1.tsx
+++ b/packages/hooks/src/useVirtualList/demo/demo1.tsx
@@ -10,8 +10,8 @@ import React, { useMemo, useRef } from 'react';
import { useVirtualList } from 'ahooks';
export default () => {
- const containerRef = useRef();
- const wrapperRef = useRef();
+ const containerRef = useRef(null);
+ const wrapperRef = useRef(null);
const originalList = useMemo(() => Array.from(Array(99999).keys()), []);
diff --git a/packages/hooks/src/useVirtualList/demo/demo2.tsx b/packages/hooks/src/useVirtualList/demo/demo2.tsx
index 4d44fad024..666fd41aa3 100644
--- a/packages/hooks/src/useVirtualList/demo/demo2.tsx
+++ b/packages/hooks/src/useVirtualList/demo/demo2.tsx
@@ -10,8 +10,8 @@ import React, { useMemo, useRef } from 'react';
import { useVirtualList } from 'ahooks';
export default () => {
- const containerRef = useRef();
- const wrapperRef = useRef();
+ const containerRef = useRef(null);
+ const wrapperRef = useRef(null);
const originalList = useMemo(() => Array.from(Array(99999).keys()), []);
diff --git a/packages/hooks/tsconfig.pro.json b/packages/hooks/tsconfig.pro.json
new file mode 100644
index 0000000000..e1d263d634
--- /dev/null
+++ b/packages/hooks/tsconfig.pro.json
@@ -0,0 +1,6 @@
+{
+ "extends": "../../tsconfig.pro.json",
+ "compilerOptions": {
+ "rootDir": "src"
+ }
+}
diff --git a/packages/use-url-state/tsconfig.pro.json b/packages/use-url-state/tsconfig.pro.json
new file mode 100644
index 0000000000..e1d263d634
--- /dev/null
+++ b/packages/use-url-state/tsconfig.pro.json
@@ -0,0 +1,6 @@
+{
+ "extends": "../../tsconfig.pro.json",
+ "compilerOptions": {
+ "rootDir": "src"
+ }
+}
diff --git a/tsconfig.json b/tsconfig.json
index db69e383ef..97eba1098e 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -3,18 +3,20 @@
"target": "ES5",
"moduleResolution": "node",
"jsx": "react",
- "allowJs": true,
"esModuleInterop": true,
"downlevelIteration": true,
"sourceMap": true,
"baseUrl": ".",
"paths": {
- "@/*": ["src/*"]
+ "@/*": ["src/*"],
+ "ahooks": ["./packages/hooks/src/index.ts"],
+ "ahooks/lib/*": ["./packages/hooks/src/*"],
+ "@ahooksjs/use-url-state": ["./packages/use-url-state/src/index.ts"]
},
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"declaration": false,
"strictNullChecks": true
},
- "exclude": ["node_modules", "lib", "es", "dist", "**/__tests__", "**/__test__", "**/demo"]
+ "exclude": ["node_modules", "lib", "es", "dist", "example"]
}
diff --git a/tsconfig.pro.json b/tsconfig.pro.json
new file mode 100644
index 0000000000..ab68c6817a
--- /dev/null
+++ b/tsconfig.pro.json
@@ -0,0 +1,14 @@
+{
+ "extends": "./tsconfig.json",
+ "exclude": [
+ "node_modules",
+ "lib",
+ "es",
+ "dist",
+ "**/__tests__",
+ "**/__test__",
+ "**/demo",
+ "example",
+ "gulpfile.js"
+ ]
+}