oxlint-tailwindcss 1.3.4 → 1.3.5
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 +5 -4
- package/dist/index.cjs +2 -5
- package/dist/index.d.cts +88 -66
- package/dist/index.d.mts +88 -66
- package/dist/index.mjs +2 -5
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -205,11 +205,12 @@ Output:
|
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
If no entry point is configured, the DS-dependent rules (`no-unknown-classes`,
|
|
208
|
-
`no-conflicting-classes`, `
|
|
208
|
+
`no-conflicting-classes`, `enforce-canonical`, `enforce-sort-order`,
|
|
209
209
|
`no-unnecessary-arbitrary-value`, `prefer-theme-tokens`) emit a single `designSystemUnavailable`
|
|
210
|
-
diagnostic per file with an actionable hint — no more silent skips. `consistent-variant-order`
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
diagnostic per file with an actionable hint — no more silent skips. `consistent-variant-order`
|
|
211
|
+
tolerates a missing entryPoint (its static fallback is itself deterministic), and
|
|
212
|
+
`no-deprecated-classes` needs no design system at all (it only consults a hardcoded v3→v4 rename
|
|
213
|
+
map). All non-DS rules work without an entry point.
|
|
213
214
|
|
|
214
215
|
## Custom class detection
|
|
215
216
|
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ let node_crypto = require("node:crypto");
|
|
|
3
3
|
let node_fs = require("node:fs");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
let node_os = require("node:os");
|
|
6
|
-
//#region ../../node_modules/.pnpm/@oxlint+plugins@1.
|
|
6
|
+
//#region ../../node_modules/.pnpm/@oxlint+plugins@1.73.0/node_modules/@oxlint/plugins/index.js
|
|
7
7
|
/**
|
|
8
8
|
* Define a plugin.
|
|
9
9
|
*
|
|
@@ -2485,15 +2485,12 @@ const noDeprecatedClasses = defineRule({
|
|
|
2485
2485
|
defaultOptions: [{}],
|
|
2486
2486
|
messages: {
|
|
2487
2487
|
deprecated: "\"{{className}}\" is deprecated in Tailwind v4. Use \"{{replacement}}\" instead.",
|
|
2488
|
-
suggestReplace: "Replace \"{{className}}\" with \"{{replacement}}\"."
|
|
2489
|
-
...DS_UNAVAILABLE_MESSAGE
|
|
2488
|
+
suggestReplace: "Replace \"{{className}}\" with \"{{replacement}}\"."
|
|
2490
2489
|
}
|
|
2491
2490
|
},
|
|
2492
2491
|
createOnce(context) {
|
|
2493
|
-
const getDS = createLazyLoader(context);
|
|
2494
2492
|
function check(locations) {
|
|
2495
2493
|
if (locations.length === 0) return;
|
|
2496
|
-
if (!safeGetDS(getDS, context, locations[0].node)) return;
|
|
2497
2494
|
for (const loc of locations) {
|
|
2498
2495
|
const split = splitClassesWithSeparators(loc.value);
|
|
2499
2496
|
const offending = split.classes.flatMap((cls) => {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@oxlint+plugins@1.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@oxlint+plugins@1.73.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,7 +2426,8 @@ 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;
|
|
2429
|
+
type RuleOptionsSchema = JSONSchema4 | JSONSchema4[] | false;
|
|
2430
|
+
//#endregion
|
|
2418
2431
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-any.d.ts
|
|
2419
2432
|
/**
|
|
2420
2433
|
Returns a boolean for whether the given type is `any`.
|
|
@@ -2444,7 +2457,8 @@ 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;
|
|
2460
|
+
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
2461
|
+
//#endregion
|
|
2448
2462
|
//#region ../../node_modules/.pnpm/type-fest@5.7.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.
|
|
@@ -2486,7 +2500,8 @@ 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;
|
|
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
|
|
2490
2505
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
2491
2506
|
/**
|
|
2492
2507
|
Extract all optional keys from the given type.
|
|
@@ -2522,8 +2537,9 @@ 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;
|
|
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;
|
|
2542
|
+
//#endregion
|
|
2527
2543
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
2528
2544
|
/**
|
|
2529
2545
|
Extract all required keys from the given type.
|
|
@@ -2556,7 +2572,8 @@ 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;
|
|
2575
|
+
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
2576
|
+
//#endregion
|
|
2560
2577
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-never.d.ts
|
|
2561
2578
|
/**
|
|
2562
2579
|
Returns a boolean for whether the given type is `never`.
|
|
@@ -2611,7 +2628,8 @@ type B = IsTrueFixed<never>;
|
|
|
2611
2628
|
@category Type Guard
|
|
2612
2629
|
@category Utilities
|
|
2613
2630
|
*/
|
|
2614
|
-
type IsNever<T> = [T] extends [never] ? true : false;
|
|
2631
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
2632
|
+
//#endregion
|
|
2615
2633
|
//#region ../../node_modules/.pnpm/type-fest@5.7.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`.
|
|
@@ -2705,7 +2723,8 @@ 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;
|
|
2726
|
+
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
2727
|
+
//#endregion
|
|
2709
2728
|
//#region ../../node_modules/.pnpm/type-fest@5.7.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`.
|
|
@@ -2751,7 +2770,8 @@ type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
|
|
|
2751
2770
|
//=> ''
|
|
2752
2771
|
```
|
|
2753
2772
|
*/
|
|
2754
|
-
type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever>>;
|
|
2773
|
+
type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever>>;
|
|
2774
|
+
//#endregion
|
|
2755
2775
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/simplify.d.ts
|
|
2756
2776
|
/**
|
|
2757
2777
|
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
@@ -2811,7 +2831,8 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
2811
2831
|
@see {@link SimplifyDeep}
|
|
2812
2832
|
@category Object
|
|
2813
2833
|
*/
|
|
2814
|
-
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
2834
|
+
type Simplify<T> = { [KeyType in keyof T]: T[KeyType]; } & {};
|
|
2835
|
+
//#endregion
|
|
2815
2836
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-equal.d.ts
|
|
2816
2837
|
/**
|
|
2817
2838
|
Returns a boolean for whether the two given types are equal.
|
|
@@ -2839,8 +2860,10 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
2839
2860
|
@category Type Guard
|
|
2840
2861
|
@category Utilities
|
|
2841
2862
|
*/
|
|
2842
|
-
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
2843
|
-
|
|
2863
|
+
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
2864
|
+
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
2865
|
+
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
2866
|
+
//#endregion
|
|
2844
2867
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
2845
2868
|
/**
|
|
2846
2869
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
@@ -2933,7 +2956,8 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
2933
2956
|
@see {@link PickIndexSignature}
|
|
2934
2957
|
@category Object
|
|
2935
2958
|
*/
|
|
2936
|
-
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
2959
|
+
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType]; };
|
|
2960
|
+
//#endregion
|
|
2937
2961
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
2938
2962
|
/**
|
|
2939
2963
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
@@ -2980,10 +3004,11 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
2980
3004
|
@see {@link OmitIndexSignature}
|
|
2981
3005
|
@category Object
|
|
2982
3006
|
*/
|
|
2983
|
-
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
3007
|
+
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType]; };
|
|
3008
|
+
//#endregion
|
|
2984
3009
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/merge.d.ts
|
|
2985
3010
|
// 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>;
|
|
3011
|
+
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key]; } & Source>;
|
|
2987
3012
|
/**
|
|
2988
3013
|
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
|
2989
3014
|
|
|
@@ -3047,10 +3072,12 @@ Note: If you want a merge type that more accurately reflects the runtime behavio
|
|
|
3047
3072
|
@category Object
|
|
3048
3073
|
*/
|
|
3049
3074
|
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;
|
|
3053
|
-
|
|
3075
|
+
? Source extends unknown // For distributing `Source`
|
|
3076
|
+
? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen
|
|
3077
|
+
: never;
|
|
3078
|
+
// Should never happen
|
|
3079
|
+
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
3080
|
+
//#endregion
|
|
3054
3081
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/internal/object.d.ts
|
|
3055
3082
|
/**
|
|
3056
3083
|
Merges user specified options with default options.
|
|
@@ -3104,9 +3131,9 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
3104
3131
|
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
3105
3132
|
```
|
|
3106
3133
|
*/
|
|
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] }>>>;
|
|
3134
|
+
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>`
|
|
3135
|
+
) ? Result : never;
|
|
3136
|
+
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
3137
|
/**
|
|
3111
3138
|
Collapses literal types in a union into their corresponding primitive types, when possible. For example, `CollapseLiterals<'foo' | 'bar' | (string & {})>` returns `string`.
|
|
3112
3139
|
|
|
@@ -3231,7 +3258,8 @@ type PostPayloadFixed = Except<UserData, 'email'>;
|
|
|
3231
3258
|
@category Object
|
|
3232
3259
|
*/
|
|
3233
3260
|
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>> : {});
|
|
3261
|
+
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>> : {});
|
|
3262
|
+
//#endregion
|
|
3235
3263
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/require-at-least-one.d.ts
|
|
3236
3264
|
/**
|
|
3237
3265
|
Create a type that requires at least one of the given keys, while keeping the remaining keys as is.
|
|
@@ -3255,10 +3283,11 @@ const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
|
|
|
3255
3283
|
@category Object
|
|
3256
3284
|
*/
|
|
3257
3285
|
type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, If<IsNever<KeysType>, never, _RequireAtLeastOne<ObjectType, If<IsAny<KeysType>, keyof ObjectType, KeysType>>>>;
|
|
3258
|
-
type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = {
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3286
|
+
type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = { [
|
|
3287
|
+
// For each `Key` in `KeysType` make a mapped type:
|
|
3288
|
+
// 2. Make all other keys in `KeysType` optional
|
|
3289
|
+
Key in KeysType]-?: Required<Pick<ObjectType, Key>> // 1. Make `Key`'s type required
|
|
3290
|
+
& Partial<Pick<ObjectType, Exclude<KeysType, Key>>>; }[KeysType] & Except<ObjectType, KeysType>; // 3. Add the remaining keys not in `KeysType`
|
|
3262
3291
|
//#endregion
|
|
3263
3292
|
//#region src-js/plugins/fix.d.ts
|
|
3264
3293
|
type FixFn = (fixer: Fixer) => Fix | Array<Fix | null | undefined> | IterableIterator<Fix | null | undefined> | null | undefined;
|
|
@@ -3285,7 +3314,8 @@ declare const FIXER: Readonly<{
|
|
|
3285
3314
|
replaceText(nodeOrToken: Ranged, text: string): Fix;
|
|
3286
3315
|
replaceTextRange(range: Range, text: string): Fix;
|
|
3287
3316
|
}>;
|
|
3288
|
-
type Fixer = typeof FIXER;
|
|
3317
|
+
type Fixer = typeof FIXER;
|
|
3318
|
+
//#endregion
|
|
3289
3319
|
//#region src-js/plugins/report.d.ts
|
|
3290
3320
|
/**
|
|
3291
3321
|
* Diagnostic object.
|
|
@@ -3434,8 +3464,7 @@ declare const SOURCE_CODE: Readonly<{
|
|
|
3434
3464
|
isSpaceBetweenTokens: typeof isSpaceBetweenTokens;
|
|
3435
3465
|
getDisableDirectives: typeof getDisableDirectives;
|
|
3436
3466
|
}>;
|
|
3437
|
-
type SourceCode = typeof SOURCE_CODE;
|
|
3438
|
-
//#region src-js/plugins/context.d.ts
|
|
3467
|
+
type SourceCode = typeof SOURCE_CODE;
|
|
3439
3468
|
declare const FILE_CONTEXT: Readonly<{
|
|
3440
3469
|
/**
|
|
3441
3470
|
* Absolute path of the file being linted.
|
|
@@ -3825,7 +3854,8 @@ interface Context extends FileContext {
|
|
|
3825
3854
|
* Report an error/warning.
|
|
3826
3855
|
*/
|
|
3827
3856
|
report(this: void, diagnostic: Diagnostic): void;
|
|
3828
|
-
}
|
|
3857
|
+
}
|
|
3858
|
+
//#endregion
|
|
3829
3859
|
//#region src-js/plugins/rule_meta.d.ts
|
|
3830
3860
|
/**
|
|
3831
3861
|
* Rule metadata.
|
|
@@ -3978,7 +4008,8 @@ interface RuleReplacedByExternalSpecifier {
|
|
|
3978
4008
|
* URL pointing to documentation for the plugin / rule.
|
|
3979
4009
|
*/
|
|
3980
4010
|
url?: string;
|
|
3981
|
-
}
|
|
4011
|
+
}
|
|
4012
|
+
//#endregion
|
|
3982
4013
|
//#region src-js/plugins/load.d.ts
|
|
3983
4014
|
/**
|
|
3984
4015
|
* Linter plugin, comprising multiple rules
|
|
@@ -4007,16 +4038,7 @@ interface CreateOnceRule {
|
|
|
4007
4038
|
meta?: RuleMeta;
|
|
4008
4039
|
create?: (context: Context) => VisitorObject;
|
|
4009
4040
|
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
|
-
*/
|
|
4041
|
+
}
|
|
4020
4042
|
//#endregion
|
|
4021
4043
|
//#region src/index.d.ts
|
|
4022
4044
|
declare const plugin: Plugin;
|
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.73.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,7 +2426,8 @@ 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;
|
|
2429
|
+
type RuleOptionsSchema = JSONSchema4 | JSONSchema4[] | false;
|
|
2430
|
+
//#endregion
|
|
2418
2431
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-any.d.ts
|
|
2419
2432
|
/**
|
|
2420
2433
|
Returns a boolean for whether the given type is `any`.
|
|
@@ -2444,7 +2457,8 @@ 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;
|
|
2460
|
+
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
2461
|
+
//#endregion
|
|
2448
2462
|
//#region ../../node_modules/.pnpm/type-fest@5.7.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.
|
|
@@ -2486,7 +2500,8 @@ 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;
|
|
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
|
|
2490
2505
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
2491
2506
|
/**
|
|
2492
2507
|
Extract all optional keys from the given type.
|
|
@@ -2522,8 +2537,9 @@ 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;
|
|
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;
|
|
2542
|
+
//#endregion
|
|
2527
2543
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
2528
2544
|
/**
|
|
2529
2545
|
Extract all required keys from the given type.
|
|
@@ -2556,7 +2572,8 @@ 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;
|
|
2575
|
+
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
2576
|
+
//#endregion
|
|
2560
2577
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-never.d.ts
|
|
2561
2578
|
/**
|
|
2562
2579
|
Returns a boolean for whether the given type is `never`.
|
|
@@ -2611,7 +2628,8 @@ type B = IsTrueFixed<never>;
|
|
|
2611
2628
|
@category Type Guard
|
|
2612
2629
|
@category Utilities
|
|
2613
2630
|
*/
|
|
2614
|
-
type IsNever<T> = [T] extends [never] ? true : false;
|
|
2631
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
2632
|
+
//#endregion
|
|
2615
2633
|
//#region ../../node_modules/.pnpm/type-fest@5.7.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`.
|
|
@@ -2705,7 +2723,8 @@ 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;
|
|
2726
|
+
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
2727
|
+
//#endregion
|
|
2709
2728
|
//#region ../../node_modules/.pnpm/type-fest@5.7.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`.
|
|
@@ -2751,7 +2770,8 @@ type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
|
|
|
2751
2770
|
//=> ''
|
|
2752
2771
|
```
|
|
2753
2772
|
*/
|
|
2754
|
-
type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever>>;
|
|
2773
|
+
type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever>>;
|
|
2774
|
+
//#endregion
|
|
2755
2775
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/simplify.d.ts
|
|
2756
2776
|
/**
|
|
2757
2777
|
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
@@ -2811,7 +2831,8 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
2811
2831
|
@see {@link SimplifyDeep}
|
|
2812
2832
|
@category Object
|
|
2813
2833
|
*/
|
|
2814
|
-
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
2834
|
+
type Simplify<T> = { [KeyType in keyof T]: T[KeyType]; } & {};
|
|
2835
|
+
//#endregion
|
|
2815
2836
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/is-equal.d.ts
|
|
2816
2837
|
/**
|
|
2817
2838
|
Returns a boolean for whether the two given types are equal.
|
|
@@ -2839,8 +2860,10 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
2839
2860
|
@category Type Guard
|
|
2840
2861
|
@category Utilities
|
|
2841
2862
|
*/
|
|
2842
|
-
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
2843
|
-
|
|
2863
|
+
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
2864
|
+
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
2865
|
+
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
2866
|
+
//#endregion
|
|
2844
2867
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
2845
2868
|
/**
|
|
2846
2869
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
@@ -2933,7 +2956,8 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
2933
2956
|
@see {@link PickIndexSignature}
|
|
2934
2957
|
@category Object
|
|
2935
2958
|
*/
|
|
2936
|
-
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
2959
|
+
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType]; };
|
|
2960
|
+
//#endregion
|
|
2937
2961
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
2938
2962
|
/**
|
|
2939
2963
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
@@ -2980,10 +3004,11 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
2980
3004
|
@see {@link OmitIndexSignature}
|
|
2981
3005
|
@category Object
|
|
2982
3006
|
*/
|
|
2983
|
-
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
3007
|
+
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType]; };
|
|
3008
|
+
//#endregion
|
|
2984
3009
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/merge.d.ts
|
|
2985
3010
|
// 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>;
|
|
3011
|
+
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key]; } & Source>;
|
|
2987
3012
|
/**
|
|
2988
3013
|
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
|
2989
3014
|
|
|
@@ -3047,10 +3072,12 @@ Note: If you want a merge type that more accurately reflects the runtime behavio
|
|
|
3047
3072
|
@category Object
|
|
3048
3073
|
*/
|
|
3049
3074
|
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;
|
|
3053
|
-
|
|
3075
|
+
? Source extends unknown // For distributing `Source`
|
|
3076
|
+
? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen
|
|
3077
|
+
: never;
|
|
3078
|
+
// Should never happen
|
|
3079
|
+
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
3080
|
+
//#endregion
|
|
3054
3081
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/internal/object.d.ts
|
|
3055
3082
|
/**
|
|
3056
3083
|
Merges user specified options with default options.
|
|
@@ -3104,9 +3131,9 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
3104
3131
|
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
3105
3132
|
```
|
|
3106
3133
|
*/
|
|
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] }>>>;
|
|
3134
|
+
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>`
|
|
3135
|
+
) ? Result : never;
|
|
3136
|
+
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
3137
|
/**
|
|
3111
3138
|
Collapses literal types in a union into their corresponding primitive types, when possible. For example, `CollapseLiterals<'foo' | 'bar' | (string & {})>` returns `string`.
|
|
3112
3139
|
|
|
@@ -3231,7 +3258,8 @@ type PostPayloadFixed = Except<UserData, 'email'>;
|
|
|
3231
3258
|
@category Object
|
|
3232
3259
|
*/
|
|
3233
3260
|
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>> : {});
|
|
3261
|
+
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>> : {});
|
|
3262
|
+
//#endregion
|
|
3235
3263
|
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/require-at-least-one.d.ts
|
|
3236
3264
|
/**
|
|
3237
3265
|
Create a type that requires at least one of the given keys, while keeping the remaining keys as is.
|
|
@@ -3255,10 +3283,11 @@ const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
|
|
|
3255
3283
|
@category Object
|
|
3256
3284
|
*/
|
|
3257
3285
|
type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, If<IsNever<KeysType>, never, _RequireAtLeastOne<ObjectType, If<IsAny<KeysType>, keyof ObjectType, KeysType>>>>;
|
|
3258
|
-
type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = {
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3286
|
+
type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = { [
|
|
3287
|
+
// For each `Key` in `KeysType` make a mapped type:
|
|
3288
|
+
// 2. Make all other keys in `KeysType` optional
|
|
3289
|
+
Key in KeysType]-?: Required<Pick<ObjectType, Key>> // 1. Make `Key`'s type required
|
|
3290
|
+
& Partial<Pick<ObjectType, Exclude<KeysType, Key>>>; }[KeysType] & Except<ObjectType, KeysType>; // 3. Add the remaining keys not in `KeysType`
|
|
3262
3291
|
//#endregion
|
|
3263
3292
|
//#region src-js/plugins/fix.d.ts
|
|
3264
3293
|
type FixFn = (fixer: Fixer) => Fix | Array<Fix | null | undefined> | IterableIterator<Fix | null | undefined> | null | undefined;
|
|
@@ -3285,7 +3314,8 @@ declare const FIXER: Readonly<{
|
|
|
3285
3314
|
replaceText(nodeOrToken: Ranged, text: string): Fix;
|
|
3286
3315
|
replaceTextRange(range: Range, text: string): Fix;
|
|
3287
3316
|
}>;
|
|
3288
|
-
type Fixer = typeof FIXER;
|
|
3317
|
+
type Fixer = typeof FIXER;
|
|
3318
|
+
//#endregion
|
|
3289
3319
|
//#region src-js/plugins/report.d.ts
|
|
3290
3320
|
/**
|
|
3291
3321
|
* Diagnostic object.
|
|
@@ -3434,8 +3464,7 @@ declare const SOURCE_CODE: Readonly<{
|
|
|
3434
3464
|
isSpaceBetweenTokens: typeof isSpaceBetweenTokens;
|
|
3435
3465
|
getDisableDirectives: typeof getDisableDirectives;
|
|
3436
3466
|
}>;
|
|
3437
|
-
type SourceCode = typeof SOURCE_CODE;
|
|
3438
|
-
//#region src-js/plugins/context.d.ts
|
|
3467
|
+
type SourceCode = typeof SOURCE_CODE;
|
|
3439
3468
|
declare const FILE_CONTEXT: Readonly<{
|
|
3440
3469
|
/**
|
|
3441
3470
|
* Absolute path of the file being linted.
|
|
@@ -3825,7 +3854,8 @@ interface Context extends FileContext {
|
|
|
3825
3854
|
* Report an error/warning.
|
|
3826
3855
|
*/
|
|
3827
3856
|
report(this: void, diagnostic: Diagnostic): void;
|
|
3828
|
-
}
|
|
3857
|
+
}
|
|
3858
|
+
//#endregion
|
|
3829
3859
|
//#region src-js/plugins/rule_meta.d.ts
|
|
3830
3860
|
/**
|
|
3831
3861
|
* Rule metadata.
|
|
@@ -3978,7 +4008,8 @@ interface RuleReplacedByExternalSpecifier {
|
|
|
3978
4008
|
* URL pointing to documentation for the plugin / rule.
|
|
3979
4009
|
*/
|
|
3980
4010
|
url?: string;
|
|
3981
|
-
}
|
|
4011
|
+
}
|
|
4012
|
+
//#endregion
|
|
3982
4013
|
//#region src-js/plugins/load.d.ts
|
|
3983
4014
|
/**
|
|
3984
4015
|
* Linter plugin, comprising multiple rules
|
|
@@ -4007,16 +4038,7 @@ interface CreateOnceRule {
|
|
|
4007
4038
|
meta?: RuleMeta;
|
|
4008
4039
|
create?: (context: Context) => VisitorObject;
|
|
4009
4040
|
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
|
-
*/
|
|
4041
|
+
}
|
|
4020
4042
|
//#endregion
|
|
4021
4043
|
//#region src/index.d.ts
|
|
4022
4044
|
declare const plugin: Plugin;
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { tmpdir, userInfo } from "node:os";
|
|
|
7
7
|
//#region \0rolldown/runtime.js
|
|
8
8
|
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
9
9
|
//#endregion
|
|
10
|
-
//#region ../../node_modules/.pnpm/@oxlint+plugins@1.
|
|
10
|
+
//#region ../../node_modules/.pnpm/@oxlint+plugins@1.73.0/node_modules/@oxlint/plugins/index.js
|
|
11
11
|
/**
|
|
12
12
|
* Define a plugin.
|
|
13
13
|
*
|
|
@@ -2489,15 +2489,12 @@ const noDeprecatedClasses = defineRule({
|
|
|
2489
2489
|
defaultOptions: [{}],
|
|
2490
2490
|
messages: {
|
|
2491
2491
|
deprecated: "\"{{className}}\" is deprecated in Tailwind v4. Use \"{{replacement}}\" instead.",
|
|
2492
|
-
suggestReplace: "Replace \"{{className}}\" with \"{{replacement}}\"."
|
|
2493
|
-
...DS_UNAVAILABLE_MESSAGE
|
|
2492
|
+
suggestReplace: "Replace \"{{className}}\" with \"{{replacement}}\"."
|
|
2494
2493
|
}
|
|
2495
2494
|
},
|
|
2496
2495
|
createOnce(context) {
|
|
2497
|
-
const getDS = createLazyLoader(context);
|
|
2498
2496
|
function check(locations) {
|
|
2499
2497
|
if (locations.length === 0) return;
|
|
2500
|
-
if (!safeGetDS(getDS, context, locations[0].node)) return;
|
|
2501
2498
|
for (const loc of locations) {
|
|
2502
2499
|
const split = splitClassesWithSeparators(loc.value);
|
|
2503
2500
|
const offending = split.classes.flatMap((cls) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-tailwindcss",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "Tailwind CSS linting rules for oxlint",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@oxlint/plugins": "catalog:",
|
|
59
59
|
"@tailwindcss/typography": "^0.5.20",
|
|
60
|
-
"@types/node": "^26.
|
|
61
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
60
|
+
"@types/node": "^26.1.1",
|
|
61
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
62
62
|
"oxlint": "catalog:",
|
|
63
63
|
"tailwindcss-animate": "^1.0.7",
|
|
64
|
-
"tsdown": "^0.22.
|
|
64
|
+
"tsdown": "^0.22.4",
|
|
65
65
|
"tw-animate-css": "^1.4.0",
|
|
66
66
|
"typescript": "^6.0.3",
|
|
67
|
-
"vitest": "^4.1.
|
|
67
|
+
"vitest": "^4.1.10"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
70
70
|
"node": ">=20"
|