@oxlint/plugins 1.67.0 → 1.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +45 -16
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2461,7 +2461,7 @@ type Options = JsonValue[];
2461
2461
  */
2462
2462
  type RuleOptionsSchema = JSONSchema4 | JSONSchema4[] | false;
2463
2463
  //#endregion
2464
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-any.d.ts
2464
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-any.d.ts
2465
2465
  /**
2466
2466
  Returns a boolean for whether the given type is `any`.
2467
2467
 
@@ -2492,7 +2492,7 @@ const anyA = get(anyObject, 'a');
2492
2492
  */
2493
2493
  type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
2494
2494
  //#endregion
2495
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-optional-key-of.d.ts
2495
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-optional-key-of.d.ts
2496
2496
  /**
2497
2497
  Returns a boolean for whether the given key is an optional key of type.
2498
2498
 
@@ -2535,7 +2535,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
2535
2535
  */
2536
2536
  type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false;
2537
2537
  //#endregion
2538
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/optional-keys-of.d.ts
2538
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/optional-keys-of.d.ts
2539
2539
  /**
2540
2540
  Extract all optional keys from the given type.
2541
2541
 
@@ -2573,7 +2573,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
2573
2573
  ? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
2574
2574
  : never;
2575
2575
  //#endregion
2576
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/required-keys-of.d.ts
2576
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/required-keys-of.d.ts
2577
2577
  /**
2578
2578
  Extract all required keys from the given type.
2579
2579
 
@@ -2607,7 +2607,7 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
2607
2607
  type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
2608
2608
  ? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
2609
2609
  //#endregion
2610
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-never.d.ts
2610
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-never.d.ts
2611
2611
  /**
2612
2612
  Returns a boolean for whether the given type is `never`.
2613
2613
 
@@ -2663,7 +2663,7 @@ type B = IsTrueFixed<never>;
2663
2663
  */
2664
2664
  type IsNever<T> = [T] extends [never] ? true : false;
2665
2665
  //#endregion
2666
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/if.d.ts
2666
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/if.d.ts
2667
2667
  /**
2668
2668
  An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
2669
2669
 
@@ -2758,7 +2758,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
2758
2758
  */
2759
2759
  type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
2760
2760
  //#endregion
2761
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/internal/type.d.ts
2761
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/internal/type.d.ts
2762
2762
  /**
2763
2763
  An if-else-like type that resolves depending on whether the given type is `any` or `never`.
2764
2764
 
@@ -2805,7 +2805,7 @@ type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
2805
2805
  */
2806
2806
  type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever>>;
2807
2807
  //#endregion
2808
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/simplify.d.ts
2808
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/simplify.d.ts
2809
2809
  /**
2810
2810
  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.
2811
2811
 
@@ -2866,7 +2866,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
2866
2866
  */
2867
2867
  type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
2868
2868
  //#endregion
2869
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-equal.d.ts
2869
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-equal.d.ts
2870
2870
  /**
2871
2871
  Returns a boolean for whether the two given types are equal.
2872
2872
 
@@ -2897,7 +2897,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
2897
2897
  // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
2898
2898
  type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
2899
2899
  //#endregion
2900
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/omit-index-signature.d.ts
2900
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/omit-index-signature.d.ts
2901
2901
  /**
2902
2902
  Omit any index signatures from the given object type, leaving only explicitly defined properties.
2903
2903
 
@@ -2991,7 +2991,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
2991
2991
  */
2992
2992
  type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
2993
2993
  //#endregion
2994
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/pick-index-signature.d.ts
2994
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/pick-index-signature.d.ts
2995
2995
  /**
2996
2996
  Pick only index signatures from the given object type, leaving out all explicitly defined properties.
2997
2997
 
@@ -3039,7 +3039,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
3039
3039
  */
3040
3040
  type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
3041
3041
  //#endregion
3042
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/merge.d.ts
3042
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/merge.d.ts
3043
3043
  // Merges two objects without worrying about index signatures.
3044
3044
  type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
3045
3045
  /**
@@ -3111,7 +3111,7 @@ type Merge<Destination, Source> = Destination extends unknown // For distributin
3111
3111
  // Should never happen
3112
3112
  type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
3113
3113
  //#endregion
3114
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/internal/object.d.ts
3114
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/internal/object.d.ts
3115
3115
  /**
3116
3116
  Merges user specified options with default options.
3117
3117
 
@@ -3164,9 +3164,38 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
3164
3164
  // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
3165
3165
  ```
3166
3166
  */
3167
- type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required<Options>>>>;
3167
+ type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = _ApplyDefaultOptions<Options, Defaults, SpecifiedOptions> extends infer Result extends Required<Options> // `extends Required<Options>` ensures that `ApplyDefaultOptions<SomeOption, ...>` is always assignable to `Required<SomeOption>`
3168
+ ? Result : never;
3169
+ type _ApplyDefaultOptions<Options, Defaults, SpecifiedOptions> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Merge<Defaults, { [Key in keyof SpecifiedOptions as undefined extends Required<Options>[Key & keyof Options] ? Key : undefined extends SpecifiedOptions[Key] ? never : Key]: SpecifiedOptions[Key] }>>>;
3170
+ /**
3171
+ Collapses literal types in a union into their corresponding primitive types, when possible. For example, `CollapseLiterals<'foo' | 'bar' | (string & {})>` returns `string`.
3172
+
3173
+ Note: This doesn't collapse literals within tagged types. For example, `CollapseLiterals<Tagged<'foo' | (string & {}), 'Tag'>>` returns `("foo" & Tag<"Tag", never>) | (string & Tag<"Tag", never>)` and not `string & Tag<"Tag", never>`.
3174
+
3175
+ Use-case: For collapsing unions created using {@link LiteralUnion}.
3176
+
3177
+ @example
3178
+ ```
3179
+ import type {LiteralUnion} from 'type-fest';
3180
+
3181
+ type A = CollapseLiterals<'foo' | 'bar' | (string & {})>;
3182
+ //=> string
3183
+
3184
+ type B = CollapseLiterals<LiteralUnion<1 | 2 | 3, number>>;
3185
+ //=> number
3186
+
3187
+ type C = CollapseLiterals<LiteralUnion<'onClick' | 'onChange', `on${string}`>>;
3188
+ //=> `on${string}`
3189
+
3190
+ type D = CollapseLiterals<'click' | 'change' | (`on${string}` & {})>;
3191
+ //=> 'click' | 'change' | `on${string}`
3192
+
3193
+ type E = CollapseLiterals<LiteralUnion<'foo' | 'bar', string> | null | undefined>;
3194
+ //=> string | null | undefined
3195
+ ```
3196
+ */
3168
3197
  //#endregion
3169
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/except.d.ts
3198
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/except.d.ts
3170
3199
  /**
3171
3200
  Filter out keys from an object.
3172
3201
 
@@ -3264,7 +3293,7 @@ type PostPayloadFixed = Except<UserData, 'email'>;
3264
3293
  type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
3265
3294
  type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType] } & (Options['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {});
3266
3295
  //#endregion
3267
- //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/require-at-least-one.d.ts
3296
+ //#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/require-at-least-one.d.ts
3268
3297
  /**
3269
3298
  Create a type that requires at least one of the given keys, while keeping the remaining keys as is.
3270
3299
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxlint/plugins",
3
- "version": "1.67.0",
3
+ "version": "1.69.0",
4
4
  "description": "Plugin utilities for Oxlint",
5
5
  "keywords": [
6
6
  "eslint",