oxlint 1.80.0 → 1.82.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.
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-any.d.ts
1
+ //#region ../../node_modules/.pnpm/type-fest@5.9.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.8.0/node_modules/type-fest/source/is-optional-key-of.d.ts
32
+ //#region ../../node_modules/.pnpm/type-fest@5.9.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.8.0/node_modules/type-fest/source/optional-keys-of.d.ts
75
+ //#region ../../node_modules/.pnpm/type-fest@5.9.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; // Should never happen
112
112
  //#endregion
113
- //#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/required-keys-of.d.ts
113
+ //#region ../../node_modules/.pnpm/type-fest@5.9.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; // Should never happen
146
146
  //#endregion
147
- //#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-never.d.ts
147
+ //#region ../../node_modules/.pnpm/type-fest@5.9.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.8.0/node_modules/type-fest/source/if.d.ts
203
+ //#region ../../node_modules/.pnpm/type-fest@5.9.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.8.0/node_modules/type-fest/source/internal/type.d.ts
298
+ //#region ../../node_modules/.pnpm/type-fest@5.9.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
 
@@ -346,7 +346,7 @@ type IfNotAnyOrNever<T, Cases extends {
346
346
  ifNever?: unknown;
347
347
  }> = IsAny<T> extends true ? 'ifAny' extends keyof Cases ? Cases['ifAny'] : any : IsNever<T> extends true ? 'ifNever' extends keyof Cases ? Cases['ifNever'] : never : Cases['ifNot'];
348
348
  //#endregion
349
- //#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/simplify.d.ts
349
+ //#region ../../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/simplify.d.ts
350
350
  /**
351
351
  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.
352
352
 
@@ -407,7 +407,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
407
407
  */
408
408
  type Simplify<T> = { [KeyType in keyof T]: T[KeyType]; } & {};
409
409
  //#endregion
410
- //#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-equal.d.ts
410
+ //#region ../../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/is-equal.d.ts
411
411
  /**
412
412
  Returns a boolean for whether the two given types are equal.
413
413
 
@@ -438,7 +438,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
438
438
  // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
439
439
  type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
440
440
  //#endregion
441
- //#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/omit-index-signature.d.ts
441
+ //#region ../../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/omit-index-signature.d.ts
442
442
  /**
443
443
  Omit any index signatures from the given object type, leaving only explicitly defined properties.
444
444
 
@@ -532,7 +532,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
532
532
  */
533
533
  type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType]; };
534
534
  //#endregion
535
- //#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/pick-index-signature.d.ts
535
+ //#region ../../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/pick-index-signature.d.ts
536
536
  /**
537
537
  Pick only index signatures from the given object type, leaving out all explicitly defined properties.
538
538
 
@@ -580,7 +580,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
580
580
  */
581
581
  type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType]; };
582
582
  //#endregion
583
- //#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/merge.d.ts
583
+ //#region ../../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/merge.d.ts
584
584
  // Merges two objects without worrying about index signatures.
585
585
  type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key]; } & Source>;
