@oxlint/plugins 1.43.0 → 1.48.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 (3) hide show
  1. package/index.cjs +1 -0
  2. package/index.d.ts +36 -26
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
1
2
  function definePlugin(plugin) {
2
3
  return plugin;
3
4
  }
package/index.d.ts CHANGED
@@ -241,7 +241,7 @@ type Options = JsonValue[];
241
241
  */
242
242
  type RuleOptionsSchema = JSONSchema4 | JSONSchema4[] | false;
243
243
  //#endregion
244
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-any.d.ts
244
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/is-any.d.ts
245
245
  /**
246
246
  Returns a boolean for whether the given type is `any`.
247
247
 
@@ -272,7 +272,7 @@ const anyA = get(anyObject, 'a');
272
272
  */
273
273
  type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
274
274
  //#endregion
275
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-optional-key-of.d.ts
275
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/is-optional-key-of.d.ts
276
276
  /**
277
277
  Returns a boolean for whether the given key is an optional key of type.
278
278
 
@@ -315,7 +315,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
315
315
  */
316
316
  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;
317
317
  //#endregion
318
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/optional-keys-of.d.ts
318
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/optional-keys-of.d.ts
319
319
  /**
320
320
  Extract all optional keys from the given type.
321
321
 
@@ -353,7 +353,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
353
353
  ? (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`
354
354
  : never;
355
355
  //#endregion
356
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/required-keys-of.d.ts
356
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/required-keys-of.d.ts
357
357
  /**
358
358
  Extract all required keys from the given type.
359
359
 
@@ -387,7 +387,7 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
387
387
  type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
388
388
  ? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
389
389
  //#endregion
390
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-never.d.ts
390
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/is-never.d.ts
391
391
  /**
392
392
  Returns a boolean for whether the given type is `never`.
393
393
 
@@ -443,7 +443,7 @@ type B = IsTrueFixed<never>;
443
443
  */
444
444
  type IsNever<T> = [T] extends [never] ? true : false;
445
445
  //#endregion
446
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/if.d.ts
446
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/if.d.ts
447
447
  /**
448
448
  An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
449
449
 
@@ -538,7 +538,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
538
538
  */
539
539
  type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
540
540
  //#endregion
541
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/internal/type.d.ts
541
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/internal/type.d.ts
542
542
  /**
543
543
  An if-else-like type that resolves depending on whether the given type is `any` or `never`.
544
544
 
@@ -585,7 +585,7 @@ type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
585
585
  */
586
586
  type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever>>;
587
587
  //#endregion
588
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/simplify.d.ts
588
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/simplify.d.ts
589
589
  /**
590
590
  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.
591
591
 
@@ -646,7 +646,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
646
646
  */
647
647
  type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
648
648
  //#endregion
649
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-equal.d.ts
649
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/is-equal.d.ts
650
650
  /**
651
651
  Returns a boolean for whether the two given types are equal.
652
652
 
@@ -677,7 +677,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
677
677
  // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
678
678
  type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
679
679
  //#endregion
680
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/omit-index-signature.d.ts
680
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/omit-index-signature.d.ts
681
681
  /**
682
682
  Omit any index signatures from the given object type, leaving only explicitly defined properties.
683
683
 
@@ -771,7 +771,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
771
771
  */
772
772
  type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
773
773
  //#endregion
774
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/pick-index-signature.d.ts
774
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/pick-index-signature.d.ts
775
775
  /**
776
776
  Pick only index signatures from the given object type, leaving out all explicitly defined properties.
777
777
 
@@ -819,7 +819,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
819
819
  */
820
820
  type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
821
821
  //#endregion
822
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/merge.d.ts
822
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/merge.d.ts
823
823
  // Merges two objects without worrying about index signatures.
824
824
  type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
825
825
  /**
@@ -861,10 +861,12 @@ Note: If you want a merge type that more accurately reflects the runtime behavio
861
861
  */
862
862
  type Merge<Destination, Source> = Destination extends unknown // For distributing `Destination`
863
863
  ? Source extends unknown // For distributing `Source`
864
- ? Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>> : never // Should never happen
864
+ ? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen
865
865
  : never;
866
+ // Should never happen
867
+ type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
866
868
  //#endregion
867
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/internal/object.d.ts
869
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/internal/object.d.ts
868
870
  /**
869
871
  Merges user specified options with default options.
870
872
 
@@ -919,7 +921,7 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
919
921
  */
920
922
  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>>>>;
921
923
  //#endregion
