@eslint-react/shared 1.43.0 → 1.43.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +174 -175
- package/dist/index.d.ts +174 -175
- package/dist/index.js +70 -49
- package/dist/index.mjs +51 -49
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { InferOutput } from 'valibot';
|
|
1
|
+
import * as z from '@zod/mini';
|
|
3
2
|
import { _ } from '@eslint-react/eff';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -27,539 +26,539 @@ declare const getId: () => string;
|
|
|
27
26
|
|
|
28
27
|
declare function getReactVersion(fallback?: string): string;
|
|
29
28
|
|
|
30
|
-
declare const CustomComponentPropSchema:
|
|
29
|
+
declare const CustomComponentPropSchema: z.ZodMiniObject<{
|
|
31
30
|
/**
|
|
32
31
|
* The name of the prop in the user-defined component.
|
|
33
32
|
* @example
|
|
34
33
|
* "to"
|
|
35
34
|
*/
|
|
36
|
-
|
|
35
|
+
name: z.ZodMiniString<string>;
|
|
37
36
|
/**
|
|
38
37
|
* The name of the prop in the host component.
|
|
39
38
|
* @example
|
|
40
39
|
* "href"
|
|
41
40
|
*/
|
|
42
|
-
|
|
41
|
+
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
43
42
|
/**
|
|
44
43
|
* Whether the prop is controlled or not in the user-defined component.
|
|
45
44
|
* @internal
|
|
46
45
|
* @example
|
|
47
46
|
* `true`
|
|
48
47
|
*/
|
|
49
|
-
|
|
48
|
+
controlled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
50
49
|
/**
|
|
51
50
|
* The default value of the prop in the user-defined component.
|
|
52
51
|
* @example
|
|
53
52
|
* `"/"`
|
|
54
53
|
*/
|
|
55
|
-
|
|
56
|
-
},
|
|
54
|
+
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
55
|
+
}, {}>;
|
|
57
56
|
/**
|
|
58
57
|
* @description
|
|
59
58
|
* This will provide some key information to the rule before checking for user-defined components.
|
|
60
59
|
* For example:
|
|
61
60
|
* Which prop is used as the `href` prop for the user-defined `Link` component that represents the built-in `a` element.
|
|
62
61
|
*/
|
|
63
|
-
declare const CustomComponentSchema:
|
|
62
|
+
declare const CustomComponentSchema: z.ZodMiniObject<{
|
|
64
63
|
/**
|
|
65
64
|
* The name of the user-defined component.
|
|
66
65
|
* @example
|
|
67
66
|
* "Link"
|
|
68
67
|
*/
|
|
69
|
-
|
|
68
|
+
name: z.ZodMiniString<string>;
|
|
70
69
|
/**
|
|
71
70
|
* The name of the host component that the user-defined component represents.
|
|
72
71
|
* @example
|
|
73
72
|
* "a"
|
|
74
73
|
*/
|
|
75
|
-
|
|
74
|
+
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
76
75
|
/**
|
|
77
76
|
* Attributes mapping between the user-defined component and the host component.
|
|
78
77
|
* @example
|
|
79
78
|
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
|
|
80
79
|
*/
|
|
81
|
-
|
|
80
|
+
attributes: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
82
81
|
/**
|
|
83
82
|
* The name of the prop in the user-defined component.
|
|
84
83
|
* @example
|
|
85
84
|
* "to"
|
|
86
85
|
*/
|
|
87
|
-
|
|
86
|
+
name: z.ZodMiniString<string>;
|
|
88
87
|
/**
|
|
89
88
|
* The name of the prop in the host component.
|
|
90
89
|
* @example
|
|
91
90
|
* "href"
|
|
92
91
|
*/
|
|
93
|
-
|
|
92
|
+
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
94
93
|
/**
|
|
95
94
|
* Whether the prop is controlled or not in the user-defined component.
|
|
96
95
|
* @internal
|
|
97
96
|
* @example
|
|
98
97
|
* `true`
|
|
99
98
|
*/
|
|
100
|
-
|
|
99
|
+
controlled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
101
100
|
/**
|
|
102
101
|
* The default value of the prop in the user-defined component.
|
|
103
102
|
* @example
|
|
104
103
|
* `"/"`
|
|
105
104
|
*/
|
|
106
|
-
|
|
107
|
-
},
|
|
105
|
+
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
106
|
+
}, {}>>>;
|
|
108
107
|
/**
|
|
109
108
|
* The ESQuery selector to select the component precisely.
|
|
110
109
|
* @internal
|
|
111
110
|
* @example
|
|
112
111
|
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
113
112
|
*/
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
declare const CustomHooksSchema:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
},
|
|
113
|
+
selector: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
114
|
+
}, {}>;
|
|
115
|
+
declare const CustomHooksSchema: z.ZodMiniObject<{
|
|
116
|
+
use: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
117
|
+
useActionState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
118
|
+
useCallback: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
119
|
+
useContext: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
120
|
+
useDebugValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
121
|
+
useDeferredValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
122
|
+
useEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
123
|
+
useFormStatus: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
124
|
+
useId: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
125
|
+
useImperativeHandle: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
126
|
+
useInsertionEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
127
|
+
useLayoutEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
128
|
+
useMemo: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
129
|
+
useOptimistic: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
130
|
+
useReducer: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
131
|
+
useRef: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
132
|
+
useState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
133
|
+
useSyncExternalStore: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
134
|
+
useTransition: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
135
|
+
}, {}>;
|
|
137
136
|
/**
|
|
138
137
|
* @internal
|
|
139
138
|
*/
|
|
140
|
-
declare const ESLintReactSettingsSchema:
|
|
139
|
+
declare const ESLintReactSettingsSchema: z.ZodMiniObject<{
|
|
141
140
|
/**
|
|
142
141
|
* The source where React is imported from.
|
|
143
142
|
* @description This allows to specify a custom import location for React when not using the official distribution.
|
|
144
143
|
* @default `"react"`
|
|
145
144
|
* @example `"@pika/react"`
|
|
146
145
|
*/
|
|
147
|
-
|
|
146
|
+
importSource: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
148
147
|
/**
|
|
149
148
|
* The identifier that's used for JSX Element creation.
|
|
150
149
|
* @default `"createElement"`
|
|
151
150
|
* @deprecated
|
|
152
151
|
*/
|
|
153
|
-
|
|
152
|
+
jsxPragma: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
154
153
|
/**
|
|
155
154
|
* The identifier that's used for JSX fragment elements.
|
|
156
155
|
* @description This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment").
|
|
157
156
|
* @default `"Fragment"`
|
|
158
157
|
* @deprecated
|
|
159
158
|
*/
|
|
160
|
-
|
|
159
|
+
jsxPragmaFrag: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
161
160
|
/**
|
|
162
161
|
* The name of the prop that is used for polymorphic components.
|
|
163
162
|
* @description This is used to determine the type of the component.
|
|
164
163
|
* @example `"as"`
|
|
165
164
|
*/
|
|
166
|
-
|
|
165
|
+
polymorphicPropName: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
167
166
|
/**
|
|
168
167
|
* @internal
|
|
169
168
|
*/
|
|
170
|
-
|
|
169
|
+
strict: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
171
170
|
/**
|
|
172
171
|
* Check both the shape and the import to determine if an API is from React.
|
|
173
172
|
* @description This can prevent false positives when using a irrelevant third-party library that has similar APIs to React.
|
|
174
173
|
* @default `true`
|
|
175
174
|
*/
|
|
176
|
-
|
|
175
|
+
skipImportCheck: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
177
176
|
/**
|
|
178
177
|
* React version to use, "detect" means auto detect React version from the project's dependencies.
|
|
179
178
|
* If `importSource` is specified, an equivalent version of React should be provided here.
|
|
180
179
|
* @example `"18.3.1"`
|
|
181
180
|
* @default `"detect"`
|
|
182
181
|
*/
|
|
183
|
-
|
|
182
|
+
version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
184
183
|
/**
|
|
185
184
|
* A object to define additional hooks that are equivalent to the built-in React Hooks.
|
|
186
185
|
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
|
|
187
186
|
* @example `{ useEffect: ["useIsomorphicLayoutEffect"] }`
|
|
188
187
|
*/
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
},
|
|
188
|
+
additionalHooks: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
189
|
+
use: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
190
|
+
useActionState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
191
|
+
useCallback: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
192
|
+
useContext: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
193
|
+
useDebugValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
194
|
+
useDeferredValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
195
|
+
useEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
196
|
+
useFormStatus: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
197
|
+
useId: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
198
|
+
useImperativeHandle: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
199
|
+
useInsertionEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
200
|
+
useLayoutEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
201
|
+
useMemo: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
202
|
+
useOptimistic: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
203
|
+
useReducer: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
204
|
+
useRef: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
205
|
+
useState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
206
|
+
useSyncExternalStore: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
207
|
+
useTransition: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
208
|
+
}, {}>>;
|
|
210
209
|
/**
|
|
211
210
|
* An array of user-defined components
|
|
212
211
|
* @description This is used to inform the ESLint React plugins how to treat these components during checks.
|
|
213
212
|
* @example `[{ name: "Link", as: "a", attributes: [{ name: "to", as: "href" }, { name: "rel", defaultValue: "noopener noreferrer" }] }]`
|
|
214
213
|
*/
|
|
215
|
-
|
|
214
|
+
additionalComponents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
216
215
|
/**
|
|
217
216
|
* The name of the user-defined component.
|
|
218
217
|
* @example
|
|
219
218
|
* "Link"
|
|
220
219
|
*/
|
|
221
|
-
|
|
220
|
+
name: z.ZodMiniString<string>;
|
|
222
221
|
/**
|
|
223
222
|
* The name of the host component that the user-defined component represents.
|
|
224
223
|
* @example
|
|
225
224
|
* "a"
|
|
226
225
|
*/
|
|
227
|
-
|
|
226
|
+
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
228
227
|
/**
|
|
229
228
|
* Attributes mapping between the user-defined component and the host component.
|
|
230
229
|
* @example
|
|
231
230
|
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
|
|
232
231
|
*/
|
|
233
|
-
|
|
232
|
+
attributes: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
234
233
|
/**
|
|
235
234
|
* The name of the prop in the user-defined component.
|
|
236
235
|
* @example
|
|
237
236
|
* "to"
|
|
238
237
|
*/
|
|
239
|
-
|
|
238
|
+
name: z.ZodMiniString<string>;
|
|
240
239
|
/**
|
|
241
240
|
* The name of the prop in the host component.
|
|
242
241
|
* @example
|
|
243
242
|
* "href"
|
|
244
243
|
*/
|
|
245
|
-
|
|
244
|
+
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
246
245
|
/**
|
|
247
246
|
* Whether the prop is controlled or not in the user-defined component.
|
|
248
247
|
* @internal
|
|
249
248
|
* @example
|
|
250
249
|
* `true`
|
|
251
250
|
*/
|
|
252
|
-
|
|
251
|
+
controlled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
253
252
|
/**
|
|
254
253
|
* The default value of the prop in the user-defined component.
|
|
255
254
|
* @example
|
|
256
255
|
* `"/"`
|
|
257
256
|
*/
|
|
258
|
-
|
|
259
|
-
},
|
|
257
|
+
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
258
|
+
}, {}>>>;
|
|
260
259
|
/**
|
|
261
260
|
* The ESQuery selector to select the component precisely.
|
|
262
261
|
* @internal
|
|
263
262
|
* @example
|
|
264
263
|
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
265
264
|
*/
|
|
266
|
-
|
|
267
|
-
},
|
|
268
|
-
},
|
|
265
|
+
selector: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
266
|
+
}, {}>>>;
|
|
267
|
+
}, {}>;
|
|
269
268
|
/**
|
|
270
269
|
* @internal
|
|
271
270
|
*/
|
|
272
|
-
declare const ESLintSettingsSchema:
|
|
273
|
-
|
|
271
|
+
declare const ESLintSettingsSchema: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
272
|
+
"react-x": z.ZodMiniOptional<z.ZodMiniObject<{
|
|
274
273
|
/**
|
|
275
274
|
* The source where React is imported from.
|
|
276
275
|
* @description This allows to specify a custom import location for React when not using the official distribution.
|
|
277
276
|
* @default `"react"`
|
|
278
277
|
* @example `"@pika/react"`
|
|
279
278
|
*/
|
|
280
|
-
|
|
279
|
+
importSource: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
281
280
|
/**
|
|
282
281
|
* The identifier that's used for JSX Element creation.
|
|
283
282
|
* @default `"createElement"`
|
|
284
283
|
* @deprecated
|
|
285
284
|
*/
|
|
286
|
-
|
|
285
|
+
jsxPragma: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
287
286
|
/**
|
|
288
287
|
* The identifier that's used for JSX fragment elements.
|
|
289
288
|
* @description This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment").
|
|
290
289
|
* @default `"Fragment"`
|
|
291
290
|
* @deprecated
|
|
292
291
|
*/
|
|
293
|
-
|
|
292
|
+
jsxPragmaFrag: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
294
293
|
/**
|
|
295
294
|
* The name of the prop that is used for polymorphic components.
|
|
296
295
|
* @description This is used to determine the type of the component.
|
|
297
296
|
* @example `"as"`
|
|
298
297
|
*/
|
|
299
|
-
|
|
298
|
+
polymorphicPropName: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
300
299
|
/**
|
|
301
300
|
* @internal
|
|
302
301
|
*/
|
|
303
|
-
|
|
302
|
+
strict: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
304
303
|
/**
|
|
305
304
|
* Check both the shape and the import to determine if an API is from React.
|
|
306
305
|
* @description This can prevent false positives when using a irrelevant third-party library that has similar APIs to React.
|
|
307
306
|
* @default `true`
|
|
308
307
|
*/
|
|
309
|
-
|
|
308
|
+
skipImportCheck: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
310
309
|
/**
|
|
311
310
|
* React version to use, "detect" means auto detect React version from the project's dependencies.
|
|
312
311
|
* If `importSource` is specified, an equivalent version of React should be provided here.
|
|
313
312
|
* @example `"18.3.1"`
|
|
314
313
|
* @default `"detect"`
|
|
315
314
|
*/
|
|
316
|
-
|
|
315
|
+
version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
317
316
|
/**
|
|
318
317
|
* A object to define additional hooks that are equivalent to the built-in React Hooks.
|
|
319
318
|
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
|
|
320
319
|
* @example `{ useEffect: ["useIsomorphicLayoutEffect"] }`
|
|
321
320
|
*/
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
},
|
|
321
|
+
additionalHooks: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
322
|
+
use: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
323
|
+
useActionState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
324
|
+
useCallback: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
325
|
+
useContext: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
326
|
+
useDebugValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
327
|
+
useDeferredValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
328
|
+
useEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
329
|
+
useFormStatus: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
330
|
+
useId: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
331
|
+
useImperativeHandle: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
332
|
+
useInsertionEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
333
|
+
useLayoutEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
334
|
+
useMemo: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
335
|
+
useOptimistic: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
336
|
+
useReducer: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
337
|
+
useRef: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
338
|
+
useState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
339
|
+
useSyncExternalStore: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
340
|
+
useTransition: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
341
|
+
}, {}>>;
|
|
343
342
|
/**
|
|
344
343
|
* An array of user-defined components
|
|
345
344
|
* @description This is used to inform the ESLint React plugins how to treat these components during checks.
|
|
346
345
|
* @example `[{ name: "Link", as: "a", attributes: [{ name: "to", as: "href" }, { name: "rel", defaultValue: "noopener noreferrer" }] }]`
|
|
347
346
|
*/
|
|
348
|
-
|
|
347
|
+
additionalComponents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
349
348
|
/**
|
|
350
349
|
* The name of the user-defined component.
|
|
351
350
|
* @example
|
|
352
351
|
* "Link"
|
|
353
352
|
*/
|
|
354
|
-
|
|
353
|
+
name: z.ZodMiniString<string>;
|
|
355
354
|
/**
|
|
356
355
|
* The name of the host component that the user-defined component represents.
|
|
357
356
|
* @example
|
|
358
357
|
* "a"
|
|
359
358
|
*/
|
|
360
|
-
|
|
359
|
+
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
361
360
|
/**
|
|
362
361
|
* Attributes mapping between the user-defined component and the host component.
|
|
363
362
|
* @example
|
|
364
363
|
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
|
|
365
364
|
*/
|
|
366
|
-
|
|
365
|
+
attributes: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
367
366
|
/**
|
|
368
367
|
* The name of the prop in the user-defined component.
|
|
369
368
|
* @example
|
|
370
369
|
* "to"
|
|
371
370
|
*/
|
|
372
|
-
|
|
371
|
+
name: z.ZodMiniString<string>;
|
|
373
372
|
/**
|
|
374
373
|
* The name of the prop in the host component.
|
|
375
374
|
* @example
|
|
376
375
|
* "href"
|
|
377
376
|
*/
|
|
378
|
-
|
|
377
|
+
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
379
378
|
/**
|
|
380
379
|
* Whether the prop is controlled or not in the user-defined component.
|
|
381
380
|
* @internal
|
|
382
381
|
* @example
|
|
383
382
|
* `true`
|
|
384
383
|
*/
|
|
385
|
-
|
|
384
|
+
controlled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
386
385
|
/**
|
|
387
386
|
* The default value of the prop in the user-defined component.
|
|
388
387
|
* @example
|
|
389
388
|
* `"/"`
|
|
390
389
|
*/
|
|
391
|
-
|
|
392
|
-
},
|
|
390
|
+
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
391
|
+
}, {}>>>;
|
|
393
392
|
/**
|
|
394
393
|
* The ESQuery selector to select the component precisely.
|
|
395
394
|
* @internal
|
|
396
395
|
* @example
|
|
397
396
|
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
398
397
|
*/
|
|
399
|
-
|
|
400
|
-
},
|
|
401
|
-
},
|
|
398
|
+
selector: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
399
|
+
}, {}>>>;
|
|
400
|
+
}, {}>>;
|
|
402
401
|
/** @deprecated Use `react-x` instead */
|
|
403
|
-
|
|
402
|
+
reactOptions: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
404
403
|
/**
|
|
405
404
|
* The source where React is imported from.
|
|
406
405
|
* @description This allows to specify a custom import location for React when not using the official distribution.
|
|
407
406
|
* @default `"react"`
|
|
408
407
|
* @example `"@pika/react"`
|
|
409
408
|
*/
|
|
410
|
-
|
|
409
|
+
importSource: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
411
410
|
/**
|
|
412
411
|
* The identifier that's used for JSX Element creation.
|
|
413
412
|
* @default `"createElement"`
|
|
414
413
|
* @deprecated
|
|
415
414
|
*/
|
|
416
|
-
|
|
415
|
+
jsxPragma: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
417
416
|
/**
|
|
418
417
|
* The identifier that's used for JSX fragment elements.
|
|
419
418
|
* @description This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment").
|
|
420
419
|
* @default `"Fragment"`
|
|
421
420
|
* @deprecated
|
|
422
421
|
*/
|
|
423
|
-
|
|
422
|
+
jsxPragmaFrag: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
424
423
|
/**
|
|
425
424
|
* The name of the prop that is used for polymorphic components.
|
|
426
425
|
* @description This is used to determine the type of the component.
|
|
427
426
|
* @example `"as"`
|
|
428
427
|
*/
|
|
429
|
-
|
|
428
|
+
polymorphicPropName: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
430
429
|
/**
|
|
431
430
|
* @internal
|
|
432
431
|
*/
|
|
433
|
-
|
|
432
|
+
strict: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
434
433
|
/**
|
|
435
434
|
* Check both the shape and the import to determine if an API is from React.
|
|
436
435
|
* @description This can prevent false positives when using a irrelevant third-party library that has similar APIs to React.
|
|
437
436
|
* @default `true`
|
|
438
437
|
*/
|
|
439
|
-
|
|
438
|
+
skipImportCheck: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
440
439
|
/**
|
|
441
440
|
* React version to use, "detect" means auto detect React version from the project's dependencies.
|
|
442
441
|
* If `importSource` is specified, an equivalent version of React should be provided here.
|
|
443
442
|
* @example `"18.3.1"`
|
|
444
443
|
* @default `"detect"`
|
|
445
444
|
*/
|
|
446
|
-
|
|
445
|
+
version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
447
446
|
/**
|
|
448
447
|
* A object to define additional hooks that are equivalent to the built-in React Hooks.
|
|
449
448
|
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
|
|
450
449
|
* @example `{ useEffect: ["useIsomorphicLayoutEffect"] }`
|
|
451
450
|
*/
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
},
|
|
451
|
+
additionalHooks: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
452
|
+
use: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
453
|
+
useActionState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
454
|
+
useCallback: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
455
|
+
useContext: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
456
|
+
useDebugValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
457
|
+
useDeferredValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
458
|
+
useEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
459
|
+
useFormStatus: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
460
|
+
useId: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
461
|
+
useImperativeHandle: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
462
|
+
useInsertionEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
463
|
+
useLayoutEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
464
|
+
useMemo: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
465
|
+
useOptimistic: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
466
|
+
useReducer: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
467
|
+
useRef: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
468
|
+
useState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
469
|
+
useSyncExternalStore: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
470
|
+
useTransition: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
471
|
+
}, {}>>;
|
|
473
472
|
/**
|
|
474
473
|
* An array of user-defined components
|
|
475
474
|
* @description This is used to inform the ESLint React plugins how to treat these components during checks.
|
|
476
475
|
* @example `[{ name: "Link", as: "a", attributes: [{ name: "to", as: "href" }, { name: "rel", defaultValue: "noopener noreferrer" }] }]`
|
|
477
476
|
*/
|
|
478
|
-
|
|
477
|
+
additionalComponents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
479
478
|
/**
|
|
480
479
|
* The name of the user-defined component.
|
|
481
480
|
* @example
|
|
482
481
|
* "Link"
|
|
483
482
|
*/
|
|
484
|
-
|
|
483
|
+
name: z.ZodMiniString<string>;
|
|
485
484
|
/**
|
|
486
485
|
* The name of the host component that the user-defined component represents.
|
|
487
486
|
* @example
|
|
488
487
|
* "a"
|
|
489
488
|
*/
|
|
490
|
-
|
|
489
|
+
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
491
490
|
/**
|
|
492
491
|
* Attributes mapping between the user-defined component and the host component.
|
|
493
492
|
* @example
|
|
494
493
|
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
|
|
495
494
|
*/
|
|
496
|
-
|
|
495
|
+
attributes: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
497
496
|
/**
|
|
498
497
|
* The name of the prop in the user-defined component.
|
|
499
498
|
* @example
|
|
500
499
|
* "to"
|
|
501
500
|
*/
|
|
502
|
-
|
|
501
|
+
name: z.ZodMiniString<string>;
|
|
503
502
|
/**
|
|
504
503
|
* The name of the prop in the host component.
|
|
505
504
|
* @example
|
|
506
505
|
* "href"
|
|
507
506
|
*/
|
|
508
|
-
|
|
507
|
+
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
509
508
|
/**
|
|
510
509
|
* Whether the prop is controlled or not in the user-defined component.
|
|
511
510
|
* @internal
|
|
512
511
|
* @example
|
|
513
512
|
* `true`
|
|
514
513
|
*/
|
|
515
|
-
|
|
514
|
+
controlled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
516
515
|
/**
|
|
517
516
|
* The default value of the prop in the user-defined component.
|
|
518
517
|
* @example
|
|
519
518
|
* `"/"`
|
|
520
519
|
*/
|
|
521
|
-
|
|
522
|
-
},
|
|
520
|
+
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
521
|
+
}, {}>>>;
|
|
523
522
|
/**
|
|
524
523
|
* The ESQuery selector to select the component precisely.
|
|
525
524
|
* @internal
|
|
526
525
|
* @example
|
|
527
526
|
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
528
527
|
*/
|
|
529
|
-
|
|
530
|
-
},
|
|
531
|
-
},
|
|
532
|
-
},
|
|
533
|
-
type CustomComponent =
|
|
534
|
-
type CustomComponentProp =
|
|
535
|
-
type CustomHooks =
|
|
536
|
-
type ESLintReactSettings =
|
|
537
|
-
type ESLintSettings =
|
|
528
|
+
selector: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
529
|
+
}, {}>>>;
|
|
530
|
+
}, {}>>;
|
|
531
|
+
}, {}>>;
|
|
532
|
+
type CustomComponent = z.infer<typeof CustomComponentSchema>;
|
|
533
|
+
type CustomComponentProp = z.infer<typeof CustomComponentPropSchema>;
|
|
534
|
+
type CustomHooks = z.infer<typeof CustomHooksSchema>;
|
|
535
|
+
type ESLintReactSettings = z.infer<typeof ESLintReactSettingsSchema>;
|
|
536
|
+
type ESLintSettings = z.infer<typeof ESLintSettingsSchema>;
|
|
538
537
|
/**
|
|
539
538
|
* The default ESLint settings for "react-x".
|
|
540
539
|
*/
|
|
541
540
|
declare const DEFAULT_ESLINT_REACT_SETTINGS: {
|
|
541
|
+
readonly version: "detect";
|
|
542
542
|
readonly importSource: "react";
|
|
543
|
-
readonly
|
|
543
|
+
readonly strict: false;
|
|
544
544
|
readonly skipImportCheck: true;
|
|
545
|
-
readonly
|
|
545
|
+
readonly polymorphicPropName: "as";
|
|
546
546
|
readonly additionalHooks: {
|
|
547
547
|
readonly useEffect: ["useIsomorphicLayoutEffect"];
|
|
548
548
|
readonly useLayoutEffect: ["useIsomorphicLayoutEffect"];
|
|
549
549
|
};
|
|
550
550
|
readonly jsxPragma?: string | undefined;
|
|
551
551
|
readonly jsxPragmaFrag?: string | undefined;
|
|
552
|
-
readonly strict: boolean;
|
|
553
552
|
readonly additionalComponents?: {
|
|
554
|
-
name: string;
|
|
555
553
|
as?: string | undefined;
|
|
556
554
|
attributes?: {
|
|
557
|
-
name: string;
|
|
558
555
|
as?: string | undefined;
|
|
559
556
|
controlled?: boolean | undefined;
|
|
560
557
|
defaultValue?: string | undefined;
|
|
558
|
+
name: string;
|
|
561
559
|
}[] | undefined;
|
|
562
560
|
selector?: string | undefined;
|
|
561
|
+
name: string;
|
|
563
562
|
}[] | undefined;
|
|
564
563
|
};
|
|
565
564
|
|