@eslint-react/shared 1.52.10-next.0 → 1.52.10-next.1

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.ts CHANGED
@@ -1,8 +1,10 @@
1
- import * as _eslint_react_kit from '@eslint-react/kit';
2
- import { CompatiblePlugin, CompatibleConfig, RuleContext } from '@eslint-react/kit';
3
- import { unit } from '@eslint-react/eff';
4
- import { z } from 'zod/v4';
1
+ import * as _eslint_react_kit0 from "@eslint-react/kit";
2
+ import { CompatibleConfig, CompatiblePlugin, RuleContext } from "@eslint-react/kit";
3
+ import { unit } from "@eslint-react/eff";
4
+ import { PartialDeep } from "type-fest";
5
+ import { z } from "zod/v4";
5
6
 
7
+ //#region src/constants.d.ts
6
8
  /**
7
9
  * The NPM scope for this project.
8
10
  */
@@ -15,22 +17,26 @@ declare const GITHUB_URL = "https://github.com/Rel1cx/eslint-react";
15
17
  * The URL to the project's website.
16
18
  */
17
19
  declare const WEBSITE_URL = "https://eslint-react.xyz";
18
-
20
+ //#endregion
21
+ //#region src/get-config-adapters.d.ts
19
22
  declare function getConfigAdapters(pluginName: string, plugin: CompatiblePlugin): {
20
- readonly toFlatConfig: (config: CompatibleConfig) => {
21
- plugins: {
22
- [pluginName]: CompatiblePlugin;
23
- };
24
- name?: string;
25
- rules?: Record<string, _eslint_react_kit.RuleConfig>;
26
- settings?: _eslint_react_kit.SettingsConfig;
27
- };
28
- readonly toLegacyConfig: ({ rules }: CompatibleConfig) => {
29
- plugins: string[];
30
- rules: Record<string, _eslint_react_kit.RuleConfig<unknown[]>> | undefined;
23
+ readonly toFlatConfig: (config: CompatibleConfig) => {
24
+ plugins: {
25
+ [pluginName]: CompatiblePlugin;
31
26
  };
27
+ name?: string;
28
+ rules?: Record<string, _eslint_react_kit0.RuleConfig>;
29
+ settings?: _eslint_react_kit0.SettingsConfig;
30
+ };
31
+ readonly toLegacyConfig: ({
32
+ rules
33
+ }: CompatibleConfig) => {
34
+ plugins: string[];
35
+ rules: Record<string, _eslint_react_kit0.RuleConfig<unknown[]>> | undefined;
36
+ };
32
37
  };
33
-
38
+ //#endregion
39
+ //#region src/get-doc-url.d.ts
34
40
  /**
35
41
  * Get the URL for the documentation of a rule in a plugin.
36
42
  * @internal
@@ -38,704 +44,19 @@ declare function getConfigAdapters(pluginName: string, plugin: CompatiblePlugin)
38
44
  * @returns The URL for the documentation of a rule.
39
45
  */
40
46
  declare const getDocsUrl: (pluginName: string) => (ruleName: string) => string;
41
-
47
+ //#endregion
48
+ //#region src/get-id.d.ts
42
49
  declare const getId: () => string;
43
-
50
+ //#endregion
51
+ //#region src/get-react-version.d.ts
44
52
  declare function getReactVersion(fallback: string): string;
45
-
46
- /**
47
- Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
48
-
49
- @category Type
50
- */
51
- type Primitive =
52
- | null
53
- | undefined
54
- | string
55
- | number
56
- | boolean
57
- | symbol
58
- | bigint;
59
-
60
- declare global {
61
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
62
- interface SymbolConstructor {
63
- readonly observable: symbol;
64
- }
65
- }
66
-
67
- /**
68
- Extract all optional keys from the given type.
69
-
70
- This is useful when you want to create a new type that contains different type values for the optional keys only.
71
-
72
- @example
73
- ```
74
- import type {OptionalKeysOf, Except} from 'type-fest';
75
-
76
- interface User {
77
- name: string;
78
- surname: string;
79
-
80
- luckyNumber?: number;
81
- }
82
-
83
- const REMOVE_FIELD = Symbol('remove field symbol');
84
- type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
85
- [Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
86
- };
87
-
88
- const update1: UpdateOperation<User> = {
89
- name: 'Alice'
90
- };
91
-
92
- const update2: UpdateOperation<User> = {
93
- name: 'Bob',
94
- luckyNumber: REMOVE_FIELD
95
- };
96
- ```
97
-
98
- @category Utilities
99
- */
100
- type OptionalKeysOf<BaseType extends object> =
101
- BaseType extends unknown // For distributing `BaseType`
102
- ? (keyof {
103
- [Key in keyof BaseType as BaseType extends Record<Key, BaseType[Key]> ? never : Key]: never
104
- }) & (keyof BaseType) // Intersect with `keyof BaseType` to ensure result of `OptionalKeysOf<BaseType>` is always assignable to `keyof BaseType`
105
- : never; // Should never happen
106
-
107
- /**
108
- Extract all required keys from the given type.
109
-
110
- This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...
111
-
112
- @example
113
- ```
114
- import type {RequiredKeysOf} from 'type-fest';
115
-
116
- declare function createValidation<Entity extends object, Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>>(field: Key, validator: (value: Entity[Key]) => boolean): ValidatorFn;
117
-
118
- interface User {
119
- name: string;
120
- surname: string;
121
-
122
- luckyNumber?: number;
123
- }
124
-
125
- const validator1 = createValidation<User>('name', value => value.length < 25);
126
- const validator2 = createValidation<User>('surname', value => value.length < 25);
127
- ```
128
-
129
- @category Utilities
130
- */
131
- type RequiredKeysOf<BaseType extends object> =
132
- BaseType extends unknown // For distributing `BaseType`
133
- ? Exclude<keyof BaseType, OptionalKeysOf<BaseType>>
134
- : never; // Should never happen
135
-
136
- /**
137
- Returns a boolean for whether the given type is `never`.
138
-
139
- @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
140
- @link https://stackoverflow.com/a/53984913/10292952
141
- @link https://www.zhenghao.io/posts/ts-never
142
-
143
- Useful in type utilities, such as checking if something does not occur.
144
-
145
- @example
146
- ```
147
- import type {IsNever, And} from 'type-fest';
148
-
149
- // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
150
- type AreStringsEqual<A extends string, B extends string> =
151
- And<
152
- IsNever<Exclude<A, B>> extends true ? true : false,
153
- IsNever<Exclude<B, A>> extends true ? true : false
154
- >;
155
-
156
- type EndIfEqual<I extends string, O extends string> =
157
- AreStringsEqual<I, O> extends true
158
- ? never
159
- : void;
160
-
161
- function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
162
- if (input === output) {
163
- process.exit(0);
164
- }
165
- }
166
-
167
- endIfEqual('abc', 'abc');
168
- //=> never
169
-
170
- endIfEqual('abc', '123');
171
- //=> void
172
- ```
173
-
174
- @category Type Guard
175
- @category Utilities
176
- */
177
- type IsNever<T> = [T] extends [never] ? true : false;
178
-
179
- /**
180
- An if-else-like type that resolves depending on whether the given type is `never`.
181
-
182
- @see {@link IsNever}
183
-
184
- @example
185
- ```
186
- import type {IfNever} from 'type-fest';
187
-
188
- type ShouldBeTrue = IfNever<never>;
189
- //=> true
190
-
191
- type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
192
- //=> 'bar'
193
- ```
194
-
195
- @category Type Guard
196
- @category Utilities
197
- */
198
- type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
199
- IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
200
- );
201
-
202
- // Can eventually be replaced with the built-in once this library supports
203
- // TS5.4+ only. Tracked in https://github.com/sindresorhus/type-fest/issues/848
204
- type NoInfer<T> = T extends infer U ? U : never;
205
-
206
- /**
207
- Returns a boolean for whether the given type is `any`.
208
-
209
- @link https://stackoverflow.com/a/49928360/1490091
210
-
211
- Useful in type utilities, such as disallowing `any`s to be passed to a function.
212
-
213
- @example
214
- ```
215
- import type {IsAny} from 'type-fest';
216
-
217
- const typedObject = {a: 1, b: 2} as const;
218
- const anyObject: any = {a: 1, b: 2};
219
-
220
- function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
221
- return obj[key];
222
- }
223
-
224
- const typedA = get(typedObject, 'a');
225
- //=> 1
226
-
227
- const anyA = get(anyObject, 'a');
228
- //=> any
229
- ```
230
-
231
- @category Type Guard
232
- @category Utilities
233
- */
234
- type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
235
-
236
- /**
237
- Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
238
-
239
- @example
240
- ```
241
- import type {Simplify} from 'type-fest';
242
-
243
- type PositionProps = {
244
- top: number;
245
- left: number;
246
- };
247
-
248
- type SizeProps = {
249
- width: number;
250
- height: number;
251
- };
252
-
253
- // In your editor, hovering over `Props` will show a flattened object with all the properties.
254
- type Props = Simplify<PositionProps & SizeProps>;
255
- ```
256
-
257
- Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.
258
-
259
- If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.
260
-
261
- @example
262
- ```
263
- import type {Simplify} from 'type-fest';
264
-
265
- interface SomeInterface {
266
- foo: number;
267
- bar?: string;
268
- baz: number | undefined;
269
- }
270
-
271
- type SomeType = {
272
- foo: number;
273
- bar?: string;
274
- baz: number | undefined;
275
- };
276
-
277
- const literal = {foo: 123, bar: 'hello', baz: 456};
278
- const someType: SomeType = literal;
279
- const someInterface: SomeInterface = literal;
280
-
281
- function fn(object: Record<string, unknown>): void {}
282
-
283
- fn(literal); // Good: literal object type is sealed
284
- fn(someType); // Good: type is sealed
285
- fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
286
- fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
287
- ```
288
-
289
- @link https://github.com/microsoft/TypeScript/issues/15300
290
- @see SimplifyDeep
291
- @category Object
292
- */
293
- type Simplify<T> = {[KeyType in keyof T]: T[KeyType]} & {};
294
-
295
- /**
296
- Omit any index signatures from the given object type, leaving only explicitly defined properties.
297
-
298
- This is the counterpart of `PickIndexSignature`.
299
-
300
- Use-cases:
301
- - Remove overly permissive signatures from third-party types.
302
-
303
- This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747).
304
-
305
- It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record<string, unknown>`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', unknown>`.
306
-
307
- (The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.)
308
-
309
- ```
310
- const indexed: Record<string, unknown> = {}; // Allowed
311
-
312
- const keyed: Record<'foo', unknown> = {}; // Error
313
- // => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
314
- ```
315
-
316
- Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another:
317
-
318
- ```
319
- type Indexed = {} extends Record<string, unknown>
320
- ? '✅ `{}` is assignable to `Record<string, unknown>`'
321
- : '❌ `{}` is NOT assignable to `Record<string, unknown>`';
322
- // => '✅ `{}` is assignable to `Record<string, unknown>`'
323
-
324
- type Keyed = {} extends Record<'foo' | 'bar', unknown>
325
- ? "✅ `{}` is assignable to `Record<'foo' | 'bar', unknown>`"
326
- : "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`";
327
- // => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"
328
- ```
329
-
330
- Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`...
331
-
332
- ```
333
- import type {OmitIndexSignature} from 'type-fest';
334
-
335
- type OmitIndexSignature<ObjectType> = {
336
- [KeyType in keyof ObjectType // Map each key of `ObjectType`...
337
- ]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
338
- };
339
- ```
340
-
341
- ...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
342
-
343
- ```
344
- import type {OmitIndexSignature} from 'type-fest';
345
-
346
- type OmitIndexSignature<ObjectType> = {
347
- [KeyType in keyof ObjectType
348
- // Is `{}` assignable to `Record<KeyType, unknown>`?
349
- as {} extends Record<KeyType, unknown>
350
- ? ... // ✅ `{}` is assignable to `Record<KeyType, unknown>`
351
- : ... // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
352
- ]: ObjectType[KeyType];
353
- };
354
- ```
355
-
356
- If `{}` is assignable, it means that `KeyType` is an index signature and we want to remove it. If it is not assignable, `KeyType` is a "real" key and we want to keep it.
357
-
358
- @example
359
- ```
360
- import type {OmitIndexSignature} from 'type-fest';
361
-
362
- interface Example {
363
- // These index signatures will be removed.
364
- [x: string]: any
365
- [x: number]: any
366
- [x: symbol]: any
367
- [x: `head-${string}`]: string
368
- [x: `${string}-tail`]: string
369
- [x: `head-${string}-tail`]: string
370
- [x: `${bigint}`]: string
371
- [x: `embedded-${number}`]: string
372
-
373
- // These explicitly defined keys will remain.
374
- foo: 'bar';
375
- qux?: 'baz';
376
- }
377
-
378
- type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
379
- // => { foo: 'bar'; qux?: 'baz' | undefined; }
380
- ```
381
-
382
- @see PickIndexSignature
383
- @category Object
384
- */
385
- type OmitIndexSignature<ObjectType> = {
386
- [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
387
- ? never
388
- : KeyType]: ObjectType[KeyType];
389
- };
390
-
391
- /**
392
- Pick only index signatures from the given object type, leaving out all explicitly defined properties.
393
-
394
- This is the counterpart of `OmitIndexSignature`.
395
-
396
- @example
397
- ```
398
- import type {PickIndexSignature} from 'type-fest';
399
-
400
- declare const symbolKey: unique symbol;
401
-
402
- type Example = {
403
- // These index signatures will remain.
404
- [x: string]: unknown;
405
- [x: number]: unknown;
406
- [x: symbol]: unknown;
407
- [x: `head-${string}`]: string;
408
- [x: `${string}-tail`]: string;
409
- [x: `head-${string}-tail`]: string;
410
- [x: `${bigint}`]: string;
411
- [x: `embedded-${number}`]: string;
412
-
413
- // These explicitly defined keys will be removed.
414
- ['kebab-case-key']: string;
415
- [symbolKey]: string;
416
- foo: 'bar';
417
- qux?: 'baz';
418
- };
419
-
420
- type ExampleIndexSignature = PickIndexSignature<Example>;
421
- // {
422
- // [x: string]: unknown;
423
- // [x: number]: unknown;
424
- // [x: symbol]: unknown;
425
- // [x: `head-${string}`]: string;
426
- // [x: `${string}-tail`]: string;
427
- // [x: `head-${string}-tail`]: string;
428
- // [x: `${bigint}`]: string;
429
- // [x: `embedded-${number}`]: string;
430
- // }
431
- ```
432
-
433
- @see OmitIndexSignature
434
- @category Object
435
- */
436
- type PickIndexSignature<ObjectType> = {
437
- [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
438
- ? KeyType
439
- : never]: ObjectType[KeyType];
440
- };
441
-
442
- // Merges two objects without worrying about index signatures.
443
- type SimpleMerge<Destination, Source> = {
444
- [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key];
445
- } & Source;
446
-
447
- /**
448
- Merge two types into a new type. Keys of the second type overrides keys of the first type.
449
-
450
- @example
451
- ```
452
- import type {Merge} from 'type-fest';
453
-
454
- interface Foo {
455
- [x: string]: unknown;
456
- [x: number]: unknown;
457
- foo: string;
458
- bar: symbol;
459
- }
460
-
461
- type Bar = {
462
- [x: number]: number;
463
- [x: symbol]: unknown;
464
- bar: Date;
465
- baz: boolean;
466
- };
467
-
468
- export type FooBar = Merge<Foo, Bar>;
469
- // => {
470
- // [x: string]: unknown;
471
- // [x: number]: number;
472
- // [x: symbol]: unknown;
473
- // foo: string;
474
- // bar: Date;
475
- // baz: boolean;
476
- // }
477
- ```
478
-
479
- @category Object
480
- */
481
- type Merge<Destination, Source> =
482
- Simplify<
483
- SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>>
484
- & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>
485
- >;
486
-
487
- /**
488
- An if-else-like type that resolves depending on whether the given type is `any`.
489
-
490
- @see {@link IsAny}
491
-
492
- @example
493
- ```
494
- import type {IfAny} from 'type-fest';
495
-
496
- type ShouldBeTrue = IfAny<any>;
497
- //=> true
498
-
499
- type ShouldBeBar = IfAny<'not any', 'foo', 'bar'>;
500
- //=> 'bar'
501
- ```
502
-
503
- @category Type Guard
504
- @category Utilities
505
- */
506
- type IfAny<T, TypeIfAny = true, TypeIfNotAny = false> = (
507
- IsAny<T> extends true ? TypeIfAny : TypeIfNotAny
508
- );
509
-
510
- /**
511
- Matches any primitive, `void`, `Date`, or `RegExp` value.
512
- */
513
- type BuiltIns = Primitive | void | Date | RegExp;
514
-
515
- /**
516
- Merges user specified options with default options.
517
-
518
- @example
519
- ```
520
- type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
521
- type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
522
- type SpecifiedOptions = {leavesOnly: true};
523
-
524
- type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
525
- //=> {maxRecursionDepth: 10; leavesOnly: true}
526
- ```
527
-
528
- @example
529
- ```
530
- // Complains if default values are not provided for optional options
531
-
532
- type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
533
- type DefaultPathsOptions = {maxRecursionDepth: 10};
534
- type SpecifiedOptions = {};
535
-
536
- type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
537
- // ~~~~~~~~~~~~~~~~~~~
538
- // Property 'leavesOnly' is missing in type 'DefaultPathsOptions' but required in type '{ maxRecursionDepth: number; leavesOnly: boolean; }'.
539
- ```
540
-
541
- @example
542
- ```
543
- // Complains if an option's default type does not conform to the expected type
544
-
545
- type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
546
- type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'};
547
- type SpecifiedOptions = {};
548
-
549
- type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
550
- // ~~~~~~~~~~~~~~~~~~~
551
- // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
552
- ```
553
-
554
- @example
555
- ```
556
- // Complains if an option's specified type does not conform to the expected type
557
-
558
- type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
559
- type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
560
- type SpecifiedOptions = {leavesOnly: 'yes'};
561
-
562
- type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
563
- // ~~~~~~~~~~~~~~~~
564
- // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
565
- ```
566
- */
567
- type ApplyDefaultOptions<
568
- Options extends object,
569
- Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>,
570
- SpecifiedOptions extends Options,
571
- > =
572
- IfAny<SpecifiedOptions, Defaults,
573
- IfNever<SpecifiedOptions, Defaults,
574
- Simplify<Merge<Defaults, {
575
- [Key in keyof SpecifiedOptions
576
- as Key extends OptionalKeysOf<Options>
577
- ? Extract<SpecifiedOptions[Key], undefined> extends never
578
- ? Key
579
- : never
580
- : Key
581
- ]: SpecifiedOptions[Key]
582
- }> & Required<Options>> // `& Required<Options>` ensures that `ApplyDefaultOptions<SomeOption, ...>` is always assignable to `Required<SomeOption>`
583
- >>;
584
-
585
- /**
586
- @see {@link PartialDeep}
587
- */
588
- type PartialDeepOptions = {
589
- /**
590
- Whether to affect the individual elements of arrays and tuples.
591
-
592
- @default false
593
- */
594
- readonly recurseIntoArrays?: boolean;
595
-
596
- /**
597
- Allows `undefined` values in non-tuple arrays.
598
-
599
- - When set to `true`, elements of non-tuple arrays can be `undefined`.
600
- - When set to `false`, only explicitly defined elements are allowed in non-tuple arrays, ensuring stricter type checking.
601
-
602
- @default true
603
-
604
- @example
605
- You can prevent `undefined` values in non-tuple arrays by passing `{recurseIntoArrays: true; allowUndefinedInNonTupleArrays: false}` as the second type argument:
606
-
607
- ```
608
- import type {PartialDeep} from 'type-fest';
609
-
610
- type Settings = {
611
- languages: string[];
612
- };
613
-
614
- declare const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true; allowUndefinedInNonTupleArrays: false}>;
615
-
616
- partialSettings.languages = [undefined]; // Error
617
- partialSettings.languages = []; // Ok
618
- ```
619
- */
620
- readonly allowUndefinedInNonTupleArrays?: boolean;
621
- };
622
-
623
- type DefaultPartialDeepOptions = {
624
- recurseIntoArrays: false;
625
- allowUndefinedInNonTupleArrays: true;
626
- };
627
-
628
- /**
629
- Create a type from another type with all keys and nested keys set to optional.
630
-
631
- Use-cases:
632
- - Merging a default settings/config object with another object, the second object would be a deep partial of the default object.
633
- - Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test.
634
-
635
- @example
636
- ```
637
- import type {PartialDeep} from 'type-fest';
638
-
639
- const settings: Settings = {
640
- textEditor: {
641
- fontSize: 14,
642
- fontColor: '#000000',
643
- fontWeight: 400
644
- },
645
- autocomplete: false,
646
- autosave: true
647
- };
648
-
649
- const applySavedSettings = (savedSettings: PartialDeep<Settings>) => {
650
- return {...settings, ...savedSettings};
651
- }
652
-
653
- settings = applySavedSettings({textEditor: {fontWeight: 500}});
654
- ```
655
-
656
- By default, this does not affect elements in array and tuple types. You can change this by passing `{recurseIntoArrays: true}` as the second type argument:
657
-
658
- ```
659
- import type {PartialDeep} from 'type-fest';
660
-
661
- type Settings = {
662
- languages: string[];
663
- }
664
-
665
- const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true}> = {
666
- languages: [undefined]
667
- };
668
- ```
669
-
670
- @see {@link PartialDeepOptions}
671
-
672
- @category Object
673
- @category Array
674
- @category Set
675
- @category Map
676
- */
677
- type PartialDeep<T, Options extends PartialDeepOptions = {}> =
678
- _PartialDeep<T, ApplyDefaultOptions<PartialDeepOptions, DefaultPartialDeepOptions, Options>>;
679
-
680
- type _PartialDeep<T, Options extends Required<PartialDeepOptions>> = T extends BuiltIns | ((new (...arguments_: any[]) => unknown))
681
- ? T
682
- : IsNever<keyof T> extends true // For functions with no properties
683
- ? T
684
- : T extends Map<infer KeyType, infer ValueType>
685
- ? PartialMapDeep<KeyType, ValueType, Options>
686
- : T extends Set<infer ItemType>
687
- ? PartialSetDeep<ItemType, Options>
688
- : T extends ReadonlyMap<infer KeyType, infer ValueType>
689
- ? PartialReadonlyMapDeep<KeyType, ValueType, Options>
690
- : T extends ReadonlySet<infer ItemType>
691
- ? PartialReadonlySetDeep<ItemType, Options>
692
- : T extends object
693
- ? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
694
- ? Options['recurseIntoArrays'] extends true
695
- ? ItemType[] extends T // Test for arrays (non-tuples) specifically
696
- ? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
697
- ? ReadonlyArray<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>>
698
- : Array<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>>
699
- : PartialObjectDeep<T, Options> // Tuples behave properly
700
- : T // If they don't opt into array testing, just use the original type
701
- : PartialObjectDeep<T, Options>
702
- : unknown;
703
-
704
- /**
705
- Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
706
- */
707
- type PartialMapDeep<KeyType, ValueType, Options extends Required<PartialDeepOptions>> = {} & Map<_PartialDeep<KeyType, Options>, _PartialDeep<ValueType, Options>>;
708
-
709
- /**
710
- Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`.
711
- */
712
- type PartialSetDeep<T, Options extends Required<PartialDeepOptions>> = {} & Set<_PartialDeep<T, Options>>;
713
-
714
- /**
715
- Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`.
716
- */
717
- type PartialReadonlyMapDeep<KeyType, ValueType, Options extends Required<PartialDeepOptions>> = {} & ReadonlyMap<_PartialDeep<KeyType, Options>, _PartialDeep<ValueType, Options>>;
718
-
719
- /**
720
- Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`.
721
- */
722
- type PartialReadonlySetDeep<T, Options extends Required<PartialDeepOptions>> = {} & ReadonlySet<_PartialDeep<T, Options>>;
723
-
724
- /**
725
- Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
726
- */
727
- type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> =
728
- (ObjectType extends (...arguments_: any) => unknown
729
- ? (...arguments_: Parameters<ObjectType>) => ReturnType<ObjectType>
730
- : {}) & ({
731
- [KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options>
732
- });
733
-
53
+ //#endregion
54
+ //#region src/settings.d.ts
734
55
  declare const CustomComponentPropSchema: z.ZodObject<{
735
- name: z.ZodString;
736
- as: z.ZodOptional<z.ZodString>;
737
- controlled: z.ZodOptional<z.ZodBoolean>;
738
- defaultValue: z.ZodOptional<z.ZodString>;
56
+ name: z.ZodString;
57
+ as: z.ZodOptional<z.ZodString>;
58
+ controlled: z.ZodOptional<z.ZodBoolean>;
59
+ defaultValue: z.ZodOptional<z.ZodString>;
739
60
  }, z.core.$strip>;
740
61
  /**
741
62
  * @description
@@ -744,17 +65,49 @@ declare const CustomComponentPropSchema: z.ZodObject<{
744
65
  * Which prop is used as the `href` prop for the user-defined `Link` component that represents the built-in `a` element.
745
66
  */
746
67
  declare const CustomComponentSchema: z.ZodObject<{
68
+ name: z.ZodString;
69
+ as: z.ZodOptional<z.ZodString>;
70
+ attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
747
71
  name: z.ZodString;
748
72
  as: z.ZodOptional<z.ZodString>;
749
- attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
750
- name: z.ZodString;
751
- as: z.ZodOptional<z.ZodString>;
752
- controlled: z.ZodOptional<z.ZodBoolean>;
753
- defaultValue: z.ZodOptional<z.ZodString>;
754
- }, z.core.$strip>>>;
755
- selector: z.ZodOptional<z.ZodString>;
73
+ controlled: z.ZodOptional<z.ZodBoolean>;
74
+ defaultValue: z.ZodOptional<z.ZodString>;
75
+ }, z.core.$strip>>>;
76
+ selector: z.ZodOptional<z.ZodString>;
756
77
  }, z.core.$strip>;
