@eslint-react/shared 1.24.0-beta.0 → 1.24.0-beta.16
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 +304 -308
- package/dist/index.d.ts +304 -308
- package/dist/index.js +101 -105
- package/dist/index.mjs +98 -102
- package/package.json +4 -4
package/dist/index.d.mts
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,69 +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
|
-
* The name of the attribute in the user-defined component.
|
|
1498
|
-
* @example
|
|
1499
|
-
* "to"
|
|
1500
|
-
*/
|
|
1501
|
-
readonly name: StringSchema<undefined>;
|
|
1502
|
-
/**
|
|
1503
|
-
* The name of the attribute in the built-in component.
|
|
1504
|
-
* @example
|
|
1505
|
-
* "href"
|
|
1506
|
-
*/
|
|
1507
|
-
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1508
|
-
/**
|
|
1509
|
-
* Whether the attribute is controlled or not in the user-defined component.
|
|
1510
|
-
* @example
|
|
1511
|
-
* `true`
|
|
1512
|
-
*/
|
|
1513
|
-
readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
1514
|
-
/**
|
|
1515
|
-
* The default value of the attribute in the user-defined component.
|
|
1516
|
-
* @example
|
|
1517
|
-
* `"/"`
|
|
1518
|
-
*/
|
|
1519
|
-
readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1520
|
-
}, undefined>, undefined>, readonly []>;
|
|
1521
|
-
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
|
+
*/
|
|
1522
1422
|
readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1523
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>;
|
|
1524
1445
|
/**
|
|
1525
1446
|
* @internal
|
|
1526
1447
|
*/
|
|
@@ -1554,11 +1475,11 @@ declare const ESLintReactSettingsSchema: ObjectSchema<{
|
|
|
1554
1475
|
/**
|
|
1555
1476
|
* @internal
|
|
1556
1477
|
*/
|
|
1557
|
-
readonly strict: OptionalSchema<BooleanSchema<undefined>,
|
|
1478
|
+
readonly strict: OptionalSchema<BooleanSchema<undefined>, false>;
|
|
1558
1479
|
/**
|
|
1559
1480
|
* @internal
|
|
1560
1481
|
*/
|
|
1561
|
-
readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>,
|
|
1482
|
+
readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, false>;
|
|
1562
1483
|
/**
|
|
1563
1484
|
* React version to use, "detect" means auto detect React version from the project’s dependencies.
|
|
1564
1485
|
* If `importSource` is specified, an equivalent version of React should be provided here.
|
|
@@ -1566,6 +1487,32 @@ declare const ESLintReactSettingsSchema: ObjectSchema<{
|
|
|
1566
1487
|
* @default `"detect"`
|
|
1567
1488
|
*/
|
|
1568
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>;
|
|
1569
1516
|
/**
|
|
1570
1517
|
* An array of user-defined components
|
|
1571
1518
|
* @description This is used to inform the ESLint React plugins how to treat these components during checks.
|
|
@@ -1578,12 +1525,6 @@ declare const ESLintReactSettingsSchema: ObjectSchema<{
|
|
|
1578
1525
|
* "Link"
|
|
1579
1526
|
*/
|
|
1580
1527
|
readonly name: StringSchema<undefined>;
|
|
1581
|
-
/**
|
|
1582
|
-
* The ESQuery selector to select the component precisely.
|
|
1583
|
-
* @example
|
|
1584
|
-
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
1585
|
-
*/
|
|
1586
|
-
readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1587
1528
|
/**
|
|
1588
1529
|
* The name of the built-in component that the user-defined component represents.
|
|
1589
1530
|
* @example
|
|
@@ -1591,63 +1532,44 @@ declare const ESLintReactSettingsSchema: ObjectSchema<{
|
|
|
1591
1532
|
*/
|
|
1592
1533
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1593
1534
|
/**
|
|
1594
|
-
*
|
|
1535
|
+
* Attributes mapping between the user-defined component and the built-in component.
|
|
1595
1536
|
* @example
|
|
1596
1537
|
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
|
|
1597
1538
|
*/
|
|
1598
1539
|
readonly attributes: OptionalSchema<ArraySchema<ObjectSchema<{
|
|
1599
1540
|
/**
|
|
1600
|
-
* The name of the
|
|
1541
|
+
* The name of the prop in the user-defined component.
|
|
1601
1542
|
* @example
|
|
1602
1543
|
* "to"
|
|
1603
1544
|
*/
|
|
1604
1545
|
readonly name: StringSchema<undefined>;
|
|
1605
1546
|
/**
|
|
1606
|
-
* The name of the
|
|
1547
|
+
* The name of the prop in the built-in component.
|
|
1607
1548
|
* @example
|
|
1608
1549
|
* "href"
|
|
1609
1550
|
*/
|
|
1610
1551
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1611
1552
|
/**
|
|
1612
|
-
* Whether the
|
|
1553
|
+
* Whether the prop is controlled or not in the user-defined component.
|
|
1613
1554
|
* @example
|
|
1614
1555
|
* `true`
|
|
1615
1556
|
*/
|
|
1616
1557
|
readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
1617
1558
|
/**
|
|
1618
|
-
* The default value of the
|
|
1559
|
+
* The default value of the prop in the user-defined component.
|
|
1619
1560
|
* @example
|
|
1620
1561
|
* `"/"`
|
|
1621
1562
|
*/
|
|
1622
1563
|
readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1623
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>;
|
|
1624
1572
|
}, undefined>, undefined>, undefined>;
|
|
1625
|
-
/**
|
|
1626
|
-
* A object of aliases for React built-in hooks.
|
|
1627
|
-
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
|
|
1628
|
-
* @example `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }`
|
|
1629
|
-
*/
|
|
1630
|
-
readonly additionalHooks: OptionalSchema<ObjectSchema<{
|
|
1631
|
-
readonly use: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1632
|
-
readonly useActionState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1633
|
-
readonly useCallback: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1634
|
-
readonly useContext: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1635
|
-
readonly useDebugValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1636
|
-
readonly useDeferredValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1637
|
-
readonly useEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1638
|
-
readonly useFormStatus: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1639
|
-
readonly useId: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1640
|
-
readonly useImperativeHandle: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1641
|
-
readonly useInsertionEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1642
|
-
readonly useLayoutEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1643
|
-
readonly useMemo: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1644
|
-
readonly useOptimistic: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1645
|
-
readonly useReducer: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1646
|
-
readonly useRef: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1647
|
-
readonly useState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1648
|
-
readonly useSyncExternalStore: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1649
|
-
readonly useTransition: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1650
|
-
}, undefined>, undefined>;
|
|
1651
1573
|
}, undefined>;
|
|
1652
1574
|
/**
|
|
1653
1575
|
* @internal
|
|
@@ -1683,11 +1605,11 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1683
1605
|
/**
|
|
1684
1606
|
* @internal
|
|
1685
1607
|
*/
|
|
1686
|
-
readonly strict: OptionalSchema<BooleanSchema<undefined>,
|
|
1608
|
+
readonly strict: OptionalSchema<BooleanSchema<undefined>, false>;
|
|
1687
1609
|
/**
|
|
1688
1610
|
* @internal
|
|
1689
1611
|
*/
|
|
1690
|
-
readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>,
|
|
1612
|
+
readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, false>;
|
|
1691
1613
|
/**
|
|
1692
1614
|
* React version to use, "detect" means auto detect React version from the project’s dependencies.
|
|
1693
1615
|
* If `importSource` is specified, an equivalent version of React should be provided here.
|
|
@@ -1695,6 +1617,32 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1695
1617
|
* @default `"detect"`
|
|
1696
1618
|
*/
|
|
1697
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>;
|
|
1698
1646
|
/**
|
|
1699
1647
|
* An array of user-defined components
|
|
1700
1648
|
* @description This is used to inform the ESLint React plugins how to treat these components during checks.
|
|
@@ -1707,12 +1655,6 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1707
1655
|
* "Link"
|
|
1708
1656
|
*/
|
|
1709
1657
|
readonly name: StringSchema<undefined>;
|
|
1710
|
-
/**
|
|
1711
|
-
* The ESQuery selector to select the component precisely.
|
|
1712
|
-
* @example
|
|
1713
|
-
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
1714
|
-
*/
|
|
1715
|
-
readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1716
1658
|
/**
|
|
1717
1659
|
* The name of the built-in component that the user-defined component represents.
|
|
1718
1660
|
* @example
|
|
@@ -1720,63 +1662,44 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1720
1662
|
*/
|
|
1721
1663
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1722
1664
|
/**
|
|
1723
|
-
*
|
|
1665
|
+
* Attributes mapping between the user-defined component and the built-in component.
|
|
1724
1666
|
* @example
|
|
1725
1667
|
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
|
|
1726
1668
|
*/
|
|
1727
1669
|
readonly attributes: OptionalSchema<ArraySchema<ObjectSchema<{
|
|
1728
1670
|
/**
|
|
1729
|
-
* The name of the
|
|
1671
|
+
* The name of the prop in the user-defined component.
|
|
1730
1672
|
* @example
|
|
1731
1673
|
* "to"
|
|
1732
1674
|
*/
|
|
1733
1675
|
readonly name: StringSchema<undefined>;
|
|
1734
1676
|
/**
|
|
1735
|
-
* The name of the
|
|
1677
|
+
* The name of the prop in the built-in component.
|
|
1736
1678
|
* @example
|
|
1737
1679
|
* "href"
|
|
1738
1680
|
*/
|
|
1739
1681
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1740
1682
|
/**
|
|
1741
|
-
* Whether the
|
|
1683
|
+
* Whether the prop is controlled or not in the user-defined component.
|
|
1742
1684
|
* @example
|
|
1743
1685
|
* `true`
|
|
1744
1686
|
*/
|
|
1745
1687
|
readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
1746
1688
|
/**
|
|
1747
|
-
* The default value of the
|
|
1689
|
+
* The default value of the prop in the user-defined component.
|
|
1748
1690
|
* @example
|
|
1749
1691
|
* `"/"`
|
|
1750
1692
|
*/
|
|
1751
1693
|
readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1752
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>;
|
|
1753
1702
|
}, undefined>, undefined>, undefined>;
|
|
1754
|
-
/**
|
|
1755
|
-
* A object of aliases for React built-in hooks.
|
|
1756
|
-
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
|
|
1757
|
-
* @example `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }`
|
|
1758
|
-
*/
|
|
1759
|
-
readonly additionalHooks: OptionalSchema<ObjectSchema<{
|
|
1760
|
-
readonly use: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1761
|
-
readonly useActionState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1762
|
-
readonly useCallback: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1763
|
-
readonly useContext: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1764
|
-
readonly useDebugValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1765
|
-
readonly useDeferredValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1766
|
-
readonly useEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1767
|
-
readonly useFormStatus: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1768
|
-
readonly useId: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1769
|
-
readonly useImperativeHandle: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1770
|
-
readonly useInsertionEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1771
|
-
readonly useLayoutEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1772
|
-
readonly useMemo: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1773
|
-
readonly useOptimistic: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1774
|
-
readonly useReducer: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1775
|
-
readonly useRef: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1776
|
-
readonly useState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1777
|
-
readonly useSyncExternalStore: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1778
|
-
readonly useTransition: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1779
|
-
}, undefined>, undefined>;
|
|
1780
1703
|
}, undefined>, undefined>;
|
|
1781
1704
|
/** @deprecated Use `react-x` instead */
|
|
1782
1705
|
readonly reactOptions: OptionalSchema<ObjectSchema<{
|
|
@@ -1809,11 +1732,11 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1809
1732
|
/**
|
|
1810
1733
|
* @internal
|
|
1811
1734
|
*/
|
|
1812
|
-
readonly strict: OptionalSchema<BooleanSchema<undefined>,
|
|
1735
|
+
readonly strict: OptionalSchema<BooleanSchema<undefined>, false>;
|
|
1813
1736
|
/**
|
|
1814
1737
|
* @internal
|
|
1815
1738
|
*/
|
|
1816
|
-
readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>,
|
|
1739
|
+
readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, false>;
|
|
1817
1740
|
/**
|
|
1818
1741
|
* React version to use, "detect" means auto detect React version from the project’s dependencies.
|
|
1819
1742
|
* If `importSource` is specified, an equivalent version of React should be provided here.
|
|
@@ -1821,6 +1744,32 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1821
1744
|
* @default `"detect"`
|
|
1822
1745
|
*/
|
|
1823
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>;
|
|
1824
1773
|
/**
|
|
1825
1774
|
* An array of user-defined components
|
|
1826
1775
|
* @description This is used to inform the ESLint React plugins how to treat these components during checks.
|
|
@@ -1833,12 +1782,6 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1833
1782
|
* "Link"
|
|
1834
1783
|
*/
|
|
1835
1784
|
readonly name: StringSchema<undefined>;
|
|
1836
|
-
/**
|
|
1837
|
-
* The ESQuery selector to select the component precisely.
|
|
1838
|
-
* @example
|
|
1839
|
-
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
1840
|
-
*/
|
|
1841
|
-
readonly selector: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1842
1785
|
/**
|
|
1843
1786
|
* The name of the built-in component that the user-defined component represents.
|
|
1844
1787
|
* @example
|
|
@@ -1846,79 +1789,77 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
|
|
|
1846
1789
|
*/
|
|
1847
1790
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1848
1791
|
/**
|
|
1849
|
-
*
|
|
1792
|
+
* Attributes mapping between the user-defined component and the built-in component.
|
|
1850
1793
|
* @example
|
|
1851
1794
|
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
|
|
1852
1795
|
*/
|
|
1853
1796
|
readonly attributes: OptionalSchema<ArraySchema<ObjectSchema<{
|
|
1854
1797
|
/**
|
|
1855
|
-
* The name of the
|
|
1798
|
+
* The name of the prop in the user-defined component.
|
|
1856
1799
|
* @example
|
|
1857
1800
|
* "to"
|
|
1858
1801
|
*/
|
|
1859
1802
|
readonly name: StringSchema<undefined>;
|
|
1860
1803
|
/**
|
|
1861
|
-
* The name of the
|
|
1804
|
+
* The name of the prop in the built-in component.
|
|
1862
1805
|
* @example
|
|
1863
1806
|
* "href"
|
|
1864
1807
|
*/
|
|
1865
1808
|
readonly as: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1866
1809
|
/**
|
|
1867
|
-
* Whether the
|
|
1810
|
+
* Whether the prop is controlled or not in the user-defined component.
|
|
1868
1811
|
* @example
|
|
1869
1812
|
* `true`
|
|
1870
1813
|
*/
|
|
1871
1814
|
readonly controlled: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
1872
1815
|
/**
|
|
1873
|
-
* The default value of the
|
|
1816
|
+
* The default value of the prop in the user-defined component.
|
|
1874
1817
|
* @example
|
|
1875
1818
|
* `"/"`
|
|
1876
1819
|
*/
|
|
1877
1820
|
readonly defaultValue: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1878
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>;
|
|
1879
1829
|
}, undefined>, undefined>, undefined>;
|
|
1880
|
-
/**
|
|
1881
|
-
* A object of aliases for React built-in hooks.
|
|
1882
|
-
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
|
|
1883
|
-
* @example `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }`
|
|
1884
|
-
*/
|
|
1885
|
-
readonly additionalHooks: OptionalSchema<ObjectSchema<{
|
|
1886
|
-
readonly use: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1887
|
-
readonly useActionState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1888
|
-
readonly useCallback: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1889
|
-
readonly useContext: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1890
|
-
readonly useDebugValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1891
|
-
readonly useDeferredValue: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1892
|
-
readonly useEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1893
|
-
readonly useFormStatus: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1894
|
-
readonly useId: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1895
|
-
readonly useImperativeHandle: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1896
|
-
readonly useInsertionEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1897
|
-
readonly useLayoutEffect: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1898
|
-
readonly useMemo: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1899
|
-
readonly useOptimistic: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1900
|
-
readonly useReducer: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1901
|
-
readonly useRef: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1902
|
-
readonly useState: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1903
|
-
readonly useSyncExternalStore: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1904
|
-
readonly useTransition: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, undefined>;
|
|
1905
|
-
}, undefined>, undefined>;
|
|
1906
1830
|
}, undefined>, undefined>;
|
|
1907
1831
|
}, undefined>, {}>;
|
|
1908
|
-
type CustomHook = InferOutput<typeof CustomHookSchema>;
|
|
1909
|
-
type CustomAttribute = InferOutput<typeof CustomAttributeSchema>;
|
|
1910
1832
|
type CustomComponent = InferOutput<typeof CustomComponentSchema>;
|
|
1911
|
-
type
|
|
1833
|
+
type CustomComponentProp = InferOutput<typeof CustomComponentPropSchema>;
|
|
1834
|
+
type CustomHooks = InferOutput<typeof CustomHooksSchema>;
|
|
1912
1835
|
type ESLintReactSettings = InferOutput<typeof ESLintReactSettingsSchema>;
|
|
1913
1836
|
type ESLintSettings = InferOutput<typeof ESLintSettingsSchema>;
|
|
1914
1837
|
/**
|
|
1915
|
-
*
|
|
1916
|
-
* @internal
|
|
1838
|
+
* The default ESLint settings for "react-x".
|
|
1917
1839
|
*/
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1840
|
+
declare const DEFAULT_ESLINT_REACT_SETTINGS: {
|
|
1841
|
+
readonly importSource: "react";
|
|
1842
|
+
readonly jsxPragma: "createElement";
|
|
1843
|
+
readonly jsxPragmaFrag: "Fragment";
|
|
1844
|
+
readonly polymorphicPropName: "as";
|
|
1845
|
+
readonly strict: false;
|
|
1846
|
+
readonly strictImportCheck: false;
|
|
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
|
+
}[];
|
|
1862
|
+
};
|
|
1922
1863
|
|
|
1923
1864
|
interface Dictionary<Type> {
|
|
1924
1865
|
[key: string]: Type;
|
|
@@ -2186,17 +2127,29 @@ type PartialObjectDeep<ObjectType extends object, Options extends PartialDeepOpt
|
|
|
2186
2127
|
[KeyType in keyof ObjectType]?: PartialDeep<ObjectType[KeyType], Options>
|
|
2187
2128
|
};
|
|
2188
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
|
+
}
|
|
2189
2141
|
/**
|
|
2190
|
-
* The
|
|
2142
|
+
* The normalized version of the `ESLintReactSettings`.
|
|
2143
|
+
* @internal
|
|
2191
2144
|
*/
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
}
|
|
2145
|
+
interface ESLintReactSettingsNormalized {
|
|
2146
|
+
additionalComponents: CustomComponentNormalized[];
|
|
2147
|
+
additionalHooks: CustomHooks;
|
|
2148
|
+
importSource: string;
|
|
2149
|
+
polymorphicPropName: string | _;
|
|
2150
|
+
strictImportCheck: boolean;
|
|
2151
|
+
version: string;
|
|
2152
|
+
}
|
|
2200
2153
|
/**
|
|
2201
2154
|
* Unsafely casts settings from a data object from `context.settings`.
|
|
2202
2155
|
* @internal
|
|
@@ -2212,12 +2165,12 @@ declare function unsafeDecodeSettings(data: unknown): PartialDeep<ESLintReactSet
|
|
|
2212
2165
|
*/
|
|
2213
2166
|
declare const decodeSettings: Memoized<(data: unknown) => ESLintReactSettings>;
|
|
2214
2167
|
/**
|
|
2215
|
-
*
|
|
2168
|
+
* The memoized version of `ESLintReactSettings`.
|
|
2216
2169
|
* @param settings The settings.
|
|
2217
2170
|
* @returns The normalized settings.
|
|
2218
2171
|
* @internal
|
|
2219
2172
|
*/
|
|
2220
|
-
declare const
|
|
2173
|
+
declare const toNormalizedSettings: Memoized<({ additionalComponents, additionalHooks, importSource, polymorphicPropName, version, ...rest }: ESLintReactSettings) => ESLintReactSettingsNormalized>;
|
|
2221
2174
|
declare function getSettingsFromContext(context: {
|
|
2222
2175
|
settings: unknown;
|
|
2223
2176
|
}): ESLintReactSettingsNormalized;
|
|
@@ -2233,4 +2186,47 @@ declare module "@typescript-eslint/utils/ts-eslint" {
|
|
|
2233
2186
|
}
|
|
2234
2187
|
}
|
|
2235
2188
|
|
|
2236
|
-
|
|
2189
|
+
/**
|
|
2190
|
+
* Rule severity.
|
|
2191
|
+
* @since 0.0.1
|
|
2192
|
+
*/
|
|
2193
|
+
type RuleSeverity = "error" | "off" | "warn";
|
|
2194
|
+
/**
|
|
2195
|
+
* Rule declaration.
|
|
2196
|
+
* @internal
|
|
2197
|
+
* @since 0.0.1
|
|
2198
|
+
*/
|
|
2199
|
+
type RuleDeclaration = [RuleSeverity, Record<string, unknown>?] | RuleSeverity;
|
|
2200
|
+
/**
|
|
2201
|
+
* Rule config preset.
|
|
2202
|
+
* @since 0.0.1
|
|
2203
|
+
*/
|
|
2204
|
+
type RulePreset = Record<string, RuleDeclaration>;
|
|
2205
|
+
/**
|
|
2206
|
+
* Rule creator function.
|
|
2207
|
+
* @since 0.0.1
|
|
2208
|
+
* @internal
|
|
2209
|
+
*/
|
|
2210
|
+
type RuleCreator = Parameters<ReturnType<typeof ESLintUtils.RuleCreator>>[0]["create"];
|
|
2211
|
+
/**
|
|
2212
|
+
* Rule context.
|
|
2213
|
+
* @since 0.0.1
|
|
2214
|
+
*/
|
|
2215
|
+
type RuleContext = Parameters<RuleCreator>[0];
|
|
2216
|
+
/**
|
|
2217
|
+
* Rule options.
|
|
2218
|
+
* @since 0.0.1
|
|
2219
|
+
*/
|
|
2220
|
+
type RuleOptions = Parameters<RuleCreator>[1];
|
|
2221
|
+
/**
|
|
2222
|
+
* Rule namespace.
|
|
2223
|
+
* @since 0.0.1
|
|
2224
|
+
*/
|
|
2225
|
+
type RuleNamespace = "x" | "dom" | "web-api" | "hooks-extra" | "naming-convention" | "debug";
|
|
2226
|
+
/**
|
|
2227
|
+
* Rule feature.
|
|
2228
|
+
* @since 1.20.0
|
|
2229
|
+
*/
|
|
2230
|
+
type RuleFeature = "CFG" | "CHK" | "DBG" | "FIX" | "MOD" | "TSC";
|
|
2231
|
+
|
|
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 };
|