oxlint 1.68.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.
- package/README.md +2 -0
- package/configuration_schema.json +12280 -2014
- package/dist/bindings.js +27 -28
- package/dist/index.d.ts +4306 -730
- package/dist/js_config.js +2 -3
- package/dist/lint.js +143 -135
- package/dist/plugins-dev.d.ts +45 -16
- package/dist/plugins-dev.js +1 -1
- package/package.json +20 -20
- package/dist/globals.js +0 -13
package/dist/plugins-dev.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-any.d.ts
|
|
2
2
|
/**
|
|
3
3
|
Returns a boolean for whether the given type is `any`.
|
|
4
4
|
|
|
@@ -29,7 +29,7 @@ const anyA = get(anyObject, 'a');
|
|
|
29
29
|
*/
|
|
30
30
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
31
31
|
//#endregion
|
|
32
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
32
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
33
33
|
/**
|
|
34
34
|
Returns a boolean for whether the given key is an optional key of type.
|
|
35
35
|
|
|
@@ -72,7 +72,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
72
72
|
*/
|
|
73
73
|
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;
|
|
74
74
|
//#endregion
|
|
75
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
75
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
76
76
|
/**
|
|
77
77
|
Extract all optional keys from the given type.
|
|
78
78
|
|
|
@@ -110,7 +110,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
110
110
|
? (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`
|
|
111
111
|
: never;
|
|
112
112
|
//#endregion
|
|
113
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
113
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
114
114
|
/**
|
|
115
115
|
Extract all required keys from the given type.
|
|
116
116
|
|
|
@@ -144,7 +144,7 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
|
144
144
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
145
145
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
146
146
|
//#endregion
|
|
147
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
147
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-never.d.ts
|
|
148
148
|
/**
|
|
149
149
|
Returns a boolean for whether the given type is `never`.
|
|
150
150
|
|
|
@@ -200,7 +200,7 @@ type B = IsTrueFixed<never>;
|
|
|
200
200
|
*/
|
|
201
201
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
202
202
|
//#endregion
|
|
203
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
203
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/if.d.ts
|
|
204
204
|
/**
|
|
205
205
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
206
206
|
|
|
@@ -295,7 +295,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
295
295
|
*/
|
|
296
296
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
297
297
|
//#endregion
|
|
298
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
298
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/internal/type.d.ts
|
|
299
299
|
/**
|
|
300
300
|
An if-else-like type that resolves depending on whether the given type is `any` or `never`.
|
|
301
301
|
|
|
@@ -342,7 +342,7 @@ type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
|
|
|
342
342
|
*/
|
|
343
343
|
type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever>>;
|
|
344
344
|
//#endregion
|
|
345
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
345
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/simplify.d.ts
|
|
346
346
|
/**
|
|
347
347
|
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.
|
|
348
348
|
|
|
@@ -403,7 +403,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
403
403
|
*/
|
|
404
404
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
405
405
|
//#endregion
|
|
406
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
406
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-equal.d.ts
|
|
407
407
|
/**
|
|
408
408
|
Returns a boolean for whether the two given types are equal.
|
|
409
409
|
|
|
@@ -434,7 +434,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
|
|
|
434
434
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
435
435
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
436
436
|
//#endregion
|
|
437
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
437
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
438
438
|
/**
|
|
439
439
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
440
440
|
|
|
@@ -528,7 +528,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
528
528
|
*/
|
|
529
529
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
530
530
|
//#endregion
|
|
531
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
531
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
532
532
|
/**
|
|
533
533
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
534
534
|
|
|
@@ -576,7 +576,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
576
576
|
*/
|
|
577
577
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
578
578
|
//#endregion
|
|
579
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
579
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/merge.d.ts
|
|
580
580
|
// Merges two objects without worrying about index signatures.
|
|
581
581
|
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
|
|
582
582
|
/**
|
|
@@ -648,7 +648,7 @@ type Merge<Destination, Source> = Destination extends unknown // For distributin
|
|
|
648
648
|
// Should never happen
|
|
649
649
|
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
650
650
|
//#endregion
|
|
651
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
651
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/internal/object.d.ts
|
|
652
652
|
/**
|
|
653
653
|
Merges user specified options with default options.
|
|
654
654
|
|
|
@@ -701,9 +701,38 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
701
701
|
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
702
702
|
```
|
|
703
703
|
*/
|
|
704
|
-
type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> =
|
|
704
|
+
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>`
|
|
705
|
+
? Result : never;
|
|
706
|
+
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] }>>>;
|
|
707
|
+
/**
|
|
708
|
+
Collapses literal types in a union into their corresponding primitive types, when possible. For example, `CollapseLiterals<'foo' | 'bar' | (string & {})>` returns `string`.
|
|
709
|
+
|
|
710
|
+
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>`.
|
|
711
|
+
|
|
712
|
+
Use-case: For collapsing unions created using {@link LiteralUnion}.
|
|
713
|
+
|
|
714
|
+
@example
|
|
715
|
+
```
|
|
716
|
+
import type {LiteralUnion} from 'type-fest';
|
|
717
|
+
|
|
718
|
+
type A = CollapseLiterals<'foo' | 'bar' | (string & {})>;
|
|
719
|
+
//=> string
|
|
720
|
+
|
|
721
|
+
type B = CollapseLiterals<LiteralUnion<1 | 2 | 3, number>>;
|
|
722
|
+
//=> number
|
|
723
|
+
|
|
724
|
+
type C = CollapseLiterals<LiteralUnion<'onClick' | 'onChange', `on${string}`>>;
|
|
725
|
+
//=> `on${string}`
|
|
726
|
+
|
|
727
|
+
type D = CollapseLiterals<'click' | 'change' | (`on${string}` & {})>;
|
|
728
|
+
//=> 'click' | 'change' | `on${string}`
|
|
729
|
+
|
|
730
|
+
type E = CollapseLiterals<LiteralUnion<'foo' | 'bar', string> | null | undefined>;
|
|
731
|
+
//=> string | null | undefined
|
|
732
|
+
```
|
|
733
|
+
*/
|
|
705
734
|
//#endregion
|
|
706
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
735
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/except.d.ts
|
|
707
736
|
/**
|
|
708
737
|
Filter out keys from an object.
|
|
709
738
|
|
|
@@ -801,7 +830,7 @@ type PostPayloadFixed = Except<UserData, 'email'>;
|
|
|
801
830
|
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
802
831
|
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>> : {});
|
|
803
832
|
//#endregion
|
|
804
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
833
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/require-at-least-one.d.ts
|
|
805
834
|
/**
|
|
806
835
|
Create a type that requires at least one of the given keys, while keeping the remaining keys as is.
|
|
807
836
|
|
package/dist/plugins-dev.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { _ as BLOCK_SIZE, b as __commonJSMin, c as allOptions, d as diagnostics, f as replacePlaceholders, g as BLOCK_ALIGN, h as ACTIVE_SIZE, i as resetStateAfterError, l as setOptions, m as getNodeByRangeIndex, o as registerPlugin, p as getLineColumnFromOffset, r as lintFileImpl, s as registeredRules, t as buffers, u as PLACEHOLDER_REGEX, v as BUFFER_SIZE, x as __toESM } from "./lint.js";
|
|
2
|
-
import { _ as ObjectValues, a as JSONStringify, d as ObjectEntries, m as ObjectKeys, n as ArrayIsArray, p as ObjectHasOwn, t as ArrayFrom, u as ObjectDefineProperty } from "./globals.js";
|
|
3
2
|
import { a as rawTransferSupported$1, i as parseRawSync, n as getBufferOffset, t as applyFixes } from "./bindings.js";
|
|
4
3
|
import assert, { AssertionError } from "node:assert";
|
|
5
4
|
import { dirname, isAbsolute, join } from "node:path";
|
|
@@ -142,6 +141,7 @@ function rawTransferRuntimeSupported() {
|
|
|
142
141
|
}
|
|
143
142
|
//#endregion
|
|
144
143
|
//#region src-js/package/rule_tester.ts
|
|
144
|
+
const ObjectKeys = Object.keys, ObjectValues = Object.values, ObjectHasOwn = Object.hasOwn, JSONStringify = JSON.stringify, ArrayFrom = Array.from, ObjectEntries = Object.entries, ObjectDefineProperty = Object.defineProperty, ArrayIsArray = Array.isArray;
|
|
145
145
|
/**
|
|
146
146
|
* Default `describe` function, if `describe` doesn't exist as a global.
|
|
147
147
|
* @param text - Description of the test case
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.69.0",
|
|
4
4
|
"description": "Linter for the JavaScript Oxidation Compiler",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -87,24 +87,24 @@
|
|
|
87
87
|
},
|
|
88
88
|
"preferUnplugged": true,
|
|
89
89
|
"optionalDependencies": {
|
|
90
|
-
"@oxlint/binding-darwin-arm64": "1.
|
|
91
|
-
"@oxlint/binding-android-arm64": "1.
|
|
92
|
-
"@oxlint/binding-win32-arm64-msvc": "1.
|
|
93
|
-
"@oxlint/binding-linux-arm64-gnu": "1.
|
|
94
|
-
"@oxlint/binding-linux-arm64-musl": "1.
|
|
95
|
-
"@oxlint/binding-openharmony-arm64": "1.
|
|
96
|
-
"@oxlint/binding-android-arm-eabi": "1.
|
|
97
|
-
"@oxlint/binding-linux-arm-gnueabihf": "1.
|
|
98
|
-
"@oxlint/binding-linux-arm-musleabihf": "1.
|
|
99
|
-
"@oxlint/binding-win32-ia32-msvc": "1.
|
|
100
|
-
"@oxlint/binding-linux-ppc64-gnu": "1.
|
|
101
|
-
"@oxlint/binding-linux-riscv64-gnu": "1.
|
|
102
|
-
"@oxlint/binding-linux-riscv64-musl": "1.
|
|
103
|
-
"@oxlint/binding-linux-s390x-gnu": "1.
|
|
104
|
-
"@oxlint/binding-darwin-x64": "1.
|
|
105
|
-
"@oxlint/binding-win32-x64-msvc": "1.
|
|
106
|
-
"@oxlint/binding-freebsd-x64": "1.
|
|
107
|
-
"@oxlint/binding-linux-x64-gnu": "1.
|
|
108
|
-
"@oxlint/binding-linux-x64-musl": "1.
|
|
90
|
+
"@oxlint/binding-darwin-arm64": "1.69.0",
|
|
91
|
+
"@oxlint/binding-android-arm64": "1.69.0",
|
|
92
|
+
"@oxlint/binding-win32-arm64-msvc": "1.69.0",
|
|
93
|
+
"@oxlint/binding-linux-arm64-gnu": "1.69.0",
|
|
94
|
+
"@oxlint/binding-linux-arm64-musl": "1.69.0",
|
|
95
|
+
"@oxlint/binding-openharmony-arm64": "1.69.0",
|
|
96
|
+
"@oxlint/binding-android-arm-eabi": "1.69.0",
|
|
97
|
+
"@oxlint/binding-linux-arm-gnueabihf": "1.69.0",
|
|
98
|
+
"@oxlint/binding-linux-arm-musleabihf": "1.69.0",
|
|
99
|
+
"@oxlint/binding-win32-ia32-msvc": "1.69.0",
|
|
100
|
+
"@oxlint/binding-linux-ppc64-gnu": "1.69.0",
|
|
101
|
+
"@oxlint/binding-linux-riscv64-gnu": "1.69.0",
|
|
102
|
+
"@oxlint/binding-linux-riscv64-musl": "1.69.0",
|
|
103
|
+
"@oxlint/binding-linux-s390x-gnu": "1.69.0",
|
|
104
|
+
"@oxlint/binding-darwin-x64": "1.69.0",
|
|
105
|
+
"@oxlint/binding-win32-x64-msvc": "1.69.0",
|
|
106
|
+
"@oxlint/binding-freebsd-x64": "1.69.0",
|
|
107
|
+
"@oxlint/binding-linux-x64-gnu": "1.69.0",
|
|
108
|
+
"@oxlint/binding-linux-x64-musl": "1.69.0"
|
|
109
109
|
}
|
|
110
110
|
}
|
package/dist/globals.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//#region src-js/utils/globals.ts
|
|
2
|
-
/**
|
|
3
|
-
* Properties of global objects exported as variables.
|
|
4
|
-
*
|
|
5
|
-
* TSDown will replace e.g. `Object.keys` with import of `ObjectKeys` from this file.
|
|
6
|
-
*
|
|
7
|
-
* If you use any globals in code in `src-js` directory, you should add them to this file.
|
|
8
|
-
*
|
|
9
|
-
* See TSDown config file for more details.
|
|
10
|
-
*/
|
|
11
|
-
const { prototype: ObjectPrototype, hasOwn: ObjectHasOwn, keys: ObjectKeys, values: ObjectValues, freeze: ObjectFreeze, preventExtensions: ObjectPreventExtensions, defineProperty: ObjectDefineProperty, defineProperties: ObjectDefineProperties, create: ObjectCreate, assign: ObjectAssign, getPrototypeOf: ObjectGetPrototypeOf, setPrototypeOf: ObjectSetPrototypeOf, entries: ObjectEntries } = Object, { prototype: ArrayPrototype, isArray: ArrayIsArray, from: ArrayFrom } = Array, { min: MathMin, max: MathMax, floor: MathFloor } = Math, { parse: JSONParse, stringify: JSONStringify } = JSON, { ownKeys: ReflectOwnKeys } = Reflect, { iterator: SymbolIterator } = Symbol, { fromCodePoint: StringFromCodePoint } = String, { now: DateNow } = Date;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { ObjectValues as _, JSONStringify as a, ObjectAssign as c, ObjectEntries as d, ObjectFreeze as f, ObjectPrototype as g, ObjectPreventExtensions as h, JSONParse as i, ObjectCreate as l, ObjectKeys as m, ArrayIsArray as n, MathMax as o, ObjectHasOwn as p, DateNow as r, MathMin as s, ArrayFrom as t, ObjectDefineProperty as u, StringFromCodePoint as v, SymbolIterator as y };
|