757
78
  declare const CustomHooksSchema: z.ZodObject<{
79
+ use: z.ZodOptional<z.ZodArray<z.ZodString>>;
80
+ useActionState: z.ZodOptional<z.ZodArray<z.ZodString>>;
81
+ useCallback: z.ZodOptional<z.ZodArray<z.ZodString>>;
82
+ useContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
83
+ useDebugValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
84
+ useDeferredValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
85
+ useEffect: z.ZodOptional<z.ZodArray<z.ZodString>>;
86
+ useFormStatus: z.ZodOptional<z.ZodArray<z.ZodString>>;
87
+ useId: z.ZodOptional<z.ZodArray<z.ZodString>>;
88
+ useImperativeHandle: z.ZodOptional<z.ZodArray<z.ZodString>>;
89
+ useInsertionEffect: z.ZodOptional<z.ZodArray<z.ZodString>>;
90
+ useLayoutEffect: z.ZodOptional<z.ZodArray<z.ZodString>>;
91
+ useMemo: z.ZodOptional<z.ZodArray<z.ZodString>>;
92
+ useOptimistic: z.ZodOptional<z.ZodArray<z.ZodString>>;
93
+ useReducer: z.ZodOptional<z.ZodArray<z.ZodString>>;
94
+ useRef: z.ZodOptional<z.ZodArray<z.ZodString>>;
95
+ useState: z.ZodOptional<z.ZodArray<z.ZodString>>;
96
+ useSyncExternalStore: z.ZodOptional<z.ZodArray<z.ZodString>>;
97
+ useTransition: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
+ }, z.core.$strip>;
99
+ /**
100
+ * @internal
101
+ */
102
+ declare const ESLintReactSettingsSchema: z.ZodObject<{
103
+ importSource: z.ZodOptional<z.ZodString>;
104
+ jsxPragma: z.ZodOptional<z.ZodString>;
105
+ jsxPragmaFrag: z.ZodOptional<z.ZodString>;
106
+ polymorphicPropName: z.ZodOptional<z.ZodString>;
107
+ strict: z.ZodOptional<z.ZodBoolean>;
108
+ skipImportCheck: z.ZodOptional<z.ZodBoolean>;
109
+ version: z.ZodOptional<z.ZodString>;
110
+ additionalHooks: z.ZodOptional<z.ZodObject<{
758
111
  use: z.ZodOptional<z.ZodArray<z.ZodString>>;
759
112
  useActionState: z.ZodOptional<z.ZodArray<z.ZodString>>;
760
113
  useCallback: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -774,56 +127,24 @@ declare const CustomHooksSchema: z.ZodObject<{
774
127
  useState: z.ZodOptional<z.ZodArray<z.ZodString>>;
775
128
  useSyncExternalStore: z.ZodOptional<z.ZodArray<z.ZodString>>;
776
129
  useTransition: z.ZodOptional<z.ZodArray<z.ZodString>>;
777
- }, z.core.$strip>;
778
- /**
779
- * @internal
780
- */
781
- declare const ESLintReactSettingsSchema: z.ZodObject<{
782
- importSource: z.ZodOptional<z.ZodString>;
783
- jsxPragma: z.ZodOptional<z.ZodString>;
784
- jsxPragmaFrag: z.ZodOptional<z.ZodString>;
785
- polymorphicPropName: z.ZodOptional<z.ZodString>;
786
- strict: z.ZodOptional<z.ZodBoolean>;
787
- skipImportCheck: z.ZodOptional<z.ZodBoolean>;
788
- version: z.ZodOptional<z.ZodString>;
789
- additionalHooks: z.ZodOptional<z.ZodObject<{
790
- use: z.ZodOptional<z.ZodArray<z.ZodString>>;
791
- useActionState: z.ZodOptional<z.ZodArray<z.ZodString>>;
792
- useCallback: z.ZodOptional<z.ZodArray<z.ZodString>>;
793
- useContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
794
- useDebugValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
795
- useDeferredValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
796
- useEffect: z.ZodOptional<z.ZodArray<z.ZodString>>;
797
- useFormStatus: z.ZodOptional<z.ZodArray<z.ZodString>>;
798
- useId: z.ZodOptional<z.ZodArray<z.ZodString>>;
799
- useImperativeHandle: z.ZodOptional<z.ZodArray<z.ZodString>>;
800
- useInsertionEffect: z.ZodOptional<z.ZodArray<z.ZodString>>;
801
- useLayoutEffect: z.ZodOptional<z.ZodArray<z.ZodString>>;
802
- useMemo: z.ZodOptional<z.ZodArray<z.ZodString>>;
803
- useOptimistic: z.ZodOptional<z.ZodArray<z.ZodString>>;
804
- useReducer: z.ZodOptional<z.ZodArray<z.ZodString>>;
805
- useRef: z.ZodOptional<z.ZodArray<z.ZodString>>;
806
- useState: z.ZodOptional<z.ZodArray<z.ZodString>>;
807
- useSyncExternalStore: z.ZodOptional<z.ZodArray<z.ZodString>>;
808
- useTransition: z.ZodOptional<z.ZodArray<z.ZodString>>;
809
- }, z.core.$strip>>;
810
- additionalComponents: z.ZodOptional<z.ZodArray<z.ZodObject<{
811
- name: z.ZodString;
812
- as: z.ZodOptional<z.ZodString>;
813
- attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
814
- name: z.ZodString;
815
- as: z.ZodOptional<z.ZodString>;
816
- controlled: z.ZodOptional<z.ZodBoolean>;
817
- defaultValue: z.ZodOptional<z.ZodString>;
818
- }, z.core.$strip>>>;
819
- selector: z.ZodOptional<z.ZodString>;
130
+ }, z.core.$strip>>;
131
+ additionalComponents: z.ZodOptional<z.ZodArray<z.ZodObject<{
132
+ name: z.ZodString;
133
+ as: z.ZodOptional<z.ZodString>;
134
+ attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
135
+ name: z.ZodString;
136
+ as: z.ZodOptional<z.ZodString>;
137
+ controlled: z.ZodOptional<z.ZodBoolean>;
138
+ defaultValue: z.ZodOptional<z.ZodString>;
820
139
  }, z.core.$strip>>>;
140
+ selector: z.ZodOptional<z.ZodString>;
141
+ }, z.core.$strip>>>;
821
142
  }, z.core.$strip>;