586
586
  /**
@@ -651,7 +651,7 @@ type Merge<Destination, Source> = Destination extends unknown // For distributin
651
651
  : never; // Should never happen
652
652
  type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
653
653
  //#endregion
654
- //#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/internal/object.d.ts
654
+ //#region ../../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/internal/object.d.ts
655
655
  /**
656
656
  Merges user specified options with default options.
657
657
 
@@ -708,7 +708,7 @@ type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<
708
708
  ) ? Result : never;
709
709
  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]; }>>>;
710
710
  //#endregion
711
- //#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/except.d.ts
711
+ //#region ../../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/except.d.ts
712
712
  /**
713
713
  Filter out keys from an object.
714
714
 
@@ -808,7 +808,7 @@ type PostPayloadFixed = Except<UserData, 'email'>;
808
808
  type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
809
809
  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>> : {});
810
810
  //#endregion
811
- //#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/require-at-least-one.d.ts
811
+ //#region ../../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/require-at-least-one.d.ts
812
812
  /**
813
813
  Create a type that requires at least one of the given keys, while keeping the remaining keys as is.
814
814
 
@@ -1239,8 +1239,9 @@ type VisitorWithHooks = VisitorObject & {
1239
1239
  };
1240
1240
  interface Node$1 extends Span {}
1241
1241
  type NodeOrToken = Node$1 | TokenType | CommentType;
1242
- //#endregion
1243
- //#region src-js/plugins/location.d.ts
1242
+ declare namespace location_d_exports {
1243
+ export { LineColumn, Location, Range, Ranged, Span, computeLoc, debugAssertLinesIsInitialized, getLineColumnFromOffset, getLoc, getNodeByRangeIndex, getNodeLoc, getOffsetFromLineColumn, getRange, initLines, lineStartIndices, lines, resetLinesAndLocs };
1244
+ }
1244
1245
  /**
1245
1246
  * Range of source offsets.
1246
1247
  */
@@ -1274,6 +1275,22 @@ interface LineColumn {
1274
1275
  line: number;
1275
1276
  column: number;
1276
1277
  }
1278
+ declare const lines: string[];
1279
+ declare const lineStartIndices: number[];
1280
+ /**
1281
+ * Split source text into lines.
1282
+ */
1283
+ declare function initLines(): void;
1284
+ /**
1285
+ * Debug assert that `lines` and `lineStartIndices` are initialized.
1286
+ * No-op in release build - TSDown will remove this function and all calls to it.
1287
+ */
1288
+ declare function debugAssertLinesIsInitialized(): void;
1289
+ /**
1290
+ * Reset lines after file has been linted, to free memory.
1291
+ * Reset `Location` object pool.
1292
+ */
1293
+ declare function resetLinesAndLocs(): void;
1277
1294
  /**
1278
1295
  * Convert a source text index into a (line, column) pair.
1279
1296
  * @param offset - The index of a character in a file.
@@ -1301,6 +1318,32 @@ declare function getRange(nodeOrToken: NodeOrToken): Range;
1301
1318
  * @returns Location of the node or token
1302
1319
  */
1303
1320
  declare function getLoc(nodeOrToken: NodeOrToken): Location;
