oxlint-tailwindcss 1.3.4 → 1.4.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 +29 -21
- package/dist/index.cjs +1472 -362
- package/dist/index.d.cts +121 -122
- package/dist/index.d.mts +121 -122
- package/dist/index.mjs +1473 -363
- package/package.json +9 -10
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@oxlint+plugins@1.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@oxlint+plugins@1.74.0/node_modules/@oxlint/plugins/index.d.ts
|
|
2
2
|
//#endregion
|
|
3
3
|
//#region src-js/plugins/tokens.d.ts
|
|
4
4
|
/**
|
|
@@ -49,7 +49,8 @@ interface StringToken extends BaseToken {
|
|
|
49
49
|
}
|
|
50
50
|
interface TemplateToken extends BaseToken {
|
|
51
51
|
type: "Template";
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
53
54
|
//#region src-js/generated/visitor.d.ts
|
|
54
55
|
// To understand why we need the "Bivariance hack", see: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/20219
|
|
55
56
|
// For downsides, see: https://github.com/oxc-project/oxc/issues/18154#issuecomment-4012955607
|
|
@@ -388,7 +389,8 @@ interface StrictVisitorObject {
|
|
|
388
389
|
TSUnionType?: (node: TSUnionType) => void;
|
|
389
390
|
"TSUnionType:exit"?: (node: TSUnionType) => void;
|
|
390
391
|
}
|
|
391
|
-
type VisitorObject = { [K in keyof StrictVisitorObject]?: BivarianceHackHandler<Exclude<StrictVisitorObject[K], undefined>> | undefined } & Record<string, BivarianceHackHandler<(node: Node$1) => void> | undefined>;
|
|
392
|
+
type VisitorObject = { [K in keyof StrictVisitorObject]?: BivarianceHackHandler<Exclude<StrictVisitorObject[K], undefined>> | undefined; } & Record<string, BivarianceHackHandler<(node: Node$1) => void> | undefined>;
|
|
393
|
+
//#endregion
|
|
392
394
|
//#region src-js/plugins/types.d.ts
|
|
393
395
|
type BeforeHook = () => boolean | void;
|
|
394
396
|
type AfterHook = () => void;
|
|
@@ -397,7 +399,8 @@ type VisitorWithHooks = VisitorObject & {
|
|
|
397
399
|
after?: AfterHook;
|
|
398
400
|
};
|
|
399
401
|
interface Node extends Span {}
|
|
400
|
-
type NodeOrToken = Node | TokenType | CommentType;
|
|
402
|
+
type NodeOrToken = Node | TokenType | CommentType;
|
|
403
|
+
//#endregion
|
|
401
404
|
//#region src-js/plugins/location.d.ts
|
|
402
405
|
/**
|
|
403
406
|
* Range of source offsets.
|
|
@@ -464,7 +467,8 @@ declare function getLoc(nodeOrToken: NodeOrToken): Location;
|
|
|
464
467
|
* @param offset - Range index of the desired node
|
|
465
468
|
* @returns The node if found, or `null` if not found
|
|
466
469
|
*/
|
|
467
|
-
declare function getNodeByRangeIndex(offset: number): Node$1 | null;
|
|
470
|
+
declare function getNodeByRangeIndex(offset: number): Node$1 | null;
|
|
471
|
+
//#endregion
|
|
468
472
|
//#region src-js/plugins/comments.d.ts
|
|
469
473
|
/**
|
|
470
474
|
* Comment.
|
|
@@ -503,7 +507,7 @@ interface BindingIdentifier extends Span {
|
|
|
503
507
|
decorators?: [];
|
|
504
508
|
name: string;
|
|
505
509
|
optional?: false;
|
|
506
|
-
typeAnnotation?: null;
|
|
510
|
+
typeAnnotation?: TSTypeAnnotation | null;
|
|
507
511
|
parent: Node$1;
|
|
508
512
|
}
|
|
509
513
|
interface LabelIdentifier extends Span {
|
|
@@ -916,7 +920,7 @@ interface ObjectPattern extends Span {
|
|
|
916
920
|
decorators?: [];
|
|
917
921
|
properties: Array<BindingProperty | BindingRestElement>;
|
|
918
922
|
optional?: false;
|
|
919
|
-
typeAnnotation?: null;
|
|
923
|
+
typeAnnotation?: TSTypeAnnotation | null;
|
|
920
924
|
parent: Node$1;
|
|
921
925
|
}
|
|
922
926
|
interface BindingProperty extends Span {
|
|
@@ -935,7 +939,7 @@ interface ArrayPattern extends Span {
|
|
|
935
939
|
decorators?: [];
|
|
936
940
|
elements: Array<BindingPattern | BindingRestElement | null>;
|
|
937
941
|
optional?: false;
|
|
938
|
-
typeAnnotation?: null;
|
|
942
|
+
typeAnnotation?: TSTypeAnnotation | null;
|
|
939
943
|
parent: Node$1;
|
|
940
944
|
}
|
|
941
945
|
interface BindingRestElement extends Span {
|
|
@@ -943,7 +947,7 @@ interface BindingRestElement extends Span {
|
|
|
943
947
|
decorators?: [];
|
|
944
948
|
argument: BindingPattern;
|
|
945
949
|
optional?: false;
|
|
946
|
-
typeAnnotation?: null;
|
|
950
|
+
typeAnnotation?: TSTypeAnnotation | null;
|
|
947
951
|
value?: null;
|
|
948
952
|
parent: Node$1;
|
|
949
953
|
}
|
|
@@ -1763,7 +1767,8 @@ type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "+
|
|
|
1763
1767
|
type LogicalOperator = "||" | "&&" | "??";
|
|
1764
1768
|
type UnaryOperator = "+" | "-" | "!" | "~" | "typeof" | "void" | "delete";
|
|
1765
1769
|
type UpdateOperator = "++" | "--";
|
|
1766
|
-
type Node$1 = 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;
|
|
1770
|
+
type Node$1 = 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;
|
|
1771
|
+
//#endregion
|
|
1767
1772
|
//#region src-js/plugins/scope.d.ts
|
|
1768
1773
|
interface Scope {
|
|
1769
1774
|
type: ScopeType;
|
|
@@ -1810,9 +1815,6 @@ interface Definition {
|
|
|
1810
1815
|
}
|
|
1811
1816
|
type DefinitionType = "CatchClause" | "ClassName" | "FunctionName" | "ImplicitGlobalVariable" | "ImportBinding" | "Parameter" | "Variable";
|
|
1812
1817
|
type Identifier = IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | TSThisParameter | TSIndexSignatureName;
|
|
1813
|
-
/**
|
|
1814
|
-
* Discard TS-ESLint `ScopeManager`, to free memory.
|
|
1815
|
-
*/
|
|
1816
1818
|
/**
|
|
1817
1819
|
* Determine whether the given identifier node is a reference to a global variable.
|
|
1818
1820
|
* @param node - `Identifier` node to check.
|
|
@@ -1844,7 +1846,8 @@ declare function getScope(node: Node$1): Scope;
|
|
|
1844
1846
|
* @param refNode - Reference node. Defaults to `Program` node if not provided.
|
|
1845
1847
|
* @returns `true` if a variable with the given name was found and marked as used, otherwise `false`
|
|
1846
1848
|
*/
|
|
1847
|
-
declare function markVariableAsUsed(name: string, refNode?: Node$1): boolean;
|
|
1849
|
+
declare function markVariableAsUsed(name: string, refNode?: Node$1): boolean;
|
|
1850
|
+
//#endregion
|
|
1848
1851
|
//#region src-js/plugins/comments_methods.d.ts
|
|
1849
1852
|
/**
|
|
1850
1853
|
* Retrieve an array containing all comments in the source code.
|
|
@@ -1909,9 +1912,11 @@ declare function commentsExistBetween(nodeOrToken1: NodeOrToken, nodeOrToken2: N
|
|
|
1909
1912
|
* @param node - The AST node to get the comment for.
|
|
1910
1913
|
* @returns The JSDoc comment for the given node, or `null` if not found.
|
|
1911
1914
|
*/
|
|
1912
|
-
declare function getJSDocComment(node: Node): CommentType | null;
|
|
1915
|
+
declare function getJSDocComment(node: Node): CommentType | null;
|
|
1916
|
+
//#endregion
|
|
1913
1917
|
//#region src-js/plugins/tokens_and_comments.d.ts
|
|
1914
|
-
type TokenOrComment = TokenType | CommentType;
|
|
1918
|
+
type TokenOrComment = TokenType | CommentType;
|
|
1919
|
+
//#endregion
|
|
1915
1920
|
//#region src-js/plugins/tokens_methods.d.ts
|
|
1916
1921
|
/**
|
|
1917
1922
|
* Options for various `SourceCode` methods e.g. `getFirstToken`.
|
|
@@ -2161,7 +2166,8 @@ declare function isSpaceBetween(first: NodeOrToken, second: NodeOrToken): boolea
|
|
|
2161
2166
|
* @returns `true` if there is a whitespace character between
|
|
2162
2167
|
* any of the tokens found between the two given nodes or tokens.
|
|
2163
2168
|
*/
|
|
2164
|
-
declare function isSpaceBetweenTokens(first: NodeOrToken, second: NodeOrToken): boolean;
|
|
2169
|
+
declare function isSpaceBetweenTokens(first: NodeOrToken, second: NodeOrToken): boolean;
|
|
2170
|
+
//#endregion
|
|
2165
2171
|
//#region src-js/plugins/directives.d.ts
|
|
2166
2172
|
interface Problem {
|
|
2167
2173
|
ruleId: string | null;
|
|
@@ -2178,7 +2184,8 @@ interface Directive {
|
|
|
2178
2184
|
declare function getDisableDirectives(): {
|
|
2179
2185
|
problems: Problem[];
|
|
2180
2186
|
directives: Directive[];
|
|
2181
|
-
};
|
|
2187
|
+
};
|
|
2188
|
+
//#endregion
|
|
2182
2189
|
//#region src-js/plugins/json.d.ts
|
|
2183
2190
|
/**
|
|
2184
2191
|
* A JSON value.
|
|
@@ -2189,7 +2196,8 @@ type JsonValue = JsonObject | JsonValue[] | string | number | boolean | null;
|
|
|
2189
2196
|
*/
|
|
2190
2197
|
type JsonObject = {
|
|
2191
2198
|
[key: string]: JsonValue;
|
|
2192
|
-
};
|
|
2199
|
+
};
|
|
2200
|
+
//#endregion
|
|
2193
2201
|
//#region src-js/plugins/globals.d.ts
|
|
2194
2202
|
/**
|
|
2195
2203
|
* Globals for the file being linted.
|
|
@@ -2203,7 +2211,8 @@ type Globals = Record<string, "readonly" | "writable" | "off">;
|
|
|
2203
2211
|
*
|
|
2204
2212
|
* Only includes environments that are enabled, so all properties are `true`.
|
|
2205
2213
|
*/
|
|
2206
|
-
type Envs = Record<string, true>;
|
|
2214
|
+
type Envs = Record<string, true>;
|
|
2215
|
+
//#endregion
|
|
2207
2216
|
//#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
|
|
2208
2217
|
// ==================================================================================================
|
|
2209
2218
|
// JSON Schema Draft 04
|
|
@@ -2212,15 +2221,17 @@ type Envs = Record<string, true>; //#endregion
|
|
|
2212
2221
|
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
|
|
2213
2222
|
*/
|
|
2214
2223
|
type JSONSchema4TypeName = "string" //
|
|
2215
|
-
| "number" | "integer" | "boolean" | "object" | "array" | "null" | "any";
|
|
2224
|
+
| "number" | "integer" | "boolean" | "object" | "array" | "null" | "any";
|
|
2216
2225
|
/**
|
|
2217
2226
|
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
|
|
2218
2227
|
*/
|
|
2219
2228
|
type JSONSchema4Type = string //
|
|
2220
|
-
| number | boolean | JSONSchema4Object | JSONSchema4Array | null;
|
|
2229
|
+
| number | boolean | JSONSchema4Object | JSONSchema4Array | null;
|
|
2230
|
+
// Workaround for infinite type recursion
|
|
2221
2231
|
interface JSONSchema4Object {
|
|
2222
2232
|
[key: string]: JSONSchema4Type;
|
|
2223
|
-
}
|
|
2233
|
+
}
|
|
2234
|
+
// Workaround for infinite type recursion
|
|
2224
2235
|
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
|
|
2225
2236
|
interface JSONSchema4Array extends Array<JSONSchema4Type> {}
|
|
2226
2237
|
/**
|
|
@@ -2399,7 +2410,8 @@ interface JSONSchema4 {
|
|
|
2399
2410
|
*/
|
|
2400
2411
|
[k: string]: any;
|
|
2401
2412
|
format?: string | undefined;
|
|
2402
|
-
}
|
|
2413
|
+
}
|
|
2414
|
+
//#endregion
|
|
2403
2415
|
//#region src-js/plugins/options.d.ts
|
|
2404
2416
|
/**
|
|
2405
2417
|
* Options for a rule on a file.
|
|
@@ -2414,8 +2426,9 @@ type Options = JsonValue[];
|
|
|
2414
2426
|
* - `JSONSchema4[]` - Array shorthand where each element describes corresponding options element.
|
|
2415
2427
|
* - `false` - Opts out of schema validation (not recommended).
|
|
2416
2428
|
*/
|
|
2417
|
-
type RuleOptionsSchema = JSONSchema4 | JSONSchema4[] | false;
|
|
2418
|
-
//#
|
|
2429
|
+
type RuleOptionsSchema = JSONSchema4 | JSONSchema4[] | false;
|
|
2430
|
+
//#endregion
|
|
2431
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-any.d.ts
|
|
2419
2432
|
/**
|
|
2420
2433
|
Returns a boolean for whether the given type is `any`.
|
|
2421
2434
|
|
|
@@ -2444,8 +2457,9 @@ const anyA = get(anyObject, 'a');
|
|
|
2444
2457
|
@category Type Guard
|
|
2445
2458
|
@category Utilities
|
|
2446
2459
|
*/
|
|
2447
|
-
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
2448
|
-
//#
|
|
2460
|
+
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
2461
|
+
//#endregion
|
|
2462
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
2449
2463
|
/**
|
|
2450
2464
|
Returns a boolean for whether the given key is an optional key of type.
|
|
2451
2465
|
|
|
@@ -2486,8 +2500,9 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
2486
2500
|
@category Type Guard
|
|
2487
2501
|
@category Utilities
|
|
2488
2502
|
*/
|
|
2489
|
-
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;
|
|
2490
|
-
//#
|
|
2503
|
+
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;
|
|
2504
|
+
//#endregion
|
|
2505
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
2491
2506
|
/**
|
|
2492
2507
|
Extract all optional keys from the given type.
|
|
2493
2508
|
|
|
@@ -2522,9 +2537,10 @@ const update2: UpdateOperation<User> = {
|
|
|
2522
2537
|
@category Utilities
|
|
2523
2538
|
*/
|
|
2524
2539
|
type OptionalKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
2525
|
-
? (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`
|
|
2526
|
-
: never;
|
|
2527
|
-
//#
|
|
2540
|
+
? (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`
|
|
2541
|
+
: never; // Should never happen
|
|
2542
|
+
//#endregion
|
|
2543
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
2528
2544
|
/**
|
|
2529
2545
|
Extract all required keys from the given type.
|
|
2530
2546
|
|
|
@@ -2556,8 +2572,9 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
|
2556
2572
|
@category Utilities
|
|
2557
2573
|
*/
|
|
2558
2574
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
2559
|
-
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
2560
|
-
//#
|
|
2575
|
+
? Exclude<keyof Type, OptionalKeysOf<Type>> : never; // Should never happen
|
|
2576
|
+
//#endregion
|
|
2577
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-never.d.ts
|
|
2561
2578
|
/**
|
|
2562
2579
|
Returns a boolean for whether the given type is `never`.
|
|
2563
2580
|
|
|
@@ -2611,8 +2628,9 @@ type B = IsTrueFixed<never>;
|
|
|
2611
2628
|
@category Type Guard
|
|
2612
2629
|
@category Utilities
|
|
2613
2630
|
*/
|
|
2614
|
-
type IsNever<T> = [T] extends [never] ? true : false;
|
|
2615
|
-
//#
|
|
2631
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
2632
|
+
//#endregion
|
|
2633
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/if.d.ts
|
|
2616
2634
|
/**
|
|
2617
2635
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
2618
2636
|
|
|
@@ -2705,23 +2723,24 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
2705
2723
|
@category Type Guard
|
|
2706
2724
|
@category Utilities
|
|
2707
2725
|
*/
|
|
2708
|
-
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
2709
|
-
//#
|
|
2726
|
+
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
2727
|
+
//#endregion
|
|
2728
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/internal/type.d.ts
|
|
2710
2729
|
/**
|
|
2711
2730
|
An if-else-like type that resolves depending on whether the given type is `any` or `never`.
|
|
2712
2731
|
|
|
2713
2732
|
@example
|
|
2714
2733
|
```
|
|
2715
|
-
// When `T` is
|
|
2716
|
-
type A = IfNotAnyOrNever<string, 'VALID'
|
|
2734
|
+
// When `T` is neither `any` nor `never` (like `string`) => Returns `IfNot` branch
|
|
2735
|
+
type A = IfNotAnyOrNever<string, {ifNot: 'VALID'; ifAny: 'IS_ANY'; ifNever: 'IS_NEVER'}>;
|
|
2717
2736
|
//=> 'VALID'
|
|
2718
2737
|
|
|
2719
2738
|
// When `T` is `any` => Returns `IfAny` branch
|
|
2720
|
-
type B = IfNotAnyOrNever<any, 'VALID'
|
|
2739
|
+
type B = IfNotAnyOrNever<any, {ifNot: 'VALID'; ifAny: 'IS_ANY'; ifNever: 'IS_NEVER'}>;
|
|
2721
2740
|
//=> 'IS_ANY'
|
|
2722
2741
|
|
|
2723
2742
|
// When `T` is `never` => Returns `IfNever` branch
|
|
2724
|
-
type C = IfNotAnyOrNever<never, 'VALID'
|
|
2743
|
+
type C = IfNotAnyOrNever<never, {ifNot: 'VALID'; ifAny: 'IS_ANY'; ifNever: 'IS_NEVER'}>;
|
|
2725
2744
|
//=> 'IS_NEVER'
|
|
2726
2745
|
```
|
|
2727
2746
|
|
|
@@ -2734,7 +2753,7 @@ import type {StringRepeat} from 'type-fest';
|
|
|
2734
2753
|
type NineHundredNinetyNineSpaces = StringRepeat<' ', 999>;
|
|
2735
2754
|
|
|
2736
2755
|
// The following implementation is not tail recursive
|
|
2737
|
-
type TrimLeft<S extends string> = IfNotAnyOrNever<S, S extends ` ${infer R}` ? TrimLeft<R> : S>;
|
|
2756
|
+
type TrimLeft<S extends string> = IfNotAnyOrNever<S, {ifNot: S extends ` ${infer R}` ? TrimLeft<R> : S}>;
|
|
2738
2757
|
|
|
2739
2758
|
// Hence, instantiations with long strings will fail
|
|
2740
2759
|
// @ts-expect-error
|
|
@@ -2743,7 +2762,7 @@ type T1 = TrimLeft<NineHundredNinetyNineSpaces>;
|
|
|
2743
2762
|
// Error: Type instantiation is excessively deep and possibly infinite.
|
|
2744
2763
|
|
|
2745
2764
|
// To fix this, move the recursion into a helper type
|
|
2746
|
-
type TrimLeftOptimised<S extends string> = IfNotAnyOrNever<S, _TrimLeftOptimised<S
|
|
2765
|
+
type TrimLeftOptimised<S extends string> = IfNotAnyOrNever<S, {ifNot: _TrimLeftOptimised<S>}>;
|
|
2747
2766
|
|
|
2748
2767
|
type _TrimLeftOptimised<S extends string> = S extends ` ${infer R}` ? _TrimLeftOptimised<R> : S;
|
|
2749
2768
|
|
|
@@ -2751,8 +2770,13 @@ type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
|
|
|
2751
2770
|
//=> ''
|
|
2752
2771
|
```
|
|
2753
2772
|
*/
|
|
2754
|
-
type IfNotAnyOrNever<T,
|
|
2755
|
-
|
|
2773
|
+
type IfNotAnyOrNever<T, Cases extends {
|
|
2774
|
+
ifNot: unknown;
|
|
2775
|
+
ifAny?: unknown;
|
|
2776
|
+
ifNever?: unknown;
|
|
2777
|
+
}> = IsAny<T> extends true ? 'ifAny' extends keyof Cases ? Cases['ifAny'] : any : IsNever<T> extends true ? 'ifNever' extends keyof Cases ? Cases['ifNever'] : never : Cases['ifNot'];
|
|
2778
|
+
//#endregion
|
|
2779
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/simplify.d.ts
|
|
2756
2780
|
/**
|
|
2757
2781
|
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.
|
|
2758
2782
|
|
|
@@ -2811,8 +2835,9 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
2811
2835
|
@see {@link SimplifyDeep}
|
|
2812
2836
|
@category Object
|
|
2813
2837
|
*/
|
|
2814
|
-
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
2815
|
-
//#
|
|
2838
|
+
type Simplify<T> = { [KeyType in keyof T]: T[KeyType]; } & {};
|
|
2839
|
+
//#endregion
|
|
2840
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-equal.d.ts
|
|
2816
2841
|
/**
|
|
2817
2842
|
Returns a boolean for whether the two given types are equal.
|
|
2818
2843
|
|
|
@@ -2839,9 +2864,11 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
2839
2864
|
@category Type Guard
|
|
2840
2865
|
@category Utilities
|
|
2841
2866
|
*/
|
|
2842
|
-
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
2843
|
-
|
|
2844
|
-
|
|
2867
|
+
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
2868
|
+
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
2869
|
+
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
2870
|
+
//#endregion
|
|
2871
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
2845
2872
|
/**
|
|
2846
2873
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
2847
2874
|
|
|
@@ -2933,8 +2960,9 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
2933
2960
|
@see {@link PickIndexSignature}
|
|
2934
2961
|
@category Object
|
|
2935
2962
|
*/
|
|
2936
|
-
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
2937
|
-
//#
|
|
2963
|
+
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType]; };
|
|
2964
|
+
//#endregion
|
|
2965
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
2938
2966
|
/**
|
|
2939
2967
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
2940
2968
|
|
|
@@ -2980,10 +3008,11 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
2980
3008
|
@see {@link OmitIndexSignature}
|
|
2981
3009
|
@category Object
|
|
2982
3010
|
*/
|
|
2983
|
-
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
2984
|
-
//#
|
|
3011
|
+
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType]; };
|
|
3012
|
+
//#endregion
|
|
3013
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/merge.d.ts
|
|
2985
3014
|
// Merges two objects without worrying about index signatures.
|
|
2986
|
-
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
|
|
3015
|
+
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key]; } & Source>;
|
|
2987
3016
|
/**
|
|
2988
3017
|
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
|
2989
3018
|
|
|
@@ -3047,11 +3076,12 @@ Note: If you want a merge type that more accurately reflects the runtime behavio
|
|
|
3047
3076
|
@category Object
|
|
3048
3077
|
*/
|
|
3049
3078
|
type Merge<Destination, Source> = Destination extends unknown // For distributing `Destination`
|
|
3050
|
-
? Source extends unknown // For distributing `Source`
|
|
3051
|
-
? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen
|
|
3052
|
-
: never; // Should never happen
|
|
3053
|
-
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
3054
|
-
//#
|
|
3079
|
+
? Source extends unknown // For distributing `Source`
|
|
3080
|
+
? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen
|
|
3081
|
+
: never; // Should never happen
|
|
3082
|
+
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
3083
|
+
//#endregion
|
|
3084
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/internal/object.d.ts
|
|
3055
3085
|
/**
|
|
3056
3086
|
Merges user specified options with default options.
|
|
3057
3087
|
|
|
@@ -3104,38 +3134,11 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
3104
3134
|
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
3105
3135
|
```
|
|
3106
3136
|
*/
|
|
3107
|
-
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>`
|
|
3108
|
-
? Result : never;
|
|
3109
|
-
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] }>>>;
|
|
3110
|
-
/**
|
|
3111
|
-
Collapses literal types in a union into their corresponding primitive types, when possible. For example, `CollapseLiterals<'foo' | 'bar' | (string & {})>` returns `string`.
|
|
3112
|
-
|
|
3113
|
-
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>`.
|
|
3114
|
-
|
|
3115
|
-
Use-case: For collapsing unions created using {@link LiteralUnion}.
|
|
3116
|
-
|
|
3117
|
-
@example
|
|
3118
|
-
```
|
|
3119
|
-
import type {LiteralUnion} from 'type-fest';
|
|
3120
|
-
|
|
3121
|
-
type A = CollapseLiterals<'foo' | 'bar' | (string & {})>;
|
|
3122
|
-
//=> string
|
|
3123
|
-
|
|
3124
|
-
type B = CollapseLiterals<LiteralUnion<1 | 2 | 3, number>>;
|
|
3125
|
-
//=> number
|
|
3126
|
-
|
|
3127
|
-
type C = CollapseLiterals<LiteralUnion<'onClick' | 'onChange', `on${string}`>>;
|
|
3128
|
-
//=> `on${string}`
|
|
3129
|
-
|
|
3130
|
-
type D = CollapseLiterals<'click' | 'change' | (`on${string}` & {})>;
|
|
3131
|
-
//=> 'click' | 'change' | `on${string}`
|
|
3132
|
-
|
|
3133
|
-
type E = CollapseLiterals<LiteralUnion<'foo' | 'bar', string> | null | undefined>;
|
|
3134
|
-
//=> string | null | undefined
|
|
3135
|
-
```
|
|
3136
|
-
*/
|
|
3137
|
+
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>`
|
|
3138
|
+
) ? Result : never;
|
|
3139
|
+
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]; }>>>;
|
|
3137
3140
|
//#endregion
|
|
3138
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
3141
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/except.d.ts
|
|
3139
3142
|
/**
|
|
3140
3143
|
Filter out keys from an object.
|
|
3141
3144
|
|
|
@@ -3166,10 +3169,12 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
|
3166
3169
|
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
3167
3170
|
type ExceptOptions = {
|
|
3168
3171
|
/**
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3172
|
+
Disallow assigning non-specified properties.
|
|
3173
|
+
|
|
3174
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
3175
|
+
|
|
3176
|
+
@default false
|
|
3177
|
+
*/
|
|
3173
3178
|
requireExactProps?: boolean;
|
|
3174
3179
|
};
|
|
3175
3180
|
type DefaultExceptOptions = {
|
|
@@ -3231,8 +3236,9 @@ type PostPayloadFixed = Except<UserData, 'email'>;
|
|
|
3231
3236
|
@category Object
|
|
3232
3237
|
*/
|
|
3233
3238
|
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
3234
|
-
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>> : {});
|
|
3235
|
-
//#
|
|
3239
|
+
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>> : {});
|
|
3240
|
+
//#endregion
|
|
3241
|
+
//#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/require-at-least-one.d.ts
|
|
3236
3242
|
/**
|
|
3237
3243
|
Create a type that requires at least one of the given keys, while keeping the remaining keys as is.
|
|
3238
3244
|
|
|
@@ -3254,11 +3260,14 @@ const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
|
|
|
3254
3260
|
|
|
3255
3261
|
@category Object
|
|
3256
3262
|
*/
|
|
3257
|
-
type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType,
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3263
|
+
type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, {
|
|
3264
|
+
ifNot: If<IsNever<KeysType>, never, _RequireAtLeastOne<ObjectType, If<IsAny<KeysType>, keyof ObjectType, KeysType>>>;
|
|
3265
|
+
}>;
|
|
3266
|
+
type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = { [
|
|
3267
|
+
// For each `Key` in `KeysType` make a mapped type:
|
|
3268
|
+
Key in KeysType]-?: Required<Pick<ObjectType, Key>> // 1. Make `Key`'s type required
|
|
3269
|
+
& Partial<Pick<ObjectType, Exclude<KeysType, Key>>> // 2. Make all other keys in `KeysType` optional
|
|
3270
|
+
; }[KeysType] & Except<ObjectType, KeysType>; // 3. Add the remaining keys not in `KeysType`
|
|
3262
3271
|
//#endregion
|
|
3263
3272
|
//#region src-js/plugins/fix.d.ts
|
|
3264
3273
|
type FixFn = (fixer: Fixer) => Fix | Array<Fix | null | undefined> | IterableIterator<Fix | null | undefined> | null | undefined;
|
|
@@ -3285,7 +3294,8 @@ declare const FIXER: Readonly<{
|
|
|
3285
3294
|
replaceText(nodeOrToken: Ranged, text: string): Fix;
|
|
3286
3295
|
replaceTextRange(range: Range, text: string): Fix;
|
|
3287
3296
|
}>;
|
|
3288
|
-
type Fixer = typeof FIXER;
|
|
3297
|
+
type Fixer = typeof FIXER;
|
|
3298
|
+
//#endregion
|
|
3289
3299
|
//#region src-js/plugins/report.d.ts
|
|
3290
3300
|
/**
|
|
3291
3301
|
* Diagnostic object.
|
|
@@ -3325,9 +3335,6 @@ interface SuggestionBase {
|
|
|
3325
3335
|
data?: DiagnosticData | null | undefined;
|
|
3326
3336
|
fix: FixFn;
|
|
3327
3337
|
}
|
|
3328
|
-
/**
|
|
3329
|
-
* Suggested fix in form sent to Rust.
|
|
3330
|
-
*/
|
|
3331
3338
|
//#endregion
|
|
3332
3339
|
//#region src-js/plugins/source_code.d.ts
|
|
3333
3340
|
declare const SOURCE_CODE: Readonly<{
|
|
@@ -3434,8 +3441,7 @@ declare const SOURCE_CODE: Readonly<{
|
|
|
3434
3441
|
isSpaceBetweenTokens: typeof isSpaceBetweenTokens;
|
|
3435
3442
|
getDisableDirectives: typeof getDisableDirectives;
|
|
3436
3443
|
}>;
|
|
3437
|
-
type SourceCode = typeof SOURCE_CODE;
|
|
3438
|
-
//#region src-js/plugins/context.d.ts
|
|
3444
|
+
type SourceCode = typeof SOURCE_CODE;
|
|
3439
3445
|
declare const FILE_CONTEXT: Readonly<{
|
|
3440
3446
|
/**
|
|
3441
3447
|
* Absolute path of the file being linted.
|
|
@@ -3825,7 +3831,8 @@ interface Context extends FileContext {
|
|
|
3825
3831
|
* Report an error/warning.
|
|
3826
3832
|
*/
|
|
3827
3833
|
report(this: void, diagnostic: Diagnostic): void;
|
|
3828
|
-
}
|
|
3834
|
+
}
|
|
3835
|
+
//#endregion
|
|
3829
3836
|
//#region src-js/plugins/rule_meta.d.ts
|
|
3830
3837
|
/**
|
|
3831
3838
|
* Rule metadata.
|
|
@@ -3978,7 +3985,8 @@ interface RuleReplacedByExternalSpecifier {
|
|
|
3978
3985
|
* URL pointing to documentation for the plugin / rule.
|
|
3979
3986
|
*/
|
|
3980
3987
|
url?: string;
|
|
3981
|
-
}
|
|
3988
|
+
}
|
|
3989
|
+
//#endregion
|
|
3982
3990
|
//#region src-js/plugins/load.d.ts
|
|
3983
3991
|
/**
|
|
3984
3992
|
* Linter plugin, comprising multiple rules
|
|
@@ -4007,16 +4015,7 @@ interface CreateOnceRule {
|
|
|
4007
4015
|
meta?: RuleMeta;
|
|
4008
4016
|
create?: (context: Context) => VisitorObject;
|
|
4009
4017
|
createOnce: (context: Context) => VisitorWithHooks;
|
|
4010
|
-
}
|
|
4011
|
-
//#region src-js/package/define.d.ts
|
|
4012
|
-
/**
|
|
4013
|
-
* Define a plugin.
|
|
4014
|
-
*
|
|
4015
|
-
* No-op function, just to provide type safety. Input is passed through unchanged.
|
|
4016
|
-
*
|
|
4017
|
-
* @param plugin - Plugin to define
|
|
4018
|
-
* @returns Same plugin as passed in
|
|
4019
|
-
*/
|
|
4018
|
+
}
|
|
4020
4019
|
//#endregion
|
|
4021
4020
|
//#region src/index.d.ts
|
|
4022
4021
|
declare const plugin: Plugin;
|