File tree 7 files changed +71
-6
lines changed
7 files changed +71
-6
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export const init = async () => {
40
40
const configPath = path . join ( APP_PATH , 'reactuse.json' ) ;
41
41
const config = {
42
42
ts : fs . existsSync ( path . join ( APP_PATH , 'tsconfig.json' ) ) ,
43
- alias : {
43
+ aliases : {
44
44
hooks : '@/shared/hooks' ,
45
45
utils : '@/utils/lib'
46
46
}
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ export * from './useBrowserLanguage/useBrowserLanguage';
8
8
export * from './useClickOutside/useClickOutside' ;
9
9
export * from './useClipboard/useClipboard' ;
10
10
export * from './useConst/useConst' ;
11
- export * from './useConst/useConst' ;
12
11
export * from './useCookie/useCookie' ;
13
12
export * from './useCookies/useCookies' ;
14
13
export * from './useCounter/useCounter' ;
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ export * from './useBrowserLanguage/useBrowserLanguage';
8
8
export * from './useClickOutside/useClickOutside' ;
9
9
export * from './useClipboard/useClipboard' ;
10
10
export * from './useConst/useConst' ;
11
- export * from './useConst/useConst' ;
12
11
export * from './useCookie/useCookie' ;
13
12
export * from './useCookies/useCookies' ;
14
13
export * from './useCounter/useCounter' ;
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ export default async () => {
97
97
items : [
98
98
{ text : 'Introduction' , link : '/introduction' } ,
99
99
{ text : 'Installation' , link : '/installation' } ,
100
- { text : 'Config ' , link : '/config ' } ,
100
+ { text : 'reactuse.json ' , link : '/reactuse-json ' } ,
101
101
{ text : 'CLI' , link : '/cli' }
102
102
]
103
103
} ,
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Use the CLI to add hooks to your project with [useverse](https://www.npmjs.com/p
6
6
7
7
Use the ` init ` command to initialize configuration and dependencies for a new project.
8
8
9
- The ` init ` command installs dependencies, adds configures [ ` reactuse.json ` ] ( ./config .html ) .
9
+ The ` init ` command installs dependencies, adds configures [ ` reactuse.json ` ] ( ./reactuse-json .html ) .
10
10
11
11
``` bash
12
12
npx useverse@latest init
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ # reactuse.json
2
+
3
+ Configuration for your project.
4
+
5
+ The ` reactuse.json ` file holds configuration for your project.
6
+
7
+ We use it to understand how your project is set up and how to generate hooks customized for your project.
8
+
9
+ ::: info
10
+ Note: The ` reactuse.json ` file is optional and ** only required if you're
11
+ using the CLI** to add hooks to your project. If you're using the copy
12
+ and paste method, you don't need this file.
13
+ :::
14
+
15
+ You can create a ` reactuse.json ` file in your project by running the following command:
16
+
17
+ ``` bash
18
+ npx useverse@latest init
19
+ ```
20
+
21
+ See the [ CLI section] ( ./cli.md ) for more information.
22
+
23
+ ## ts
24
+
25
+ Choose between TypeScript or JavaScript hooks.
26
+
27
+ Setting this option to ` false ` allows hooks to be added as JavaScript with the ` .jsx ` file extension.
28
+
29
+ ``` json title="reactuse.json"
30
+ {
31
+ "ts" : `true` | `false`
32
+ }
33
+ ```
34
+
35
+ ## aliases
36
+
37
+ The CLI uses these values and the ` paths ` config from your ` tsconfig.json ` or ` jsconfig.json ` file to place generated hooks in the correct location.
38
+
39
+ Path aliases have to be set up in your ` tsconfig.json ` or ` jsconfig.json ` file.
40
+
41
+ ::: info
42
+ ** Important:** If you're using the ` src ` directory, make sure it is included
43
+ under ` paths ` in your ` tsconfig.json ` or ` jsconfig.json ` file.
44
+ :::
45
+
46
+ ### aliases.utils
47
+
48
+ Import alias for your utility functions.
49
+
50
+ ``` json title="reactuse.json"
51
+ {
52
+ "aliases" : {
53
+ "utils" : " @/utils/lib"
54
+ }
55
+ }
56
+ ```
57
+
58
+ ### aliases.hooks
59
+
60
+ Import alias for your hooks.
61
+
62
+ ``` json title="reactuse.json"
63
+ {
64
+ "aliases" : {
65
+ "hooks" : " @/shared/hooks"
66
+ }
67
+ }
68
+ ```
You can’t perform that action at this time.
0 commit comments