1321
+ /**
1322
+ * Calculate the `Location` for an AST node, and cache it on the node.
1323
+ *
1324
+ * Used in `loc` getter on AST nodes (not tokens or comments - they use their own caching
1325
+ * via `Token` / `Comment` class private fields).
1326
+ *
1327
+ * Defines a `loc` property on the node with the calculated `Location`, so accessing `loc` twice on same node
1328
+ * results in the same object each time.
1329
+ *
1330
+ * For internal use only.
1331
+ *
1332
+ * @param node - AST node
1333
+ * @returns Location
1334
+ */
1335
+ declare function getNodeLoc(node: Node$1): Location;
1336
+ /**
1337
+ * Compute a `Location` from `start` and `end` source offsets.
1338
+ *
1339
+ * Returns a recycled `Location` object from the pool when possible, allocating only during warmup.
1340
+ * Initializes `lines` and `lineStartIndices` tables if they haven't been already.
1341
+ *
1342
+ * @param start - Start offset
1343
+ * @param end - End offset
1344
+ * @returns Location
1345
+ */
1346
+ declare function computeLoc(start: number, end: number): Location;
1304
1347
  /**
1305
1348
  * Get the deepest node containing a range index.
1306
1349
  * @param offset - Range index of the desired node
@@ -1316,8 +1359,9 @@ interface CommentType extends Span {
1316
1359
  type: "Line" | "Block" | "Shebang";
1317
1360
  value: string;
1318
1361
  }
1319
- //#endregion
1320
- //#region src-js/generated/types.d.ts
1362
+ declare namespace types_d_exports {
1363
+ export { AccessorProperty, AccessorPropertyType, Argument, ArrayAssignmentTarget, ArrayExpression, ArrayExpressionElement, ArrayPattern, ArrowFunctionExpression, AssignmentExpression, AssignmentOperator, AssignmentPattern, AssignmentTarget, AssignmentTargetMaybeDefault, AssignmentTargetPattern, AssignmentTargetProperty, AssignmentTargetPropertyIdentifier, AssignmentTargetPropertyProperty, AssignmentTargetRest, AssignmentTargetWithDefault, AwaitExpression, BigIntLiteral, BinaryExpression, BinaryOperator, BindingIdentifier, BindingPattern, BindingProperty, BindingRestElement, BlockStatement, BooleanLiteral, BreakStatement, CallExpression, CatchClause, ChainElement, ChainExpression, Class, ClassBody, ClassElement, ClassType, CommentType as Comment, ComputedMemberExpression, ConditionalExpression, ContinueStatement, DebuggerStatement, Declaration, Decorator, Directive$1 as Directive, DoWhileStatement, EmptyStatement, ExportAllDeclaration, ExportDefaultDeclaration, ExportDefaultDeclarationKind, ExportNamedDeclaration, ExportSpecifier, Expression, ExpressionStatement, ForInStatement, ForOfStatement, ForStatement, ForStatementInit, ForStatementLeft, FormalParameter, FormalParameterRest, Function$1 as Function, FunctionBody, FunctionType, Hashbang, IdentifierName, IdentifierReference, IfStatement, ImportAttribute, ImportAttributeKey, ImportDeclaration, ImportDeclarationSpecifier, ImportDefaultSpecifier, ImportExpression, ImportNamespaceSpecifier, ImportOrExportKind, ImportPhase, ImportSpecifier, JSDocNonNullableType, JSDocNullableType, JSDocUnknownType, JSXAttribute, JSXAttributeItem, JSXAttributeName, JSXAttributeValue, JSXChild, JSXClosingElement, JSXClosingFragment, JSXElement, JSXElementName, JSXEmptyExpression, JSXExpression, JSXExpressionContainer, JSXFragment, JSXIdentifier, JSXMemberExpression, JSXMemberExpressionObject, JSXNamespacedName, JSXOpeningElement, JSXOpeningFragment, JSXSpreadAttribute, JSXSpreadChild, JSXText, LabelIdentifier, LabeledStatement, LogicalExpression, LogicalOperator, MemberExpression, MetaProperty, MethodDefinition, MethodDefinitionKind, MethodDefinitionType, ModuleDeclaration, ModuleExportName, ModuleKind, NewExpression, Node, NullLiteral, NumericLiteral, ObjectAssignmentTarget, ObjectExpression, ObjectPattern, ObjectProperty, ObjectPropertyKind, ParamPattern, ParenthesizedExpression, PrivateFieldExpression, PrivateIdentifier, PrivateInExpression, Program, PropertyDefinition, PropertyDefinitionType, PropertyKey$1 as PropertyKey, PropertyKind, RegExpLiteral, ReturnStatement, SequenceExpression, SimpleAssignmentTarget, Span, SpreadElement, Statement, StaticBlock, StaticMemberExpression, StringLiteral, Super, SwitchCase, SwitchStatement, TSAccessibility, TSAnyKeyword, TSArrayType, TSAsExpression, TSBigIntKeyword, TSBooleanKeyword, TSCallSignatureDeclaration, TSClassImplements, TSConditionalType, TSConstructSignatureDeclaration, TSConstructorType, TSEnumBody, TSEnumDeclaration, TSEnumMember, TSEnumMemberName, TSExportAssignment, TSExternalModuleReference, TSFunctionType, TSGlobalDeclaration, TSImportEqualsDeclaration, TSImportType, TSImportTypeQualifiedName, TSImportTypeQualifier, TSIndexSignature, TSIndexSignatureName, TSIndexedAccessType, TSInferType, TSInstantiationExpression, TSInterfaceBody, TSInterfaceDeclaration, TSInterfaceHeritage, TSIntersectionType, TSIntrinsicKeyword, TSLiteral, TSLiteralType, TSMappedType, TSMappedTypeModifierOperator, TSMethodSignature, TSMethodSignatureKind, TSModuleBlock, TSModuleDeclaration, TSModuleDeclarationKind, TSModuleReference, TSNamedTupleMember, TSNamespaceExportDeclaration, TSNeverKeyword, TSNonNullExpression, TSNullKeyword, TSNumberKeyword, TSObjectKeyword, TSOptionalType, TSParameterProperty, TSParenthesizedType, TSPropertySignature, TSQualifiedName, TSRestType, TSSatisfiesExpression, TSSignature, TSStringKeyword, TSSymbolKeyword, TSTemplateLiteralType, TSThisParameter, TSThisType, TSTupleElement, TSTupleType, TSType, TSTypeAliasDeclaration, TSTypeAnnotation, TSTypeAssertion, TSTypeLiteral, TSTypeName, TSTypeOperator, TSTypeOperatorOperator, TSTypeParameter, TSTypeParameterDeclaration, TSTypeParameterInstantiation, TSTypePredicate, TSTypePredicateName, TSTypeQuery, TSTypeQueryExprName, TSTypeReference, TSUndefinedKeyword, TSUnionType, TSUnknownKeyword, TSVoidKeyword, TaggedTemplateExpression, TemplateElement, TemplateElementValue, TemplateLiteral, ThisExpression, ThrowStatement, TokenType as Token, TryStatement, UnaryExpression, UnaryOperator, UpdateExpression, UpdateOperator, V8IntrinsicExpression, VariableDeclaration, VariableDeclarationKind, VariableDeclarator, WhileStatement, WithStatement, YieldExpression };
1364
+ }
1321
1365
  interface Program extends Span {
1322
1366
  type: "Program";
1323
1367
  body: Array<Directive$1 | Statement>;
@@ -2609,8 +2653,9 @@ type LogicalOperator = "||" | "&&" | "??";
2609
2653
  type UnaryOperator = "+" | "-" | "!" | "~" | "typeof" | "void" | "delete";
2610
2654
  type UpdateOperator = "++" | "--";
2611
2655
  type Node = Program | IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | ThisExpression | ArrayExpression | ObjectExpression | ObjectProperty | TemplateLiteral | TaggedTemplateExpression | TemplateElement | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression | CallExpression | NewExpression | MetaProperty | SpreadElement | UpdateExpression | UnaryExpression | BinaryExpression | PrivateInExpression | LogicalExpression | ConditionalExpression | AssignmentExpression | ArrayAssignmentTarget | ObjectAssignmentTarget | AssignmentTargetRest | AssignmentTargetWithDefault | AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty | SequenceExpression | Super | AwaitExpression | ChainExpression | ParenthesizedExpression | Directive$1 | Hashbang | BlockStatement | VariableDeclaration | VariableDeclarator | EmptyStatement | ExpressionStatement | IfStatement | DoWhileStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | ContinueStatement | BreakStatement | ReturnStatement | WithStatement | SwitchStatement | SwitchCase | LabeledStatement | ThrowStatement | TryStatement | CatchClause | DebuggerStatement | AssignmentPattern | ObjectPattern | BindingProperty | ArrayPattern | BindingRestElement | Function$1 | FunctionBody | ArrowFunctionExpression | YieldExpression | Class | ClassBody | MethodDefinition | PropertyDefinition | PrivateIdentifier | StaticBlock | AccessorProperty | ImportExpression | ImportDeclaration | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportAttribute | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExportSpecifier | V8IntrinsicExpression | BooleanLiteral | NullLiteral | NumericLiteral | StringLiteral | BigIntLiteral | RegExpLiteral | JSXElement | JSXOpeningElement | JSXClosingElement | JSXFragment | JSXOpeningFragment | JSXClosingFragment | JSXNamespacedName | JSXMemberExpression | JSXExpressionContainer | JSXEmptyExpression | JSXAttribute | JSXSpreadAttribute | JSXIdentifier | JSXSpreadChild | JSXText | TSThisParameter | TSEnumDeclaration | TSEnumBody | TSEnumMember | TSTypeAnnotation | TSLiteralType | TSConditionalType | TSUnionType | TSIntersectionType | TSParenthesizedType | TSTypeOperator | TSArrayType | TSIndexedAccessType | TSTupleType | TSNamedTupleMember | TSOptionalType | TSRestType | TSAnyKeyword | TSStringKeyword | TSBooleanKeyword | TSNumberKeyword | TSNeverKeyword | TSIntrinsicKeyword | TSUnknownKeyword | TSNullKeyword | TSUndefinedKeyword | TSVoidKeyword | TSSymbolKeyword | TSThisType | TSObjectKeyword | TSBigIntKeyword | TSTypeReference | TSQualifiedName | TSTypeParameterInstantiation | TSTypeParameter | TSTypeParameterDeclaration | TSTypeAliasDeclaration | TSClassImplements | TSInterfaceDeclaration | TSInterfaceBody | TSPropertySignature | TSIndexSignature | TSCallSignatureDeclaration | TSMethodSignature | TSConstructSignatureDeclaration | TSIndexSignatureName | TSInterfaceHeritage | TSTypePredicate | TSModuleDeclaration | TSGlobalDeclaration | TSModuleBlock | TSTypeLiteral | TSInferType | TSTypeQuery | TSImportType | TSImportTypeQualifiedName | TSFunctionType | TSConstructorType | TSMappedType | TSTemplateLiteralType | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | Decorator | TSExportAssignment | TSNamespaceExportDeclaration | TSInstantiationExpression | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType | ParamPattern;
2612
- //#endregion
2613
- //#region src-js/plugins/scope.d.ts
2656
+ declare namespace scope_d_exports {
2657
+ export { Definition, DefinitionType, Reference, SCOPE_MANAGER, Scope, ScopeManager, ScopeType, Variable, getDeclaredVariables, getScope, isGlobalReference, markVariableAsUsed, resetScopeManager };
2658
+ }
2614
2659
  interface Scope {
2615
2660
  type: ScopeType;
2616
2661
  isStrict: boolean;
@@ -2656,6 +2701,38 @@ interface Definition {
2656
2701
  }
2657
2702
  type DefinitionType = "CatchClause" | "ClassName" | "FunctionName" | "ImplicitGlobalVariable" | "ImportBinding" | "Parameter" | "Variable";
2658
2703
  type Identifier = IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | TSThisParameter | TSIndexSignatureName;
2704
+ /**
2705
+ * Discard TS-ESLint `ScopeManager`, to free memory.
2706
+ */
2707
+ declare function resetScopeManager(): void;
2708
+ declare const SCOPE_MANAGER: Readonly<{
2709
+ /**
2710
+ * All scopes.
2711
+ */
2712
+ readonly scopes: Scope[];
2713
+ /**
2714
+ * The root scope.
2715
+ */
2716
+ readonly globalScope: Scope | null;
2717
+ /**
2718
+ * Get the variables that a given AST node defines.
2719
+ * The returned variables' `def[].node` / `def[].parent` property is the node.
2720
+ * If the node does not define any variable, this returns an empty array.
2721
+ * @param node AST node to get variables of.
2722
+ */
2723
+ getDeclaredVariables(node: Node): Variable[];
2724
+ /**
2725
+ * Get the scope of a given AST node. The returned scope's `block` property is the node.
2726
+ * This method never returns `function-expression-name` scope.
2727
+ * If the node does not have a scope, returns `null`.
2728
+ *
2729
+ * @param node An AST node to get their scope.
2730
+ * @param inner If the node has multiple scopes, this returns the outermost scope normally.
2731
+ * If `inner` is `true` then this returns the innermost scope.
2732
+ */
2733
+ acquire(node: Node, inner?: boolean): Scope | null;
2734
+ }>;
2735
+ type ScopeManager = typeof SCOPE_MANAGER;
2659
2736
  /**
2660
2737
  * Determine whether the given identifier node is a reference to a global variable.
2661
2738
  * @param node - `Identifier` node to check.
@@ -2688,8 +2765,9 @@ declare function getScope(node: Node): Scope;
2688
2765
  * @returns `true` if a variable with the given name was found and marked as used, otherwise `false`
2689
2766
  */
