@eslint-react/shared 1.24.0-next.9 → 1.24.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 +257 -291
- package/dist/index.d.ts +257 -291
- package/dist/index.js +97 -108
- package/dist/index.mjs +94 -104
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
import { _ } from '@eslint-react/eff';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* The NPM scope for this project.
|
|
@@ -51,6 +52,8 @@ declare const REACT_BUILD_IN_HOOKS: readonly ["use", "useActionState", "useCallb
|
|
|
51
52
|
*/
|
|
52
53
|
declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
|
|
53
54
|
|
|
55
|
+
declare const getId: () => string;
|
|
56
|
+
|
|
54
57
|
declare function getReactVersion(fallback?: string): string;
|
|
55
58
|
|
|
56
59
|
/**
|
|
@@ -69,7 +72,7 @@ type SchemaWithPipe<TPipe extends [
|
|
|
69
72
|
*
|
|
70
73
|
* @internal
|
|
71
74
|
*/
|
|
72
|
-
readonly '~standard':
|
|
75
|
+
readonly '~standard': StandardProps<InferInput<FirstTupleItem<TPipe>>, InferOutput<LastTupleItem<TPipe>>>;
|
|
73
76
|
/**
|
|
74
77
|
* Parses unknown input values.
|
|
75
78
|
*
|
|
@@ -113,7 +116,7 @@ type SchemaWithPipeAsync<TPipe extends [
|
|
|
113
116
|
*
|
|
114
117
|
* @internal
|
|
115
118
|
*/
|
|
116
|
-
readonly '~standard':
|
|
119
|
+
readonly '~standard': StandardProps<InferInput<FirstTupleItem<TPipe>>, InferOutput<LastTupleItem<TPipe>>>;
|
|
117
120
|
/**
|
|
118
121
|
* Parses unknown input values.
|
|
119
122
|
*
|
|
@@ -138,7 +141,7 @@ type SchemaWithPipeAsync<TPipe extends [
|
|
|
138
141
|
};
|
|
139
142
|
|
|
140
143
|
/**
|
|
141
|
-
* Base metadata
|
|
144
|
+
* Base metadata interface.
|
|
142
145
|
*/
|
|
143
146
|
interface BaseMetadata<TInput> {
|
|
144
147
|
/**
|
|
@@ -166,7 +169,7 @@ interface BaseMetadata<TInput> {
|
|
|
166
169
|
}
|
|
167
170
|
|
|
168
171
|
/**
|
|
169
|
-
* Unknown dataset
|
|
172
|
+
* Unknown dataset interface.
|
|
170
173
|
*/
|
|
171
174
|
interface UnknownDataset {
|
|
172
175
|
/**
|
|
@@ -183,7 +186,7 @@ interface UnknownDataset {
|
|
|
183
186
|
issues?: undefined;
|
|
184
187
|
}
|
|
185
188
|
/**
|
|
186
|
-
* Success dataset
|
|
189
|
+
* Success dataset interface.
|
|
187
190
|
*/
|
|
188
191
|
interface SuccessDataset<TValue> {
|
|
189
192
|
/**
|
|
@@ -200,7 +203,7 @@ interface SuccessDataset<TValue> {
|
|
|
200
203
|
issues?: undefined;
|
|
201
204
|
}
|
|
202
205
|
/**
|
|
203
|
-
* Partial dataset
|
|
206
|
+
* Partial dataset interface.
|
|
204
207
|
*/
|
|
205
208
|
interface PartialDataset<TValue, TIssue extends BaseIssue<unknown>> {
|
|
206
209
|
/**
|
|
@@ -217,7 +220,7 @@ interface PartialDataset<TValue, TIssue extends BaseIssue<unknown>> {
|
|
|
217
220
|
issues: [TIssue, ...TIssue[]];
|
|
218
221
|
}
|
|
219
222
|
/**
|
|
220
|
-
* Failure dataset
|
|
223
|
+
* Failure dataset interface.
|
|
221
224
|
*/
|
|
222
225
|
interface FailureDataset<TIssue extends BaseIssue<unknown>> {
|
|
223
226
|
/**
|
|
@@ -241,7 +244,7 @@ type OutputDataset<TValue, TIssue extends BaseIssue<unknown>> = SuccessDataset<T
|
|
|
241
244
|
/**
|
|
242
245
|
* The Standard Schema properties interface.
|
|
243
246
|
*/
|
|
244
|
-
interface
|
|
247
|
+
interface StandardProps<TInput, TOutput> {
|
|
245
248
|
/**
|
|
246
249
|
* The version number of the standard.
|
|
247
250
|
*/
|
|
@@ -253,24 +256,24 @@ interface StandardSchemaProps<Input, Output> {
|
|
|
253
256
|
/**
|
|
254
257
|
* Validates unknown input values.
|
|
255
258
|
*/
|
|
256
|
-
readonly validate: (value: unknown) => StandardResult<
|
|
259
|
+
readonly validate: (value: unknown) => StandardResult<TOutput> | Promise<StandardResult<TOutput>>;
|
|
257
260
|
/**
|
|
258
261
|
* Inferred types associated with the schema.
|
|
259
262
|
*/
|
|
260
|
-
readonly types?: StandardTypes<
|
|
263
|
+
readonly types?: StandardTypes<TInput, TOutput> | undefined;
|
|
261
264
|
}
|
|
262
265
|
/**
|
|
263
266
|
* The result interface of the validate function.
|
|
264
267
|
*/
|
|
265
|
-
type StandardResult<
|
|
268
|
+
type StandardResult<TOutput> = StandardSuccessResult<TOutput> | StandardFailureResult;
|
|
266
269
|
/**
|
|
267
270
|
* The result interface if validation succeeds.
|
|
268
271
|
*/
|
|
269
|
-
interface StandardSuccessResult<
|
|
272
|
+
interface StandardSuccessResult<TOutput> {
|
|
270
273
|
/**
|
|
271
274
|
* The typed output value.
|
|
272
275
|
*/
|
|
273
|
-
readonly value:
|
|
276
|
+
readonly value: TOutput;
|
|
274
277
|
/**
|
|
275
278
|
* The non-existent issues.
|
|
276
279
|
*/
|
|
@@ -296,33 +299,33 @@ interface StandardIssue {
|
|
|
296
299
|
/**
|
|
297
300
|
* The path of the issue, if any.
|
|
298
301
|
*/
|
|
299
|
-
readonly path?: readonly (PropertyKey |
|
|
302
|
+
readonly path?: readonly (PropertyKey | StandardPathItem)[] | undefined;
|
|
300
303
|
}
|
|
301
304
|
/**
|
|
302
|
-
* The path
|
|
305
|
+
* The path item interface of the issue.
|
|
303
306
|
*/
|
|
304
|
-
interface
|
|
307
|
+
interface StandardPathItem {
|
|
305
308
|
/**
|
|
306
|
-
* The key
|
|
309
|
+
* The key of the path item.
|
|
307
310
|
*/
|
|
308
311
|
readonly key: PropertyKey;
|
|
309
312
|
}
|
|
310
313
|
/**
|
|
311
|
-
* The
|
|
314
|
+
* The Standard Schema types interface.
|
|
312
315
|
*/
|
|
313
|
-
interface StandardTypes<
|
|
316
|
+
interface StandardTypes<TInput, TOutput> {
|
|
314
317
|
/**
|
|
315
318
|
* The input type of the schema.
|
|
316
319
|
*/
|
|
317
|
-
readonly input:
|
|
320
|
+
readonly input: TInput;
|
|
318
321
|
/**
|
|
319
322
|
* The output type of the schema.
|
|
320
323
|
*/
|
|
321
|
-
readonly output:
|
|
324
|
+
readonly output: TOutput;
|
|
322
325
|
}
|
|
323
326
|
|
|
324
327
|
/**
|
|
325
|
-
* Base schema
|
|
328
|
+
* Base schema interface.
|
|
326
329
|
*/
|
|
327
330
|
interface BaseSchema<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
|
|
328
331
|
/**
|
|
@@ -350,7 +353,7 @@ interface BaseSchema<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
|
|
|
350
353
|
*
|
|
351
354
|
* @internal
|
|
352
355
|
*/
|
|
353
|
-
readonly '~standard':
|
|
356
|
+
readonly '~standard': StandardProps<TInput, TOutput>;
|
|
354
357
|
/**
|
|
355
358
|
* Parses unknown input values.
|
|
356
359
|
*
|
|
@@ -374,7 +377,7 @@ interface BaseSchema<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
|
|
|
374
377
|
} | undefined;
|
|
375
378
|
}
|
|
376
379
|
/**
|
|
377
|
-
* Base schema async
|
|
380
|
+
* Base schema async interface.
|
|
378
381
|
*/
|
|
379
382
|
interface BaseSchemaAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> extends Omit<BaseSchema<TInput, TOutput, TIssue>, 'reference' | 'async' | '~run'> {
|
|
380
383
|
/**
|
|
@@ -399,7 +402,7 @@ interface BaseSchemaAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> ex
|
|
|
399
402
|
}
|
|
400
403
|
|
|
401
404
|
/**
|
|
402
|
-
* Base transformation
|
|
405
|
+
* Base transformation interface.
|
|
403
406
|
*/
|
|
404
407
|
interface BaseTransformation<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
|
|
405
408
|
/**
|
|
@@ -441,7 +444,7 @@ interface BaseTransformation<TInput, TOutput, TIssue extends BaseIssue<unknown>>
|
|
|
441
444
|
} | undefined;
|
|
442
445
|
}
|
|
443
446
|
/**
|
|
444
|
-
* Base transformation async
|
|
447
|
+
* Base transformation async interface.
|
|
445
448
|
*/
|
|
446
449
|
interface BaseTransformationAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> extends Omit<BaseTransformation<TInput, TOutput, TIssue>, 'reference' | 'async' | '~run'> {
|
|
447
450
|
/**
|
|
@@ -466,7 +469,7 @@ interface BaseTransformationAsync<TInput, TOutput, TIssue extends BaseIssue<unkn
|
|
|
466
469
|
}
|
|
467
470
|
|
|
468
471
|
/**
|
|
469
|
-
* Base validation
|
|
472
|
+
* Base validation interface.
|
|
470
473
|
*/
|
|
471
474
|
interface BaseValidation<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
|
|
472
475
|
/**
|
|
@@ -512,7 +515,7 @@ interface BaseValidation<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
|
|
|
512
515
|
} | undefined;
|
|
513
516
|
}
|
|
514
517
|
/**
|
|
515
|
-
* Base validation async
|
|
518
|
+
* Base validation async interface.
|
|
516
519
|
*/
|
|
517
520
|
interface BaseValidationAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> extends Omit<BaseValidation<TInput, TOutput, TIssue>, 'reference' | 'async' | '~run'> {
|
|
518
521
|
/**
|
|
@@ -619,13 +622,13 @@ type SchemaWithoutPipe<TSchema extends BaseSchema<unknown, unknown, BaseIssue<un
|
|
|
619
622
|
};
|
|
620
623
|
|
|
621
624
|
/**
|
|
622
|
-
* Object entries
|
|
625
|
+
* Object entries interface.
|
|
623
626
|
*/
|
|
624
627
|
interface ObjectEntries {
|
|
625
628
|
[key: string]: BaseSchema<unknown, unknown, BaseIssue<unknown>>;
|
|
626
629
|
}
|
|
627
630
|
/**
|
|
628
|
-
* Object entries async
|
|
631
|
+
* Object entries async interface.
|
|
629
632
|
*/
|
|
630
633
|
interface ObjectEntriesAsync {
|
|
631
634
|
[key: string]: BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>;
|
|
@@ -702,7 +705,7 @@ type InferObjectOutput<TEntries extends ObjectEntries | ObjectEntriesAsync> = Pr
|
|
|
702
705
|
type InferObjectIssue<TEntries extends ObjectEntries | ObjectEntriesAsync> = InferIssue<TEntries[keyof TEntries]>;
|
|
703
706
|
|
|
704
707
|
/**
|
|
705
|
-
* Array path item
|
|
708
|
+
* Array path item interface.
|
|
706
709
|
*/
|
|
707
710
|
interface ArrayPathItem {
|
|
708
711
|
/**
|
|
@@ -727,7 +730,7 @@ interface ArrayPathItem {
|
|
|
727
730
|
readonly value: unknown;
|
|
728
731
|
}
|
|
729
732
|
/**
|
|
730
|
-
* Map path item
|
|
733
|
+
* Map path item interface.
|
|
731
734
|
*/
|
|
732
735
|
interface MapPathItem {
|
|
733
736
|
/**
|
|
@@ -752,7 +755,7 @@ interface MapPathItem {
|
|
|
752
755
|
readonly value: unknown;
|
|
753
756
|
}
|
|
754
757
|
/**
|
|
755
|
-
* Object path item
|
|
758
|
+
* Object path item interface.
|
|
756
759
|
*/
|
|
757
760
|
interface ObjectPathItem {
|
|
758
761
|
/**
|
|
@@ -777,7 +780,7 @@ interface ObjectPathItem {
|
|
|
777
780
|
readonly value: unknown;
|
|
778
781
|
}
|
|
779
782
|
/**
|
|
780
|
-
* Set path item
|
|
783
|
+
* Set path item interface.
|
|
781
784
|
*/
|
|
782
785
|
interface SetPathItem {
|
|
783
786
|
/**
|
|
@@ -802,7 +805,7 @@ interface SetPathItem {
|
|
|
802
805
|
readonly value: unknown;
|
|
803
806
|
}
|
|
804
807
|
/**
|
|
805
|
-
* Unknown path item
|
|
808
|
+
* Unknown path item interface.
|
|
806
809
|
*/
|
|
807
810
|
interface UnknownPathItem {
|
|
808
811
|
/**
|
|
@@ -831,7 +834,7 @@ interface UnknownPathItem {
|
|
|
831
834
|
*/
|
|
832
835
|
type IssuePathItem = ArrayPathItem | MapPathItem | ObjectPathItem | SetPathItem | UnknownPathItem;
|
|
833
836
|
/**
|
|
834
|
-
* Base issue
|
|
837
|
+
* Base issue interface.
|
|
835
838
|
*/
|
|
836
839
|
interface BaseIssue<TInput> extends Config<BaseIssue<TInput>> {
|
|
837
840
|
/**
|
|
@@ -873,7 +876,7 @@ interface BaseIssue<TInput> extends Config<BaseIssue<TInput>> {
|
|
|
873
876
|
}
|
|
874
877
|
|
|
875
878
|
/**
|
|
876
|
-
* Config
|
|
879
|
+
* Config interface.
|
|
877
880
|
*/
|
|
878
881
|
interface Config<TIssue extends BaseIssue<unknown>> {
|
|
879
882
|
/**
|
|
@@ -895,7 +898,7 @@ interface Config<TIssue extends BaseIssue<unknown>> {
|
|
|
895
898
|
}
|
|
896
899
|
|
|
897
900
|
/**
|
|
898
|
-
* Array issue
|
|
901
|
+
* Array issue interface.
|
|
899
902
|
*/
|
|
900
903
|
interface ArrayIssue extends BaseIssue<unknown> {
|
|
901
904
|
/**
|
|
@@ -913,7 +916,7 @@ interface ArrayIssue extends BaseIssue<unknown> {
|
|
|
913
916
|
}
|
|
914
917
|
|
|
915
918
|
/**
|
|
916
|
-
* Array schema
|
|
919
|
+
* Array schema interface.
|
|
917
920
|
*/
|
|
918
921
|
interface ArraySchema<TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TMessage extends ErrorMessage<ArrayIssue> | undefined> extends BaseSchema<InferInput<TItem>[], InferOutput<TItem>[], ArrayIssue | InferIssue<TItem>> {
|
|
919
922
|
/**
|
|
@@ -956,7 +959,7 @@ declare function array<const TItem extends BaseSchema<unknown, unknown, BaseIssu
|
|
|
956
959
|
declare function array<const TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TMessage extends ErrorMessage<ArrayIssue> | undefined>(item: TItem, message: TMessage): ArraySchema<TItem, TMessage>;
|
|
957
960
|
|
|
958
961
|
/**
|
|
959
|
-
* Boolean issue
|
|
962
|
+
* Boolean issue interface.
|
|
960
963
|
*/
|
|
961
964
|
interface BooleanIssue extends BaseIssue<unknown> {
|
|
962
965
|
/**
|
|
@@ -973,7 +976,7 @@ interface BooleanIssue extends BaseIssue<unknown> {
|
|
|
973
976
|
readonly expected: 'boolean';
|
|
974
977
|
}
|
|
975
978
|
/**
|
|
976
|
-
* Boolean schema
|
|
979
|
+
* Boolean schema interface.
|
|
977
980
|
*/
|
|
978
981
|
interface BooleanSchema<TMessage extends ErrorMessage<BooleanIssue> | undefined> extends BaseSchema<boolean, boolean, BooleanIssue> {
|
|
979
982
|
/**
|
|
@@ -1008,73 +1011,13 @@ declare function boolean(): BooleanSchema<undefined>;
|
|
|
1008
1011
|
*/
|
|
1009
1012
|
declare function boolean<const TMessage extends ErrorMessage<BooleanIssue> | undefined>(message: TMessage): BooleanSchema<TMessage>;
|
|
1010
1013
|
|
|
1011
|
-
/**
|
|
1012
|
-
* Class type.
|
|
1013
|
-
*/
|
|
1014
|
-
type Class = new (...args: any[]) => any;
|
|
1015
|
-
/**
|
|
1016
|
-
* Instance issue type.
|
|
1017
|
-
*/
|
|
1018
|
-
interface InstanceIssue extends BaseIssue<unknown> {
|
|
1019
|
-
/**
|
|
1020
|
-
* The issue kind.
|
|
1021
|
-
*/
|
|
1022
|
-
readonly kind: 'schema';
|
|
1023
|
-
/**
|
|
1024
|
-
* The issue type.
|
|
1025
|
-
*/
|
|
1026
|
-
readonly type: 'instance';
|
|
1027
|
-
/**
|
|
1028
|
-
* The expected property.
|
|
1029
|
-
*/
|
|
1030
|
-
readonly expected: string;
|
|
1031
|
-
}
|
|
1032
|
-
/**
|
|
1033
|
-
* Instance schema type.
|
|
1034
|
-
*/
|
|
1035
|
-
interface InstanceSchema<TClass extends Class, TMessage extends ErrorMessage<InstanceIssue> | undefined> extends BaseSchema<InstanceType<TClass>, InstanceType<TClass>, InstanceIssue> {
|
|
1036
|
-
/**
|
|
1037
|
-
* The schema type.
|
|
1038
|
-
*/
|
|
1039
|
-
readonly type: 'instance';
|
|
1040
|
-
/**
|
|
1041
|
-
* The schema reference.
|
|
1042
|
-
*/
|
|
1043
|
-
readonly reference: typeof instance;
|
|
1044
|
-
/**
|
|
1045
|
-
* The class of the instance.
|
|
1046
|
-
*/
|
|
1047
|
-
readonly class: TClass;
|
|
1048
|
-
/**
|
|
1049
|
-
* The error message.
|
|
1050
|
-
*/
|
|
1051
|
-
readonly message: TMessage;
|
|
1052
|
-
}
|
|
1053
|
-
/**
|
|
1054
|
-
* Creates an instance schema.
|
|
1055
|
-
*
|
|
1056
|
-
* @param class_ The class of the instance.
|
|
1057
|
-
*
|
|
1058
|
-
* @returns An instance schema.
|
|
1059
|
-
*/
|
|
1060
|
-
declare function instance<TClass extends Class>(class_: TClass): InstanceSchema<TClass, undefined>;
|
|
1061
|
-
/**
|
|
1062
|
-
* Creates an instance schema.
|
|
1063
|
-
*
|
|
1064
|
-
* @param class_ The class of the instance.
|
|
1065
|
-
* @param message The error message.
|
|
1066
|
-
*
|
|
1067
|
-
* @returns An instance schema.
|
|
1068
|
-
*/
|
|
1069
|
-
declare function instance<TClass extends Class, const TMessage extends ErrorMessage<InstanceIssue> | undefined>(class_: TClass, message: TMessage): InstanceSchema<TClass, TMessage>;
|
|
1070
|
-
|
|
1071
1014
|
/**
|
|
1072
1015
|
* Infer nullish output type.
|
|
1073
1016
|
*/
|
|
1074
1017
|
type InferNullishOutput<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, null | undefined>> = undefined extends TDefault ? InferOutput<TWrapped> | null | undefined : InferOutput<TWrapped> | Extract<DefaultValue<TDefault>, null | undefined>;
|
|
1075
1018
|
|
|
1076
1019
|
/**
|
|
1077
|
-
* Nullish schema
|
|
1020
|
+
* Nullish schema interface.
|
|
1078
1021
|
*/
|
|
1079
1022
|
interface NullishSchema<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped, null | undefined>> extends BaseSchema<InferInput<TWrapped> | null | undefined, InferNullishOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
|
|
1080
1023
|
/**
|
|
@@ -1117,7 +1060,7 @@ declare function nullish<const TWrapped extends BaseSchema<unknown, unknown, Bas
|
|
|
1117
1060
|
declare function nullish<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped, null | undefined>>(wrapped: TWrapped, default_: TDefault): NullishSchema<TWrapped, TDefault>;
|
|
1118
1061
|
|
|
1119
1062
|
/**
|
|
1120
|
-
* Nullish schema async
|
|
1063
|
+
* Nullish schema async interface.
|
|
1121
1064
|
*/
|
|
1122
1065
|
interface NullishSchemaAsync<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, null | undefined>> extends BaseSchemaAsync<InferInput<TWrapped> | null | undefined, InferNullishOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
|
|
1123
1066
|
/**
|
|
@@ -1160,7 +1103,7 @@ declare function nullishAsync<const TWrapped extends BaseSchema<unknown, unknown
|
|
|
1160
1103
|
declare function nullishAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, const TDefault extends DefaultAsync<TWrapped, null | undefined>>(wrapped: TWrapped, default_: TDefault): NullishSchemaAsync<TWrapped, TDefault>;
|
|
1161
1104
|
|
|
1162
1105
|
/**
|
|
1163
|
-
* Object issue
|
|
1106
|
+
* Object issue interface.
|
|
1164
1107
|
*/
|
|
1165
1108
|
interface ObjectIssue extends BaseIssue<unknown> {
|
|
1166
1109
|
/**
|
|
@@ -1178,7 +1121,7 @@ interface ObjectIssue extends BaseIssue<unknown> {
|
|
|
1178
1121
|
}
|
|
1179
1122
|
|
|
1180
1123
|
/**
|
|
1181
|
-
* Object schema
|
|
1124
|
+
* Object schema interface.
|
|
1182
1125
|
*/
|
|
1183
1126
|
interface ObjectSchema<TEntries extends ObjectEntries, TMessage extends ErrorMessage<ObjectIssue> | undefined> extends BaseSchema<InferObjectInput<TEntries>, InferObjectOutput<TEntries>, ObjectIssue | InferObjectIssue<TEntries>> {
|
|
1184
1127
|
/**
|
|
@@ -1236,7 +1179,7 @@ declare function object<const TEntries extends ObjectEntries, const TMessage ext
|
|
|
1236
1179
|
type InferOptionalOutput<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, undefined>> = undefined extends TDefault ? InferOutput<TWrapped> | undefined : InferOutput<TWrapped> | Extract<DefaultValue<TDefault>, undefined>;
|
|
1237
1180
|
|
|
1238
1181
|
/**
|
|
1239
|
-
* Optional schema
|
|
1182
|
+
* Optional schema interface.
|
|
1240
1183
|
*/
|
|
1241
1184
|
interface OptionalSchema<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped, undefined>> extends BaseSchema<InferInput<TWrapped> | undefined, InferOptionalOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
|
|
1242
1185
|
/**
|
|
@@ -1279,7 +1222,7 @@ declare function optional<const TWrapped extends BaseSchema<unknown, unknown, Ba
|
|
|
1279
1222
|
declare function optional<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped, undefined>>(wrapped: TWrapped, default_: TDefault): OptionalSchema<TWrapped, TDefault>;
|
|
1280
1223
|
|
|
1281
1224
|
/**
|
|
1282
|
-
* Optional schema async
|
|
1225
|
+
* Optional schema async interface.
|
|
1283
1226
|
*/
|
|
1284
1227
|
interface OptionalSchemaAsync<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, undefined>> extends BaseSchemaAsync<InferInput<TWrapped> | undefined, InferOptionalOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
|
|
1285
1228
|
/**
|
|
@@ -1322,7 +1265,7 @@ declare function optionalAsync<const TWrapped extends BaseSchema<unknown, unknow
|
|
|
1322
1265
|
declare function optionalAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, const TDefault extends DefaultAsync<TWrapped, undefined>>(wrapped: TWrapped, default_: TDefault): OptionalSchemaAsync<TWrapped, TDefault>;
|
|
1323
1266
|
|
|
1324
1267
|
/**
|
|
1325
|
-
* String issue
|
|
1268
|
+
* String issue interface.
|
|
1326
1269
|
*/
|
|
1327
1270
|
interface StringIssue extends BaseIssue<unknown> {
|
|
1328
1271
|
/**
|
|
@@ -1339,7 +1282,7 @@ interface StringIssue extends BaseIssue<unknown> {
|
|
|
1339
1282
|
readonly expected: 'string';
|
|
1340
1283
|
}
|
|
1341
1284
|
/**
|
|
1342
|
-
* String schema
|
|
1285
|
+
* String schema interface.
|
|
1343
1286
|
*/
|
|
1344
1287
|
interface StringSchema<TMessage extends ErrorMessage<StringIssue> | undefined> extends BaseSchema<string, string, StringIssue> {
|
|
1345
1288
|
/**
|
|
@@ -1375,7 +1318,7 @@ declare function string(): StringSchema<undefined>;
|
|
|
1375
1318
|
declare function string<const TMessage extends ErrorMessage<StringIssue> | undefined>(message: TMessage): StringSchema<TMessage>;
|
|
1376
1319
|
|
|
1377
1320
|
/**
|
|
1378
|
-
* Readonly action
|
|
1321
|
+
* Readonly action interface.
|
|
1379
1322
|
*/
|
|
1380
1323
|
interface ReadonlyAction<TInput> extends BaseTransformation<TInput, Readonly<TInput>, never> {
|
|
1381
1324
|
/**
|
|
@@ -1394,49 +1337,37 @@ interface ReadonlyAction<TInput> extends BaseTransformation<TInput, Readonly<TIn
|
|
|
1394
1337
|
*/
|
|
1395
1338
|
declare function readonly<TInput>(): ReadonlyAction<TInput>;
|
|
1396
1339
|
|
|
1397
|
-
|
|
1398
|
-
* @internal
|
|
1399
|
-
* @description
|
|
1400
|
-
* This allows the rule to know some key information before checking for user-defined hooks.
|
|
1401
|
-
* For example, the position of the `deps` argument for the user-defined `useCustomEffect` hook that represents the built-in `useEffect` hook.
|
|
1402
|
-
*/
|
|
1403
|
-
declare const CustomHookSchema: ObjectSchema<{}, undefined>;
|
|
1404
|
-
/**
|
|
1405
|
-
* @internal
|
|
1406
|
-
*/
|
|
1407
|
-
declare const CustomAttributeSchema: ObjectSchema<{
|
|
1340
|
+
declare const CustomComponentPropSchema: ObjectSchema<{
|
|
1408
1341
|
/**
|
|
1409
|
-
* The name of the
|
|
1342
|
+
* The name of the prop in the user-defined component.
|
|
1410
1343
|
* @example
|
|
1411
1344
|
* "to"
|
|
1412
1345
|
*/
|
|
1413
1346
|
readonly name: StringSchema<undefined>;
|
|
1414
1347
|
/**
|
|
1415
|
-
* The name of the
|
|
1348
|
+
* The name of the prop in the built-in component.
|
|
1416
1349
|
* @example
|
|
1417
1350
|
* "href"
|
|
1418
1351
|
*/
|
|
1419
1352
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1420
1353
|
/**
|
|
1421
|
-
* Whether the
|
|
1354
|
+
* Whether the prop is controlled or not in the user-defined component.
|
|
1422
1355
|
* @example
|
|
1423
1356
|
* `true`
|
|
1424
1357
|
*/
|
|
1425
1358
|
readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
1426
1359
|
/**
|
|
1427
|
-
* The default value of the
|
|
1360
|
+
* The default value of the prop in the user-defined component.
|
|
1428
1361
|
* @example
|
|
1429
1362
|
* `"/"`
|
|
1430
1363
|
*/
|
|
1431
1364
|
readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1432
1365
|
}, undefined>;
|
|
1433
1366
|
/**
|
|
1434
|
-
* @internal
|
|
1435
1367
|
* @description
|
|
1436
1368
|
* This will provide some key information to the rule before checking for user-defined components.
|
|
1437
1369
|
* For example:
|
|
1438
|
-
* Which
|
|
1439
|
-
* Which attributes are used as `children` props for a user-defined `Button` component to receive children of that component.
|
|
1370
|
+
* Which prop is used as the `href` prop for the user-defined `Link` component that represents the built-in `a` element.
|
|
1440
1371
|
*/
|
|
1441
1372
|
declare const CustomComponentSchema: ObjectSchema<{
|
|
1442
1373
|
/**
|
|
@@ -1445,12 +1376,6 @@ declare const CustomComponentSchema: ObjectSchema<{
|
|
|
1445
1376
|
* "Link"
|
|
1446
1377
|
*/
|
|
1447
1378
|
readonly name: StringSchema<undefined>;
|
|
1448
|
-
/**
|
|
1449
|
-
* The ESQuery selector to select the component precisely.
|
|
1450
|
-
* @example
|
|
1451
|
-
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
1452
|
-
*/
|
|
1453
|
-
readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1454
1379
|
/**
|
|
1455
1380
|
* The name of the built-in component that the user-defined component represents.
|
|
1456
1381
|
* @example
|
|
@@ -1458,55 +1383,65 @@ declare const CustomComponentSchema: ObjectSchema<{
|
|
|
1458
1383
|
*/
|
|
1459
1384
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1460
1385
|
/**
|
|
1461
|
-
*
|
|
1386
|
+
* Attributes mapping between the user-defined component and the built-in component.
|
|
1462
1387
|
* @example
|
|
1463
1388
|
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
|
|
1464
1389
|
*/
|
|
1465
1390
|
readonly attributes: OptionalSchema<ArraySchema<ObjectSchema<{
|
|
1466
1391
|
/**
|
|
1467
|
-
* The name of the
|
|
1392
|
+
* The name of the prop in the user-defined component.
|
|
1468
1393
|
* @example
|
|
1469
1394
|
* "to"
|
|
1470
1395
|
*/
|
|
1471
1396
|
readonly name: StringSchema<undefined>;
|
|
1472
1397
|
/**
|
|
1473
|
-
* The name of the
|
|
1398
|
+
* The name of the prop in the built-in component.
|
|
1474
1399
|
* @example
|
|
1475
1400
|
* "href"
|
|
1476
1401
|
*/
|
|
1477
1402
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1478
1403
|
/**
|
|
1479
|
-
* Whether the
|
|
1404
|
+
* Whether the prop is controlled or not in the user-defined component.
|
|
1480
1405
|
* @example
|
|
1481
1406
|
* `true`
|
|
1482
1407
|
*/
|
|
1483
1408
|
readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
1484
1409
|
/**
|
|
1485
|
-
* The default value of the
|
|
1410
|
+
* The default value of the prop in the user-defined component.
|
|
1486
1411
|
* @example
|
|
1487
1412
|
* `"/"`
|
|
1488
1413
|
*/
|
|
1489
1414
|
readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1490
1415
|
}, undefined>, undefined>, undefined>;
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
}, undefined>;
|
|
1498
|
-
declare const CustomComponentNormalizedSchema: ObjectSchema<{
|
|
1499
|
-
readonly name: StringSchema<undefined>;
|
|
1500
|
-
readonly as: StringSchema<undefined>;
|
|
1501
|
-
readonly attributes: OptionalSchema<ArraySchema<ObjectSchema<{
|
|
1502
|
-
readonly name: StringSchema<undefined>;
|
|
1503
|
-
readonly as: StringSchema<undefined>;
|
|
1504
|
-
readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
1505
|
-
readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1506
|
-
}, undefined>, undefined>, readonly []>;
|
|
1507
|
-
readonly re: InstanceSchema<RegExpConstructor, undefined>;
|
|
1416
|
+
/**
|
|
1417
|
+
* The ESQuery selector to select the component precisely.
|
|
1418
|
+
* @internal
|
|
1419
|
+
* @example
|
|
1420
|
+
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
1421
|
+
*/
|
|
1508
1422
|
readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1509
1423
|
}, undefined>;
|
|
1424
|
+
declare const CustomHooksSchema: ObjectSchema<{
|
|
1425
|
+
readonly use: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1426
|
+
readonly useActionState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1427
|
+
readonly useCallback: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1428
|
+
readonly useContext: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1429
|
+
readonly useDebugValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1430
|
+
readonly useDeferredValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1431
|
+
readonly useEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1432
|
+
readonly useFormStatus: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1433
|
+
readonly useId: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1434
|
+
readonly useImperativeHandle: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1435
|
+
readonly useInsertionEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1436
|
+
readonly useLayoutEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1437
|
+
readonly useMemo: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1438
|
+
readonly useOptimistic: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1439
|
+
readonly useReducer: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1440
|
+
readonly useRef: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1441
|
+
readonly useState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1442
|
+
readonly useSyncExternalStore: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1443
|
+
readonly useTransition: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1444
|
+
}, undefined>;
|
|
1510
1445
|
/**
|
|
1511
1446
|
* @internal
|
|
1512
1447
|
*/
|
|
@@ -1540,11 +1475,11 @@ declare const ESLintReactSettingsSchema: ObjectSchema<{
|
|
|
1540
1475
|
/**
|
|
1541
1476
|
* @internal
|
|
1542
1477
|
*/
|
|
1543
|
-
readonly strict: OptionalSchema<BooleanSchema<undefined>,
|
|
1478
|
+
readonly strict: OptionalSchema<BooleanSchema<undefined>, false>;
|
|
1544
1479
|
/**
|
|
1545
1480
|
* @internal
|
|
1546
1481
|
*/
|
|
1547
|
-
readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>,
|
|
1482
|
+
readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, false>;
|
|
1548
1483
|
/**
|
|
1549
1484
|
* React version to use, "detect" means auto detect React version from the project’s dependencies.
|
|
1550
1485
|
* If `importSource` is specified, an equivalent version of React should be provided here.
|
|
@@ -1552,6 +1487,32 @@ declare const ESLintReactSettingsSchema: ObjectSchema<{
|
|
|
1552
1487
|
* @default `"detect"`
|
|
1553
1488
|
*/
|
|
1554
1489
|
readonly version: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1490
|
+
/**
|
|
1491
|
+
* A object to define additional hooks that are equivalent to the built-in React Hooks.
|
|
1492
|
+
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
|
|
1493
|
+
* @example `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }`
|
|
1494
|
+
*/
|
|
1495
|
+
readonly additionalHooks: OptionalSchema<ObjectSchema<{
|
|
1496
|
+
readonly use: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1497
|
+
readonly useActionState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1498
|
+
readonly useCallback: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1499
|
+
readonly useContext: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1500
|
+
readonly useDebugValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1501
|
+
readonly useDeferredValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1502
|
+
readonly useEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1503
|
+
readonly useFormStatus: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1504
|
+
readonly useId: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1505
|
+
readonly useImperativeHandle: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1506
|
+
readonly useInsertionEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1507
|
+
readonly useLayoutEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1508
|
+
readonly useMemo: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1509
|
+
readonly useOptimistic: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1510
|
+
readonly useReducer: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1511
|
+
readonly useRef: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1512
|
+
readonly useState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1513
|
+
readonly useSyncExternalStore: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1514
|
+
readonly useTransition: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1515
|
+
}, undefined>, undefined>;
|
|
1555
1516
|
/**
|
|
1556
1517
|
* An array of user-defined components
|
|
1557
1518
|
* @description This is used to inform the ESLint React plugins how to treat these components during checks.
|
|
@@ -1564,12 +1525,6 @@ declare const ESLintReactSettingsSchema: ObjectSchema<{
|
|
|
1564
1525
|
* "Link"
|
|
1565
1526
|
*/
|
|
1566
1527
|
readonly name: StringSchema<undefined>;
|
|
1567
|
-
/**
|
|
1568
|
-
* The ESQuery selector to select the component precisely.
|
|
1569
|
-
* @example
|
|
1570
|
-
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
1571
|
-
*/
|
|
1572
|
-
readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1573
1528
|
/**
|
|
1574
1529
|
* The name of the built-in component that the user-defined component represents.
|
|
1575
1530
|
* @example
|
|
@@ -1577,63 +1532,44 @@ declare const ESLintReactSettingsSchema: ObjectSchema<{
|
|
|
1577
1532
|
*/
|
|
1578
1533
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1579
1534
|
/**
|
|
1580
|
-
*
|
|
1535
|
+
* Attributes mapping between the user-defined component and the built-in component.
|
|
1581
1536
|
* @example
|
|
1582
1537
|
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
|
|
1583
1538
|
*/
|
|
1584
1539
|
readonly attributes: OptionalSchema<ArraySchema<ObjectSchema<{
|
|
1585
1540
|
/**
|
|
1586
|
-
* The name of the
|
|
1541
|
+
* The name of the prop in the user-defined component.
|
|
1587
1542
|
* @example
|
|
1588
1543
|
* "to"
|
|
1589
1544
|
*/
|
|
1590
1545
|
readonly name: StringSchema<undefined>;
|
|
1591
1546
|
/**
|
|
1592
|
-
* The name of the
|
|
1547
|
+
* The name of the prop in the built-in component.
|
|
1593
1548
|
* @example
|
|
1594
1549
|
* "href"
|
|
1595
1550
|
*/
|
|
1596
1551
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1597
1552
|
/**
|
|
1598
|
-
* Whether the
|
|
1553
|
+
* Whether the prop is controlled or not in the user-defined component.
|
|
1599
1554
|
* @example
|
|
1600
1555
|
* `true`
|
|
1601
1556
|
*/
|
|
1602
1557
|
readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
1603
1558
|
/**
|
|
1604
|
-
* The default value of the
|
|
1559
|
+
* The default value of the prop in the user-defined component.
|
|
1605
1560
|
* @example
|
|
1606
1561
|
* `"/"`
|
|
1607
1562
|
*/
|
|
1608
1563
|
readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1609
1564
|
}, undefined>, undefined>, undefined>;
|
|
1565
|
+
/**
|
|
1566
|
+
* The ESQuery selector to select the component precisely.
|
|
1567
|
+
* @internal
|
|
1568
|
+
* @example
|
|
1569
|
+
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
1570
|
+
*/
|
|
1571
|
+
readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1610
1572
|
}, undefined>, undefined>, undefined>;
|
|
1611
|
-
/**
|
|
1612
|
-
* A object of aliases for React built-in hooks.
|
|
1613
|
-
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
|
|
1614
|
-
* @example `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }`
|
|
1615
|
-
*/
|
|
1616
|
-
readonly additionalHooks: OptionalSchema<ObjectSchema<{
|
|
1617
|
-
readonly use: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1618
|
-
readonly useActionState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1619
|
-
readonly useCallback: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1620
|
-
readonly useContext: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1621
|
-
readonly useDebugValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1622
|
-
readonly useDeferredValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1623
|
-
readonly useEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1624
|
-
readonly useFormStatus: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1625
|
-
readonly useId: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1626
|
-
readonly useImperativeHandle: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1627
|
-
readonly useInsertionEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1628
|
-
readonly useLayoutEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1629
|
-
readonly useMemo: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1630
|
-
readonly useOptimistic: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1631
|
-
readonly useReducer: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1632
|
-
readonly useRef: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1633
|
-
readonly useState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1634
|
-
readonly useSyncExternalStore: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1635
|
-
readonly useTransition: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1636
|
-
}, undefined>, undefined>;
|
|
1637
1573
|
}, undefined>;
|
|
1638
1574
|
/**
|
|
1639
1575
|
* @internal
|
|
@@ -1669,11 +1605,11 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1669
1605
|
/**
|
|
1670
1606
|
* @internal
|
|
1671
1607
|
*/
|
|
1672
|
-
readonly strict: OptionalSchema<BooleanSchema<undefined>,
|
|
1608
|
+
readonly strict: OptionalSchema<BooleanSchema<undefined>, false>;
|
|
1673
1609
|
/**
|
|
1674
1610
|
* @internal
|
|
1675
1611
|
*/
|
|
1676
|
-
readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>,
|
|
1612
|
+
readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, false>;
|
|
1677
1613
|
/**
|
|
1678
1614
|
* React version to use, "detect" means auto detect React version from the project’s dependencies.
|
|
1679
1615
|
* If `importSource` is specified, an equivalent version of React should be provided here.
|
|
@@ -1681,6 +1617,32 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1681
1617
|
* @default `"detect"`
|
|
1682
1618
|
*/
|
|
1683
1619
|
readonly version: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1620
|
+
/**
|
|
1621
|
+
* A object to define additional hooks that are equivalent to the built-in React Hooks.
|
|
1622
|
+
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
|
|
1623
|
+
* @example `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }`
|
|
1624
|
+
*/
|
|
1625
|
+
readonly additionalHooks: OptionalSchema<ObjectSchema<{
|
|
1626
|
+
readonly use: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1627
|
+
readonly useActionState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1628
|
+
readonly useCallback: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1629
|
+
readonly useContext: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1630
|
+
readonly useDebugValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1631
|
+
readonly useDeferredValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1632
|
+
readonly useEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1633
|
+
readonly useFormStatus: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1634
|
+
readonly useId: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1635
|
+
readonly useImperativeHandle: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1636
|
+
readonly useInsertionEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1637
|
+
readonly useLayoutEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1638
|
+
readonly useMemo: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1639
|
+
readonly useOptimistic: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1640
|
+
readonly useReducer: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1641
|
+
readonly useRef: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1642
|
+
readonly useState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1643
|
+
readonly useSyncExternalStore: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1644
|
+
readonly useTransition: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1645
|
+
}, undefined>, undefined>;
|
|
1684
1646
|
/**
|
|
1685
1647
|
* An array of user-defined components
|
|
1686
1648
|
* @description This is used to inform the ESLint React plugins how to treat these components during checks.
|
|
@@ -1693,12 +1655,6 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1693
1655
|
* "Link"
|
|
1694
1656
|
*/
|
|
1695
1657
|
readonly name: StringSchema<undefined>;
|
|
1696
|
-
/**
|
|
1697
|
-
* The ESQuery selector to select the component precisely.
|
|
1698
|
-
* @example
|
|
1699
|
-
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
1700
|
-
*/
|
|
1701
|
-
readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1702
1658
|
/**
|
|
1703
1659
|
* The name of the built-in component that the user-defined component represents.
|
|
1704
1660
|
* @example
|
|
@@ -1706,63 +1662,44 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1706
1662
|
*/
|
|
1707
1663
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1708
1664
|
/**
|
|
1709
|
-
*
|
|
1665
|
+
* Attributes mapping between the user-defined component and the built-in component.
|
|
1710
1666
|
* @example
|
|
1711
1667
|
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
|
|
1712
1668
|
*/
|
|
1713
1669
|
readonly attributes: OptionalSchema<ArraySchema<ObjectSchema<{
|
|
1714
1670
|
/**
|
|
1715
|
-
* The name of the
|
|
1671
|
+
* The name of the prop in the user-defined component.
|
|
1716
1672
|
* @example
|
|
1717
1673
|
* "to"
|
|
1718
1674
|
*/
|
|
1719
1675
|
readonly name: StringSchema<undefined>;
|
|
1720
1676
|
/**
|
|
1721
|
-
* The name of the
|
|
1677
|
+
* The name of the prop in the built-in component.
|
|
1722
1678
|
* @example
|
|
1723
1679
|
* "href"
|
|
1724
1680
|
*/
|
|
1725
1681
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1726
1682
|
/**
|
|
1727
|
-
* Whether the
|
|
1683
|
+
* Whether the prop is controlled or not in the user-defined component.
|
|
1728
1684
|
* @example
|
|
1729
1685
|
* `true`
|
|
1730
1686
|
*/
|
|
1731
1687
|
readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
1732
1688
|
/**
|
|
1733
|
-
* The default value of the
|
|
1689
|
+
* The default value of the prop in the user-defined component.
|
|
1734
1690
|
* @example
|
|
1735
1691
|
* `"/"`
|
|
1736
1692
|
*/
|
|
1737
1693
|
readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1738
1694
|
}, undefined>, undefined>, undefined>;
|
|
1695
|
+
/**
|
|
1696
|
+
* The ESQuery selector to select the component precisely.
|
|
1697
|
+
* @internal
|
|
1698
|
+
* @example
|
|
1699
|
+
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
1700
|
+
*/
|
|
1701
|
+
readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1739
1702
|
}, undefined>, undefined>, undefined>;
|
|
1740
|
-
/**
|
|
1741
|
-
* A object of aliases for React built-in hooks.
|
|
1742
|
-
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
|
|
1743
|
-
* @example `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }`
|
|
1744
|
-
*/
|
|
1745
|
-
readonly additionalHooks: OptionalSchema<ObjectSchema<{
|
|
1746
|
-
readonly use: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1747
|
-
readonly useActionState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1748
|
-
readonly useCallback: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1749
|
-
readonly useContext: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1750
|
-
readonly useDebugValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1751
|
-
readonly useDeferredValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1752
|
-
readonly useEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1753
|
-
readonly useFormStatus: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1754
|
-
readonly useId: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1755
|
-
readonly useImperativeHandle: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1756
|
-
readonly useInsertionEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1757
|
-
readonly useLayoutEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1758
|
-
readonly useMemo: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1759
|
-
readonly useOptimistic: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1760
|
-
readonly useReducer: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1761
|
-
readonly useRef: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1762
|
-
readonly useState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1763
|
-
readonly useSyncExternalStore: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1764
|
-
readonly useTransition: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1765
|
-
}, undefined>, undefined>;
|
|
1766
1703
|
}, undefined>, undefined>;
|
|
1767
1704
|
/** @deprecated Use `react-x` instead */
|
|
1768
1705
|
readonly reactOptions: OptionalSchema<ObjectSchema<{
|
|
@@ -1795,11 +1732,11 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1795
1732
|
/**
|
|
1796
1733
|
* @internal
|
|
1797
1734
|
*/
|
|
1798
|
-
readonly strict: OptionalSchema<BooleanSchema<undefined>,
|
|
1735
|
+
readonly strict: OptionalSchema<BooleanSchema<undefined>, false>;
|
|
1799
1736
|
/**
|
|
1800
1737
|
* @internal
|
|
1801
1738
|
*/
|
|
1802
|
-
readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>,
|
|
1739
|
+
readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, false>;
|
|
1803
1740
|
/**
|
|
1804
1741
|
* React version to use, "detect" means auto detect React version from the project’s dependencies.
|
|
1805
1742
|
* If `importSource` is specified, an equivalent version of React should be provided here.
|
|
@@ -1807,6 +1744,32 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1807
1744
|
* @default `"detect"`
|
|
1808
1745
|
*/
|
|
1809
1746
|
readonly version: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1747
|
+
/**
|
|
1748
|
+
* A object to define additional hooks that are equivalent to the built-in React Hooks.
|
|
1749
|
+
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
|
|
1750
|
+
* @example `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }`
|
|
1751
|
+
*/
|
|
1752
|
+
readonly additionalHooks: OptionalSchema<ObjectSchema<{
|
|
1753
|
+
readonly use: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1754
|
+
readonly useActionState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1755
|
+
readonly useCallback: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1756
|
+
readonly useContext: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1757
|
+
readonly useDebugValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1758
|
+
readonly useDeferredValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1759
|
+
readonly useEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1760
|
+
readonly useFormStatus: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1761
|
+
readonly useId: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1762
|
+
readonly useImperativeHandle: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1763
|
+
readonly useInsertionEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1764
|
+
readonly useLayoutEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1765
|
+
readonly useMemo: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1766
|
+
readonly useOptimistic: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1767
|
+
readonly useReducer: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1768
|
+
readonly useRef: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1769
|
+
readonly useState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1770
|
+
readonly useSyncExternalStore: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1771
|
+
readonly useTransition: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1772
|
+
}, undefined>, undefined>;
|
|
1810
1773
|
/**
|
|
1811
1774
|
* An array of user-defined components
|
|
1812
1775
|
* @description This is used to inform the ESLint React plugins how to treat these components during checks.
|
|
@@ -1819,12 +1782,6 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1819
1782
|
* "Link"
|
|
1820
1783
|
*/
|
|
1821
1784
|
readonly name: StringSchema<undefined>;
|
|
1822
|
-
/**
|
|
1823
|
-
* The ESQuery selector to select the component precisely.
|
|
1824
|
-
* @example
|
|
1825
|
-
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
1826
|
-
*/
|
|
1827
|
-
readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1828
1785
|
/**
|
|
1829
1786
|
* The name of the built-in component that the user-defined component represents.
|
|
1830
1787
|
* @example
|
|
@@ -1832,90 +1789,76 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1832
1789
|
*/
|
|
1833
1790
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1834
1791
|
/**
|
|
1835
|
-
*
|
|
1792
|
+
* Attributes mapping between the user-defined component and the built-in component.
|
|
1836
1793
|
* @example
|
|
1837
1794
|
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
|
|
1838
1795
|
*/
|
|
1839
1796
|
readonly attributes: OptionalSchema<ArraySchema<ObjectSchema<{
|
|
1840
1797
|
/**
|
|
1841
|
-
* The name of the
|
|
1798
|
+
* The name of the prop in the user-defined component.
|
|
1842
1799
|
* @example
|
|
1843
1800
|
* "to"
|
|
1844
1801
|
*/
|
|
1845
1802
|
readonly name: StringSchema<undefined>;
|
|
1846
1803
|
/**
|
|
1847
|
-
* The name of the
|
|
1804
|
+
* The name of the prop in the built-in component.
|
|
1848
1805
|
* @example
|
|
1849
1806
|
* "href"
|
|
1850
1807
|
*/
|
|
1851
1808
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1852
1809
|
/**
|
|
1853
|
-
* Whether the
|
|
1810
|
+
* Whether the prop is controlled or not in the user-defined component.
|
|
1854
1811
|
* @example
|
|
1855
1812
|
* `true`
|
|
1856
1813
|
*/
|
|
1857
1814
|
readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
1858
1815
|
/**
|
|
1859
|
-
* The default value of the
|
|
1816
|
+
* The default value of the prop in the user-defined component.
|
|
1860
1817
|
* @example
|
|
1861
1818
|
* `"/"`
|
|
1862
1819
|
*/
|
|
1863
1820
|
readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1864
1821
|
}, undefined>, undefined>, undefined>;
|
|
1822
|
+
/**
|
|
1823
|
+
* The ESQuery selector to select the component precisely.
|
|
1824
|
+
* @internal
|
|
1825
|
+
* @example
|
|
1826
|
+
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
1827
|
+
*/
|
|
1828
|
+
readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1865
1829
|
}, undefined>, undefined>, undefined>;
|
|
1866
|
-
/**
|
|
1867
|
-
* A object of aliases for React built-in hooks.
|
|
1868
|
-
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
|
|
1869
|
-
* @example `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }`
|
|
1870
|
-
*/
|
|
1871
|
-
readonly additionalHooks: OptionalSchema<ObjectSchema<{
|
|
1872
|
-
readonly use: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1873
|
-
readonly useActionState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1874
|
-
readonly useCallback: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1875
|
-
readonly useContext: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1876
|
-
readonly useDebugValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1877
|
-
readonly useDeferredValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1878
|
-
readonly useEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1879
|
-
readonly useFormStatus: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1880
|
-
readonly useId: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1881
|
-
readonly useImperativeHandle: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1882
|
-
readonly useInsertionEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1883
|
-
readonly useLayoutEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1884
|
-
readonly useMemo: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1885
|
-
readonly useOptimistic: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1886
|
-
readonly useReducer: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1887
|
-
readonly useRef: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1888
|
-
readonly useState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1889
|
-
readonly useSyncExternalStore: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1890
|
-
readonly useTransition: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1891
|
-
}, undefined>, undefined>;
|
|
1892
1830
|
}, undefined>, undefined>;
|
|
1893
1831
|
}, undefined>, {}>;
|
|
1894
|
-
type CustomHook = InferOutput<typeof CustomHookSchema>;
|
|
1895
|
-
type CustomAttribute = InferOutput<typeof CustomAttributeSchema>;
|
|
1896
1832
|
type CustomComponent = InferOutput<typeof CustomComponentSchema>;
|
|
1897
|
-
type
|
|
1898
|
-
type
|
|
1833
|
+
type CustomComponentProp = InferOutput<typeof CustomComponentPropSchema>;
|
|
1834
|
+
type CustomHooks = InferOutput<typeof CustomHooksSchema>;
|
|
1899
1835
|
type ESLintReactSettings = InferOutput<typeof ESLintReactSettingsSchema>;
|
|
1900
1836
|
type ESLintSettings = InferOutput<typeof ESLintSettingsSchema>;
|
|
1901
|
-
/**
|
|
1902
|
-
* This is an expanded version of `ESLintReactSettings` with all shorthand properties expanded.
|
|
1903
|
-
* @internal
|
|
1904
|
-
*/
|
|
1905
|
-
interface ESLintReactSettingsNormalized extends ESLintReactSettings {
|
|
1906
|
-
additionalComponents: CustomComponentNormalized[];
|
|
1907
|
-
version: string;
|
|
1908
|
-
}
|
|
1909
1837
|
/**
|
|
1910
1838
|
* The default ESLint settings for "react-x".
|
|
1911
1839
|
*/
|
|
1912
1840
|
declare const DEFAULT_ESLINT_REACT_SETTINGS: {
|
|
1913
|
-
readonly
|
|
1914
|
-
|
|
1915
|
-
|
|
1841
|
+
readonly importSource: "react";
|
|
1842
|
+
readonly jsxPragma: "createElement";
|
|
1843
|
+
readonly jsxPragmaFrag: "Fragment";
|
|
1916
1844
|
readonly polymorphicPropName: "as";
|
|
1845
|
+
readonly strict: false;
|
|
1917
1846
|
readonly strictImportCheck: false;
|
|
1918
1847
|
readonly version: "detect";
|
|
1848
|
+
readonly additionalHooks: {
|
|
1849
|
+
readonly useLayoutEffect: ["useIsomorphicLayoutEffect"];
|
|
1850
|
+
};
|
|
1851
|
+
readonly additionalComponents?: {
|
|
1852
|
+
name: string;
|
|
1853
|
+
as?: string;
|
|
1854
|
+
attributes?: {
|
|
1855
|
+
name: string;
|
|
1856
|
+
as?: string;
|
|
1857
|
+
controlled?: boolean;
|
|
1858
|
+
defaultValue?: string;
|
|
1859
|
+
}[];
|
|
1860
|
+
selector?: string;
|
|
1861
|
+
}[];
|
|
1919
1862
|
};
|
|
1920
1863
|
|
|
1921
1864
|
interface Dictionary<Type> {
|
|
@@ -2184,6 +2127,29 @@ type PartialObjectDeep<ObjectType extends object, Options extends PartialDeepOpt
|
|
|
2184
2127
|
[KeyType in keyof ObjectType]?: PartialDeep<ObjectType[KeyType], Options>
|
|
2185
2128
|
};
|
|
2186
2129
|
|
|
2130
|
+
interface CustomComponentNormalized {
|
|
2131
|
+
name: string;
|
|
2132
|
+
as: string;
|
|
2133
|
+
attributes: CustomComponentPropNormalized[];
|
|
2134
|
+
re: RegExp;
|
|
2135
|
+
}
|
|
2136
|
+
interface CustomComponentPropNormalized {
|
|
2137
|
+
name: string;
|
|
2138
|
+
as: string;
|
|
2139
|
+
defaultValue?: string | _;
|
|
2140
|
+
}
|
|
2141
|
+
/**
|
|
2142
|
+
* The normalized version of the `ESLintReactSettings`.
|
|
2143
|
+
* @internal
|
|
2144
|
+
*/
|
|
2145
|
+
interface ESLintReactSettingsNormalized {
|
|
2146
|
+
additionalComponents: CustomComponentNormalized[];
|
|
2147
|
+
additionalHooks: CustomHooks;
|
|
2148
|
+
importSource: string;
|
|
2149
|
+
polymorphicPropName: string | _;
|
|
2150
|
+
strictImportCheck: boolean;
|
|
2151
|
+
version: string;
|
|
2152
|
+
}
|
|
2187
2153
|
/**
|
|
2188
2154
|
* Unsafely casts settings from a data object from `context.settings`.
|
|
2189
2155
|
* @internal
|
|
@@ -2199,12 +2165,12 @@ declare function unsafeDecodeSettings(data: unknown): PartialDeep<ESLintReactSet
|
|
|
2199
2165
|
*/
|
|
2200
2166
|
declare const decodeSettings: Memoized<(data: unknown) => ESLintReactSettings>;
|
|
2201
2167
|
/**
|
|
2202
|
-
*
|
|
2168
|
+
* The memoized version of `ESLintReactSettings`.
|
|
2203
2169
|
* @param settings The settings.
|
|
2204
2170
|
* @returns The normalized settings.
|
|
2205
2171
|
* @internal
|
|
2206
2172
|
*/
|
|
2207
|
-
declare const
|
|
2173
|
+
declare const toNormalizedSettings: Memoized<({ additionalComponents, additionalHooks, importSource, polymorphicPropName, version, ...rest }: ESLintReactSettings) => ESLintReactSettingsNormalized>;
|
|
2208
2174
|
declare function getSettingsFromContext(context: {
|
|
2209
2175
|
settings: unknown;
|
|
2210
2176
|
}): ESLintReactSettingsNormalized;
|
|
@@ -2263,4 +2229,4 @@ type RuleNamespace = "x" | "dom" | "web-api" | "hooks-extra" | "naming-conventio
|
|
|
2263
2229
|
*/
|
|
2264
2230
|
type RuleFeature = "CFG" | "CHK" | "DBG" | "FIX" | "MOD" | "TSC";
|
|
2265
2231
|
|
|
2266
|
-
export { type
|
|
2232
|
+
export { type CustomComponent, type CustomComponentNormalized, type CustomComponentProp, type CustomComponentPropNormalized, CustomComponentPropSchema, CustomComponentSchema, type CustomHooks, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, DOM_HTML_COMPONENT_TYPES, DOM_SVG_COMPONENT_TYPES, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, type RuleContext, type RuleDeclaration, type RuleFeature, type RuleNamespace, type RuleOptions, type RulePreset, type RuleSeverity, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, toNormalizedSettings, unsafeDecodeSettings };
|