822
143
  /**
823
144
  * @internal
824
145
  */
825
146
  declare const ESLintSettingsSchema: z.ZodOptional<z.ZodObject<{
826
- "react-x": z.ZodOptional<z.ZodUnknown>;
147
+ "react-x": z.ZodOptional<z.ZodUnknown>;
827
148
  }, z.core.$strip>>;
828
149
  type CustomComponent = z.infer<typeof CustomComponentSchema>;
829
150
  type CustomComponentProp = z.infer<typeof CustomComponentPropSchema>;
@@ -836,6 +157,19 @@ declare function isESLintReactSettings(settings: unknown): settings is ESLintRea
836
157
  * The default ESLint settings for "react-x".
837
158
  */
838
159
  declare const DEFAULT_ESLINT_REACT_SETTINGS: {
160
+ readonly version: "detect";
161
+ readonly importSource: "react";
162
+ readonly strict: true;
163
+ readonly skipImportCheck: true;
164
+ readonly polymorphicPropName: "as";
165
+ readonly additionalComponents: [];
166
+ readonly additionalHooks: {
167
+ readonly useEffect: ["useIsomorphicLayoutEffect"];
168
+ readonly useLayoutEffect: ["useIsomorphicLayoutEffect"];
169
+ };
170
+ };
171
+ declare const DEFAULT_ESLINT_SETTINGS: {
172
+ readonly "react-x": {
839
173
  readonly version: "detect";
840
174
  readonly importSource: "react";
841
175
  readonly strict: true;
@@ -843,93 +177,89 @@ declare const DEFAULT_ESLINT_REACT_SETTINGS: {
843
177
  readonly polymorphicPropName: "as";
844
178
  readonly additionalComponents: [];
845
179
  readonly additionalHooks: {
846
- readonly useEffect: ["useIsomorphicLayoutEffect"];
847
- readonly useLayoutEffect: ["useIsomorphicLayoutEffect"];
848
- };
849
- };
850
- declare const DEFAULT_ESLINT_SETTINGS: {
851
- readonly "react-x": {
852
- readonly version: "detect";
853
- readonly importSource: "react";
854
- readonly strict: true;
855
- readonly skipImportCheck: true;
856
- readonly polymorphicPropName: "as";
857
- readonly additionalComponents: [];
858
- readonly additionalHooks: {
859
- readonly useEffect: ["useIsomorphicLayoutEffect"];
860
- readonly useLayoutEffect: ["useIsomorphicLayoutEffect"];
861
- };
180
+ readonly useEffect: ["useIsomorphicLayoutEffect"];
181
+ readonly useLayoutEffect: ["useIsomorphicLayoutEffect"];
862
182
  };
183
+ };
863
184
  };
864
185
  interface CustomComponentPropNormalized {
865
- name: string;
866
- as: string;
867
- defaultValue?: string | unit;
186
+ name: string;
187
+ as: string;
188
+ defaultValue?: string | unit;
868
189
  }
869
190
  interface CustomComponentNormalized {
870
- name: string;
871
- as: string;
872
- attributes: CustomComponentPropNormalized[];
873
- re: {
874
- test(s: string): boolean;
875
- };
191
+ name: string;
192
+ as: string;
193
+ attributes: CustomComponentPropNormalized[];
194
+ re: {
195
+ test(s: string): boolean;
196
+ };
876
197
  }
877
198
  interface ESLintReactSettingsNormalized {
878
- additionalHooks: CustomHooks;
879
- components: CustomComponentNormalized[];
880
- importSource: string;
881
- polymorphicPropName: string | unit;
882
- skipImportCheck: boolean;
883
- strict: boolean;
884
- version: string;
199
+ additionalHooks: CustomHooks;
200
+ components: CustomComponentNormalized[];
201
+ importSource: string;
202
+ polymorphicPropName: string | unit;
203
+ skipImportCheck: boolean;
204
+ strict: boolean;
205
+ version: string;
885
206
  }
886
207
  declare const coerceESLintSettings: (settings: unknown) => PartialDeep<ESLintSettings>;
887
208
  declare const decodeESLintSettings: (settings: unknown) => ESLintSettings;
888
209
  declare const coerceSettings: (settings: unknown) => PartialDeep<ESLintReactSettings>;
889
210
  declare const decodeSettings: (settings: unknown) => ESLintReactSettings;
890
- declare const normalizeSettings: ({ additionalComponents, additionalHooks, importSource, polymorphicPropName, skipImportCheck, strict, version, ...rest }: ESLintReactSettings) => {
891
- readonly components: {
892
- name: string;
893
- re: {
894
- test(s: string): boolean;
895
- };
896
- as: string;
897
- attributes: {
898
- name: string;
899
- as: string;
900
- controlled?: boolean | undefined;
901
- defaultValue?: string | undefined;
902
- }[];
903
- selector?: string | undefined;
904
- }[];
905
- readonly additionalHooks: {
906
- use?: string[] | undefined;
907
- useActionState?: string[] | undefined;
908
- useCallback?: string[] | undefined;
909
- useContext?: string[] | undefined;
910
- useDebugValue?: string[] | undefined;
911
- useDeferredValue?: string[] | undefined;
912
- useEffect?: string[] | undefined;
913
- useFormStatus?: string[] | undefined;
914
- useId?: string[] | undefined;
915
- useImperativeHandle?: string[] | undefined;
916
- useInsertionEffect?: string[] | undefined;
917
- useLayoutEffect?: string[] | undefined;
918
- useMemo?: string[] | undefined;
919
- useOptimistic?: string[] | undefined;
920
- useReducer?: string[] | undefined;
921
- useRef?: string[] | undefined;
922
- useState?: string[] | undefined;
923
- useSyncExternalStore?: string[] | undefined;
924
- useTransition?: string[] | undefined;
211
+ declare const normalizeSettings: ({
212
+ additionalComponents,
213
+ additionalHooks,
214
+ importSource,
215
+ polymorphicPropName,
216
+ skipImportCheck,
217
+ strict,
218
+ version,
219
+ ...rest
220
+ }: ESLintReactSettings) => {
221
+ readonly components: {
222
+ name: string;
223
+ re: {
224
+ test(s: string): boolean;
925
225
  };
926
- readonly importSource: string;
927
- readonly polymorphicPropName: string;
928
- readonly skipImportCheck: boolean;
929
- readonly strict: boolean;
930
- readonly version: string;
931
- readonly jsxPragma?: string | undefined;
932
- readonly jsxPragmaFrag?: string | undefined;
226
+ as: string;
227
+ attributes: {
228
+ name: string;
229
+ as: string;
230
+ controlled?: boolean | undefined;
231
+ defaultValue?: string | undefined;
232
+ }[];
233
+ selector?: string | undefined;
234
+ }[];
235
+ readonly additionalHooks: {
236
+ use?: string[] | undefined;
237
+ useActionState?: string[] | undefined;
238
+ useCallback?: string[] | undefined;
239
+ useContext?: string[] | undefined;
240
+ useDebugValue?: string[] | undefined;
241
+ useDeferredValue?: string[] | undefined;
242
+ useEffect?: string[] | undefined;
243
+ useFormStatus?: string[] | undefined;
244
+ useId?: string[] | undefined;
245
+ useImperativeHandle?: string[] | undefined;
246
+ useInsertionEffect?: string[] | undefined;
247
+ useLayoutEffect?: string[] | undefined;
248
+ useMemo?: string[] | undefined;
249
+ useOptimistic?: string[] | undefined;
250
+ useReducer?: string[] | undefined;
251
+ useRef?: string[] | undefined;
252
+ useState?: string[] | undefined;
253
+ useSyncExternalStore?: string[] | undefined;
254
+ useTransition?: string[] | undefined;
255
+ };
256
+ readonly importSource: string;
257
+ readonly polymorphicPropName: string;
258
+ readonly skipImportCheck: boolean;
259
+ readonly strict: boolean;
260
+ readonly version: string;
261
+ readonly jsxPragma?: string | undefined;
262
+ readonly jsxPragmaFrag?: string | undefined;
933
263
  };
934
264
  declare function getSettingsFromContext(context: RuleContext): ESLintReactSettingsNormalized;
935
265
  /**
@@ -939,9 +269,9 @@ declare function getSettingsFromContext(context: RuleContext): ESLintReactSettin
939
269
  */
940
270
  declare const defineSettings: (settings: ESLintReactSettings) => ESLintReactSettings;
941
271
  declare module "@typescript-eslint/utils/ts-eslint" {
942
- interface SharedConfigurationSettings {
943
- ["react-x"]?: Partial<ESLintReactSettings>;
944
- }
272
+ interface SharedConfigurationSettings {
273
+ ["react-x"]?: Partial<ESLintReactSettings>;
274
+ }
945
275
  }
946
-
947
- export { type CustomComponent, type CustomComponentNormalized, type CustomComponentProp, type CustomComponentPropNormalized, CustomComponentPropSchema, CustomComponentSchema, type CustomHooks, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, WEBSITE_URL, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineSettings, getConfigAdapters, getDocsUrl, getId, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, normalizeSettings };
276
+ //#endregion
277
+ export { CustomComponent, CustomComponentNormalized, CustomComponentProp, CustomComponentPropNormalized, CustomComponentPropSchema, CustomComponentSchema, CustomHooks, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, WEBSITE_URL, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineSettings, getConfigAdapters, getDocsUrl, getId, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, normalizeSettings };