2690
2767
  declare function markVariableAsUsed(name: string, refNode?: Node): boolean;
2691
- //#endregion
2692
- //#region src-js/plugins/comments_methods.d.ts
2768
+ declare namespace comments_methods_d_exports {
2769
+ export { commentsExistBetween, getAllComments, getCommentsAfter, getCommentsBefore, getCommentsInside, getJSDocComment };
2770
+ }
2693
2771
  /**
2694
2772
  * Retrieve an array containing all comments in the source code.
2695
2773
  * @returns Array of `Comment`s in order they appear in source.
@@ -2757,8 +2835,9 @@ declare function getJSDocComment(node: Node$1): CommentType | null;
2757
2835
  //#endregion
2758
2836
  //#region src-js/plugins/tokens_and_comments.d.ts
2759
2837
  type TokenOrComment = TokenType | CommentType;
2760
- //#endregion
2761
- //#region src-js/plugins/tokens_methods.d.ts
2838
+ declare namespace tokens_methods_d_exports {
2839
+ export { CountOptions, FilterFn, RangeOptions, SkipOptions, firstTokenAtOrAfter, getFirstToken, getFirstTokenBetween, getFirstTokens, getFirstTokensBetween, getLastToken, getLastTokenBetween, getLastTokens, getLastTokensBetween, getTokenAfter, getTokenBefore, getTokenByRangeStart, getTokenOrCommentAfter, getTokenOrCommentBefore, getTokens, getTokensAfter, getTokensBefore, getTokensBetween, isSpaceBetween, isSpaceBetweenTokens };
2840
+ }
2762
2841
  /**
2763
2842
  * Options for various `SourceCode` methods e.g. `getFirstToken`.
2764
2843
  */