922
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/except.d.ts
924
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/except.d.ts
923
925
  /**
924
926
  Filter out keys from an object.
925
927
 
@@ -1017,7 +1019,7 @@ type PostPayloadFixed = Except<UserData, 'email'>;
1017
1019
  type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
1018
1020
  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>> : {});
1019
1021
  //#endregion
1020
- //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/require-at-least-one.d.ts
1022
+ //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/require-at-least-one.d.ts
1021
1023
  /**
1022
1024
  Create a type that requires at least one of the given keys. The remaining keys are kept as is.
1023
1025
 
@@ -3047,10 +3049,19 @@ declare function getNodeByRangeIndex(offset: number): Node$1 | null;
3047
3049
  //#endregion
3048
3050
  //#region src-js/plugins/fix.d.ts
3049
3051
  type FixFn = (fixer: Fixer) => Fix | Array<Fix | null | undefined> | IterableIterator<Fix | null | undefined> | null | undefined;
3050
- type Fix = {
3052
+ /**
3053
+ * Fix, as returned by `fix` function.
3054
+ *
3055
+ * `range` offsets are relative to start of the source text.
3056
+ * When the file has a BOM, they are relative to the start of the source text *without* the BOM.
3057
+ *
3058
+ * To represent a position *before* a BOM, -1 is used to mean "before the BOM".
3059
+ * ESLint's `unicode-bom` rule produces a fix `{ range: [-1, 0], text: "" }` to remove a BOM.
3060
+ */
3061
+ interface Fix {
3051
3062
  range: Range;
3052
3063
  text: string;
3053
- };
3064
+ }
3054
3065
  declare const FIXER: Readonly<{
3055
3066
  insertTextBefore(nodeOrToken: Ranged, text: string): Fix;
3056
3067
  insertTextBeforeRange(range: Range, text: string): Fix;
@@ -3079,7 +3090,7 @@ interface DiagnosticBase {
3079
3090
  loc?: LocationWithOptionalEnd | LineColumn;
3080
3091
  data?: DiagnosticData | null | undefined;
3081
3092
  fix?: FixFn;
3082
- suggest?: Suggestion[];
3093
+ suggest?: Suggestion[] | null | undefined;
3083
3094
  }
3084
3095
  /**
3085
3096
  * Location with `end` property optional.
@@ -3094,15 +3105,17 @@ interface LocationWithOptionalEnd {
3094
3105
  type DiagnosticData = Record<string, string | number | boolean | bigint | null | undefined>;
3095
3106
  /**
3096
3107
  * Suggested fix.
3097
- * NOT IMPLEMENTED YET.
3098
3108
  */
3099
3109
  type Suggestion = RequireAtLeastOne<SuggestionBase, "desc" | "messageId">;
3100
3110
  interface SuggestionBase {
3101
3111
  desc?: string;
3102
3112
  messageId?: string;
3103
- fix: FixFn;
3104
3113
  data?: DiagnosticData | null | undefined;
3114
+ fix: FixFn;
3105
3115
  }
3116
+ /**
3117
+ * Suggested fix in form sent to Rust.
3118
+ */
3106
3119
  //#endregion
3107
3120
  //#region src-js/plugins/settings.d.ts
3108
3121
  /**
@@ -3227,9 +3240,6 @@ type Identifier = IdentifierName | IdentifierReference | BindingIdentifier | Lab
3227
3240
  /**
3228
3241
  * Discard TS-ESLint `ScopeManager`, to free memory.
3229
3242
  */
3230
- /**
3231
- * @see https://eslint.org/docs/latest/developer-guide/scope-manager-interface#scopemanager-interface
3232
- */
3233
3243
  declare const SCOPE_MANAGER: Readonly<{
3234
3244
  /**
3235
3245
  * All scopes.
@@ -3404,11 +3414,11 @@ declare const LANGUAGE_OPTIONS: {
3404
3414
  /**
3405
3415
  * Parser name.
3406
3416
  */
3407
- name: "oxc";
3417
+ name: "oxlint";
3408
3418
  /**
3409
3419
  * Parser version.
3410
3420
  */
3411
- version: "0.0.0";
3421
+ version: string;
3412
3422
  /**
3413
3423
  * Parse code into an AST.
3414
3424
  * @param code - Code to parse
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxlint/plugins",
3
- "version": "1.43.0",
3
+ "version": "1.48.0",
4
4
  "description": "Plugin utilities for Oxlint",
5
5
  "keywords": [
6
6
  "eslint",