@@ -3008,8 +3087,27 @@ declare function isSpaceBetween(first: NodeOrToken, second: NodeOrToken): boolea
3008
3087
  * any of the tokens found between the two given nodes or tokens.
3009
3088
  */
3010
3089
  declare function isSpaceBetweenTokens(first: NodeOrToken, second: NodeOrToken): boolean;
3011
- //#endregion
3012
- //#region src-js/plugins/directives.d.ts
3090
+ /**
3091
+ * Find the index of the first entry in a `Int32Array` buffer whose `start` is >= `offset`, via binary search.
3092
+ *
3093
+ * Each entry occupies 4 x u32s (16 bytes), with `start` as the first u32.
3094
+ * Searched range starts at `startIndex` and ends at `length`.
3095
+ *
3096
+ * Returns `length` if all entries have `start` < `offset`.
3097
+ *
3098
+ * Note: Source text is limited to 1 GiB max, so number of tokens cannot exceed 2^30.
3099
+ * This makes it safe to use `>> 1` for division by 2 below (which is faster than `>>> 1`).
3100
+ *
3101
+ * @param int32 - `Int32Array` buffer (tokens, comments, or tokensAndComments)
3102
+ * @param offset - Source offset to search for
3103
+ * @param startIndex - Starting entry index for the search
3104
+ * @param length - Total number of entries in the buffer
3105
+ * @returns Index of first entry with `start >= offset`
3106
+ */
3107
+ declare function firstTokenAtOrAfter(int32: Int32Array, offset: number, startIndex: number, length: number): number;
3108
+ declare namespace directives_d_exports {
3109
+ export { getDisableDirectives };
3110
+ }
3013
3111
  interface Problem {
3014
3112
  ruleId: string | null;
3015
3113
  message: string;
@@ -4185,7 +4283,7 @@ interface TestCases {
4185
4283
  /**
4186
4284
  * Utility class for testing rules.
4187
4285
  */
4188
- declare class RuleTester {
4286
+ export declare class RuleTester {
4189
4287
  #private;
4190
4288
  /**
4191
4289
  * Creates a new instance of RuleTester.
@@ -4246,7 +4344,7 @@ type _InvalidTestCase = InvalidTestCase;
4246
4344
  type _TestCases = TestCases;
4247
4345
  type _Error = Error;
4248
4346
  type _ErrorSuggestion = ErrorSuggestion;
4249
- declare namespace RuleTester {
4347
+ export declare namespace RuleTester {
4250
4348
  type Config = _Config;
4251
4349
  type LanguageOptions = _LanguageOptions;
4252
4350
  type Globals = _Globals;
@@ -4263,5 +4361,4 @@ declare namespace RuleTester {
4263
4361
  type Error = _Error;
4264
4362
  type ErrorSuggestion = _ErrorSuggestion;
4265
4363
  }
4266
- //#endregion
4267
- export { RuleTester };
4364
+ //#endregion
@@ -1,5 +1,6 @@
1
- import { S as __toESM, _ as BLOCK_ALIGN, c as registeredRules, d as PLACEHOLDER_REGEX, f as diagnostics, g as ACTIVE_SIZE, h as getNodeByRangeIndex, i as resetStateAfterError, l as allOptions, m as getLineColumnFromOffset, o as registerPlugin, p as replacePlaceholders, r as lintFileImpl, s as registeredPluginNames, t as buffers, u as setOptions, v as BLOCK_SIZE, x as __commonJSMin, y as BUFFER_SIZE } from "./lint.js";
1
+ import { i as __toESM, t as __commonJSMin } from "./rolldown-runtime.js";
2
2
  import { a as rawTransferSupported$1, i as parseRawSync, n as getBufferOffset, t as applyFixes } from "./bindings.js";
3
+ import { _ as BLOCK_ALIGN, c as registeredRules, d as PLACEHOLDER_REGEX, f as diagnostics, g as ACTIVE_SIZE, h as getNodeByRangeIndex, i as resetStateAfterError, l as allOptions, m as getLineColumnFromOffset, o as registerPlugin, p as replacePlaceholders, r as lintFileImpl, s as registeredPluginNames, t as buffers, u as setOptions, v as BLOCK_SIZE, y as BUFFER_SIZE } from "./lint.js";
3
4
  import assert, { AssertionError } from "node:assert";
4
5
  import { dirname, isAbsolute, join } from "node:path";
5
6
  import util from "node:util";
@@ -855,7 +856,7 @@ function isSerializable(value, seenObjects = /* @__PURE__ */ new Set()) {
855
856
  for (let property in value) {
856
857
  if (!ObjectHasOwn(value, property)) continue;
857
858
  let prop = value[property];
858
- if (!isSerializablePrimitiveOrPlainObject(prop) || !(typeof prop != "object" || !prop) && !isSerializable(prop, /* @__PURE__ */ new Set([...seenObjects, value]))) return !1;
859
+ if (!isSerializablePrimitiveOrPlainObject(prop) || typeof prop == "object" && prop && !isSerializable(prop, /* @__PURE__ */ new Set([...seenObjects, value]))) return !1;
859
860
  }
860
861
  return !0;
861
862
  }
@@ -0,0 +1,21 @@
1
+ import { createRequire } from "node:module";
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports), __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: !0
8
+ });
9
+ return no_symbols || __defProp(target, Symbol.toStringTag, { value: "Module" }), target;
10
+ }, __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from == "object" || typeof from == "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) key = keys[i], !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ return to;
16
+ }, __toESM = (mod, isNodeMode, target) => (target = mod == null ? {} : __create(__getProtoOf(mod)), __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
17
+ value: mod,
18
+ enumerable: !0
19
+ }) : target, mod)), __require = /* @__PURE__ */ createRequire(import.meta.url);
20
+ //#endregion
21
+ export { __toESM as i, __exportAll as n, __require as r, __commonJSMin as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint",
3
- "version": "1.80.0",
3
+ "version": "1.82.0",
4
4
  "description": "Linter for the JavaScript Oxidation Compiler",
5
5
  "keywords": [
6
6
  "eslint",
@@ -20,7 +20,7 @@
20
20
  "directory": "npm/oxlint"
21
21
  },
22
22
  "funding": {
23
- "url": "https://github.com/sponsors/Boshen"
23
+ "url": "https://github.com/sponsors/oxc-project"
24
24
  },
25
25
  "bin": {
26
26
  "oxlint": "bin/oxlint"
@@ -87,24 +87,24 @@
87
87
  },
88
88
  "preferUnplugged": true,
89
89
  "optionalDependencies": {
90
- "@oxlint/binding-darwin-arm64": "1.80.0",
91
- "@oxlint/binding-android-arm64": "1.80.0",
92
- "@oxlint/binding-win32-arm64-msvc": "1.80.0",
93
- "@oxlint/binding-linux-arm64-gnu": "1.80.0",
94
- "@oxlint/binding-linux-arm64-musl": "1.80.0",
95
- "@oxlint/binding-openharmony-arm64": "1.80.0",
96
- "@oxlint/binding-android-arm-eabi": "1.80.0",
97
- "@oxlint/binding-linux-arm-gnueabihf": "1.80.0",
98
- "@oxlint/binding-linux-arm-musleabihf": "1.80.0",
99
- "@oxlint/binding-win32-ia32-msvc": "1.80.0",
100
- "@oxlint/binding-linux-ppc64-gnu": "1.80.0",
101
- "@oxlint/binding-linux-riscv64-gnu": "1.80.0",
102
- "@oxlint/binding-linux-riscv64-musl": "1.80.0",
103
- "@oxlint/binding-linux-s390x-gnu": "1.80.0",
104
- "@oxlint/binding-darwin-x64": "1.80.0",
105
- "@oxlint/binding-win32-x64-msvc": "1.80.0",
106
- "@oxlint/binding-freebsd-x64": "1.80.0",
107
- "@oxlint/binding-linux-x64-gnu": "1.80.0",
108
- "@oxlint/binding-linux-x64-musl": "1.80.0"
90
+ "@oxlint/binding-darwin-arm64": "1.82.0",
91
+ "@oxlint/binding-android-arm64": "1.82.0",
92
+ "@oxlint/binding-win32-arm64-msvc": "1.82.0",
93
+ "@oxlint/binding-linux-arm64-gnu": "1.82.0",
94
+ "@oxlint/binding-linux-arm64-musl": "1.82.0",
95
+ "@oxlint/binding-openharmony-arm64": "1.82.0",
96
+ "@oxlint/binding-android-arm-eabi": "1.82.0",
97
+ "@oxlint/binding-linux-arm-gnueabihf": "1.82.0",
98
+ "@oxlint/binding-linux-arm-musleabihf": "1.82.0",
99
+ "@oxlint/binding-win32-ia32-msvc": "1.82.0",
100
+ "@oxlint/binding-linux-ppc64-gnu": "1.82.0",
101
+ "@oxlint/binding-linux-riscv64-gnu": "1.82.0",
102
+ "@oxlint/binding-linux-riscv64-musl": "1.82.0",
103
+ "@oxlint/binding-linux-s390x-gnu": "1.82.0",
104
+ "@oxlint/binding-darwin-x64": "1.82.0",
105
+ "@oxlint/binding-win32-x64-msvc": "1.82.0",
106
+ "@oxlint/binding-freebsd-x64": "1.82.0",
107
+ "@oxlint/binding-linux-x64-gnu": "1.82.0",
108
+ "@oxlint/binding-linux-x64-musl": "1.82.0"
109
109
  }
110
110
  }