@tanstack/eslint-plugin-query 5.101.4 → 5.102.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/build/legacy/index.cjs +46 -1812
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +82 -3
- package/build/legacy/index.d.cts.map +1 -0
- package/build/legacy/index.d.ts +82 -3
- package/build/legacy/index.d.ts.map +1 -0
- package/build/legacy/index.js +39 -56
- package/build/legacy/index.js.map +1 -1
- package/build/legacy/rules-Bv1SB3jU.js +1172 -0
- package/build/legacy/rules-Bv1SB3jU.js.map +1 -0
- package/build/legacy/rules-ChMfhjqW.cjs +1177 -0
- package/build/legacy/rules-ChMfhjqW.cjs.map +1 -0
- package/build/legacy/rules.cjs +3 -1761
- package/build/legacy/rules.d.cts +7 -1
- package/build/legacy/rules.d.cts.map +1 -0
- package/build/legacy/rules.d.ts +7 -1
- package/build/legacy/rules.d.ts.map +1 -0
- package/build/legacy/rules.js +2 -7
- package/build/legacy/types.cjs +1 -19
- package/build/legacy/types.d.cts +7 -1
- package/build/legacy/types.d.cts.map +1 -0
- package/build/legacy/types.d.ts +7 -1
- package/build/legacy/types.d.ts.map +1 -0
- package/build/legacy/types.js +1 -1
- package/build/modern/index.cjs +46 -1798
- package/build/modern/index.cjs.map +1 -1
- package/build/modern/index.d.cts +83 -3
- package/build/modern/index.d.cts.map +1 -0
- package/build/modern/index.d.ts +83 -3
- package/build/modern/index.d.ts.map +1 -0
- package/build/modern/index.js +40 -56
- package/build/modern/index.js.map +1 -1
- package/build/modern/rules-B1yVUvLh.cjs +1158 -0
- package/build/modern/rules-B1yVUvLh.cjs.map +1 -0
- package/build/modern/rules-DzixDjO7.js +1153 -0
- package/build/modern/rules-DzixDjO7.js.map +1 -0
- package/build/modern/rules.cjs +3 -1747
- package/build/modern/rules.d.cts +8 -1
- package/build/modern/rules.d.cts.map +1 -0
- package/build/modern/rules.d.ts +8 -1
- package/build/modern/rules.d.ts.map +1 -0
- package/build/modern/rules.js +3 -7
- package/build/modern/types.cjs +1 -19
- package/build/modern/types.d.cts +8 -1
- package/build/modern/types.d.cts.map +1 -0
- package/build/modern/types.d.ts +8 -1
- package/build/modern/types.d.ts.map +1 -0
- package/build/modern/types.js +2 -1
- package/package.json +4 -6
- package/src/rules/exhaustive-deps/exhaustive-deps.utils.ts +1 -1
- package/src/rules/no-unstable-deps/no-unstable-deps.rule.ts +3 -3
- package/src/utils/ast-utils.ts +0 -194
- package/build/legacy/_tsup-dts-rollup.d.cts +0 -319
- package/build/legacy/_tsup-dts-rollup.d.ts +0 -319
- package/build/legacy/chunk-25PZGVEE.js +0 -1735
- package/build/legacy/chunk-25PZGVEE.js.map +0 -1
- package/build/legacy/rules.cjs.map +0 -1
- package/build/legacy/rules.js.map +0 -1
- package/build/legacy/types.cjs.map +0 -1
- package/build/legacy/types.js.map +0 -1
- package/build/modern/_tsup-dts-rollup.d.cts +0 -319
- package/build/modern/_tsup-dts-rollup.d.ts +0 -319
- package/build/modern/chunk-LDCUUAIY.js +0 -1721
- package/build/modern/chunk-LDCUUAIY.js.map +0 -1
- package/build/modern/rules.cjs.map +0 -1
- package/build/modern/rules.js.map +0 -1
- package/build/modern/types.cjs.map +0 -1
- package/build/modern/types.js.map +0 -1
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
-
import type { ESLint } from 'eslint';
|
|
3
|
-
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
4
|
-
import type { Linter } from 'eslint';
|
|
5
|
-
import type { ParserServices } from '@typescript-eslint/utils';
|
|
6
|
-
import { RuleListener } from '@typescript-eslint/utils/ts-eslint';
|
|
7
|
-
import { RuleModule } from '@typescript-eslint/utils/ts-eslint';
|
|
8
|
-
import type { TSESLint } from '@typescript-eslint/utils';
|
|
9
|
-
import { TSESTree } from '@typescript-eslint/utils';
|
|
10
|
-
|
|
11
|
-
export declare const ASTUtils: {
|
|
12
|
-
isNodeOfOneOf<T extends AST_NODE_TYPES>(node: TSESTree.Node, types: ReadonlyArray<T>): node is TSESTree.Node & {
|
|
13
|
-
type: T;
|
|
14
|
-
};
|
|
15
|
-
isIdentifier(node: TSESTree.Node): node is TSESTree.Identifier;
|
|
16
|
-
isIdentifierWithName(node: TSESTree.Node, name: string): node is TSESTree.Identifier;
|
|
17
|
-
isIdentifierWithOneOfNames<T extends Array<string>>(node: TSESTree.Node, name: T): node is TSESTree.Identifier & {
|
|
18
|
-
name: T[number];
|
|
19
|
-
};
|
|
20
|
-
isProperty(node: TSESTree.Node): node is TSESTree.Property;
|
|
21
|
-
isObjectExpression(node: TSESTree.Node): node is TSESTree.ObjectExpression;
|
|
22
|
-
isPropertyWithIdentifierKey(node: TSESTree.Node, key: string): node is TSESTree.Property;
|
|
23
|
-
findPropertyWithIdentifierKey(properties: Array<TSESTree.ObjectLiteralElement>, key: string): TSESTree.Property | undefined;
|
|
24
|
-
getNestedIdentifiers(node: TSESTree.Node): Array<TSESTree.Identifier>;
|
|
25
|
-
traverseUpOnly(identifier: TSESTree.Node, allowedNodeTypes: Array<AST_NODE_TYPES>): TSESTree.Node;
|
|
26
|
-
traverseUpMemberExpression(node: TSESTree.Node): TSESTree.Node;
|
|
27
|
-
isDeclaredInNode(params: {
|
|
28
|
-
functionNode: TSESTree.Node;
|
|
29
|
-
reference: TSESLint.Scope.Reference;
|
|
30
|
-
scopeManager: TSESLint.Scope.ScopeManager;
|
|
31
|
-
}): boolean;
|
|
32
|
-
getExternalRefs(params: {
|
|
33
|
-
scopeManager: TSESLint.Scope.ScopeManager;
|
|
34
|
-
sourceCode: Readonly<TSESLint.SourceCode>;
|
|
35
|
-
node: TSESTree.Node;
|
|
36
|
-
}): Array<TSESLint.Scope.Reference>;
|
|
37
|
-
mapKeyNodeToText(node: TSESTree.Node, sourceCode: Readonly<TSESLint.SourceCode>): string;
|
|
38
|
-
mapKeyNodeToBaseText(node: TSESTree.Node, sourceCode: Readonly<TSESLint.SourceCode>): string;
|
|
39
|
-
isValidReactComponentOrHookName(identifier: TSESTree.Identifier | null | undefined): boolean;
|
|
40
|
-
getFunctionAncestor(sourceCode: Readonly<TSESLint.SourceCode>, node: TSESTree.Node): TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | undefined;
|
|
41
|
-
getReferencedExpressionByIdentifier(params: {
|
|
42
|
-
node: TSESTree.Node;
|
|
43
|
-
context: Readonly<TSESLint.RuleContext<string, ReadonlyArray<unknown>>>;
|
|
44
|
-
}): TSESTree.Expression | null;
|
|
45
|
-
getClosestVariableDeclarator(node: TSESTree.Node): TSESTree.VariableDeclaratorDefiniteAssignment | TSESTree.VariableDeclaratorMaybeInit | undefined;
|
|
46
|
-
getNestedReturnStatements(node: TSESTree.Node): Array<TSESTree.ReturnStatement>;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export declare const checkedProperties: readonly ["queryFn", "getPreviousPageParam", "getNextPageParam"];
|
|
50
|
-
|
|
51
|
-
export declare const checkedProperties_alias_1: readonly ["onMutate", "onError", "onSettled"];
|
|
52
|
-
|
|
53
|
-
declare type Context = Parameters<Create>[0];
|
|
54
|
-
|
|
55
|
-
declare type Create = Parameters<ReturnType<typeof ESLintUtils.RuleCreator>>[0]['create'];
|
|
56
|
-
|
|
57
|
-
export declare function createPropertyOrderRule<TFunc extends string, TProp extends string>(options: Omit<Parameters<typeof createRule>[0], 'create'>, targetFunctions: ReadonlyArray<TFunc> | Array<TFunc>, orderRules: ReadonlyArray<Readonly<[ReadonlyArray<TProp>, ReadonlyArray<TProp>]>>): ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
58
|
-
name: string;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, ExtraRuleDocs>>) => ESLintUtils.RuleModule<MessageIds, Options, ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
62
|
-
name: string;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export declare function detectTanstackQueryImports(create: EnhancedCreate): Create;
|
|
66
|
-
|
|
67
|
-
declare type EnhancedCreate = (context: Context, options: Options, helpers: Helpers) => ReturnType<Create>;
|
|
68
|
-
|
|
69
|
-
export declare const ExhaustiveDepsUtils: {
|
|
70
|
-
isRelevantReference(params: {
|
|
71
|
-
sourceCode: Readonly<TSESLint.SourceCode>;
|
|
72
|
-
reference: TSESLint.Scope.Reference;
|
|
73
|
-
scopeManager: TSESLint.Scope.ScopeManager;
|
|
74
|
-
node: TSESTree.Node;
|
|
75
|
-
filename: string;
|
|
76
|
-
}): boolean;
|
|
77
|
-
isFunctionCallTarget(identifier: TSESTree.Identifier | TSESTree.JSXIdentifier): boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Given required refs and existing queryKey entries, compute missing dependency paths
|
|
80
|
-
* respecting allowlisted variables and types.
|
|
81
|
-
*/
|
|
82
|
-
computeFilteredMissingPaths(params: {
|
|
83
|
-
requiredRefs: Array<{
|
|
84
|
-
path: string;
|
|
85
|
-
root: string;
|
|
86
|
-
allowlistedByType: boolean;
|
|
87
|
-
}>;
|
|
88
|
-
allowlistedVariables: Set<string>;
|
|
89
|
-
existingRootIdentifiers: Set<string>;
|
|
90
|
-
existingFullPaths: Set<string>;
|
|
91
|
-
}): Array<string>;
|
|
92
|
-
/**
|
|
93
|
-
* Extract existing queryKey deps as root identifiers and full member paths.
|
|
94
|
-
*/
|
|
95
|
-
collectQueryKeyDeps(params: {
|
|
96
|
-
sourceCode: Readonly<TSESLint.SourceCode>;
|
|
97
|
-
scopeManager: TSESLint.Scope.ScopeManager;
|
|
98
|
-
queryKeyNode: TSESTree.Node;
|
|
99
|
-
}): {
|
|
100
|
-
roots: Set<string>;
|
|
101
|
-
paths: Set<string>;
|
|
102
|
-
};
|
|
103
|
-
isNode(value: unknown): value is TSESTree.Node;
|
|
104
|
-
/**
|
|
105
|
-
* Checks whether the resolved variable is allowlisted by its type annotation
|
|
106
|
-
*/
|
|
107
|
-
variableIsAllowlistedByType(params: {
|
|
108
|
-
allowlistedTypes: Set<string>;
|
|
109
|
-
variable: TSESLint.Scope.Variable | null;
|
|
110
|
-
}): boolean;
|
|
111
|
-
isInstanceOfKind(node: TSESTree.Node): boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Normalizes a chain by removing optional chaining operators
|
|
114
|
-
*
|
|
115
|
-
* Example: `a?.b.c!` -> `a.b.c`
|
|
116
|
-
*/
|
|
117
|
-
normalizeChain(text: string): string;
|
|
118
|
-
/**
|
|
119
|
-
* Computes the reference path for an identifier
|
|
120
|
-
*
|
|
121
|
-
* Example: `a.b.c!` -> `{ path: 'a.b.c', root: 'a' }`
|
|
122
|
-
*/
|
|
123
|
-
computeRefPath(params: {
|
|
124
|
-
identifier: TSESTree.Identifier;
|
|
125
|
-
sourceCode: Readonly<TSESLint.SourceCode>;
|
|
126
|
-
}): {
|
|
127
|
-
path: string;
|
|
128
|
-
root: string;
|
|
129
|
-
coversRootMembers: boolean;
|
|
130
|
-
} | null;
|
|
131
|
-
collectExternalRefsInFunction(params: {
|
|
132
|
-
functionNode: TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression;
|
|
133
|
-
scopeManager: TSESLint.Scope.ScopeManager;
|
|
134
|
-
}): Array<TSESLint.Scope.Reference>;
|
|
135
|
-
/**
|
|
136
|
-
* Recursively collects type identifiers from a type annotation
|
|
137
|
-
*/
|
|
138
|
-
collectTypeIdentifiers(typeNode: TSESTree.TypeNode, out: Set<string>): void;
|
|
139
|
-
/**
|
|
140
|
-
* Gets the function expression nodes from a queryFn property, handling conditional expressions.
|
|
141
|
-
* When neither branch is skipToken, returns both branches so all deps are scanned.
|
|
142
|
-
*/
|
|
143
|
-
getQueryFnNodes(queryFn: TSESTree.Property): Array<TSESTree.Node>;
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
export declare type ExtraRuleDocs = {
|
|
147
|
-
recommended: 'strict' | 'error' | 'warn';
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export declare const getDocsUrl: (ruleName: string) => string;
|
|
151
|
-
|
|
152
|
-
declare type Helpers = {
|
|
153
|
-
isSpecificTanstackQueryImport: (node: TSESTree.Identifier, source: string) => boolean;
|
|
154
|
-
isTanstackQueryImport: (node: TSESTree.Identifier) => boolean;
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export declare type InfiniteQueryFunctions = (typeof infiniteQueryFunctions)[number];
|
|
158
|
-
|
|
159
|
-
export declare const infiniteQueryFunctions: readonly ["infiniteQueryOptions", "useInfiniteQuery", "useSuspenseInfiniteQuery"];
|
|
160
|
-
|
|
161
|
-
export declare type InfiniteQueryProperties = (typeof checkedProperties)[number];
|
|
162
|
-
|
|
163
|
-
export declare type MutationFunctions = (typeof mutationFunctions)[number];
|
|
164
|
-
|
|
165
|
-
export declare const mutationFunctions: readonly ["useMutation"];
|
|
166
|
-
|
|
167
|
-
export declare type MutationProperties = (typeof checkedProperties_alias_1)[number];
|
|
168
|
-
|
|
169
|
-
declare const name_2 = "exhaustive-deps";
|
|
170
|
-
export { name_2 as name }
|
|
171
|
-
|
|
172
|
-
export declare const name_alias_1 = "infinite-query-property-order";
|
|
173
|
-
|
|
174
|
-
export declare const name_alias_2 = "mutation-property-order";
|
|
175
|
-
|
|
176
|
-
export declare const name_alias_3 = "no-rest-destructuring";
|
|
177
|
-
|
|
178
|
-
export declare const name_alias_4 = "no-unstable-deps";
|
|
179
|
-
|
|
180
|
-
export declare const name_alias_5 = "no-void-query-fn";
|
|
181
|
-
|
|
182
|
-
export declare const name_alias_6 = "prefer-query-options";
|
|
183
|
-
|
|
184
|
-
export declare const name_alias_7 = "stable-query-client";
|
|
185
|
-
|
|
186
|
-
export declare const NoRestDestructuringUtils: {
|
|
187
|
-
isObjectRestDestructuring(node: TSESTree.Node): boolean;
|
|
188
|
-
isQueryResultCall(node: TSESTree.CallExpression, parserServices: Partial<ParserServices> | null | undefined): boolean;
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
declare type Options = Parameters<Create>[1];
|
|
192
|
-
|
|
193
|
-
declare const plugin: {
|
|
194
|
-
meta: {
|
|
195
|
-
name: string;
|
|
196
|
-
};
|
|
197
|
-
configs: {
|
|
198
|
-
recommended: {
|
|
199
|
-
plugins: string[];
|
|
200
|
-
rules: {
|
|
201
|
-
readonly '@tanstack/query/exhaustive-deps': "error";
|
|
202
|
-
readonly '@tanstack/query/no-rest-destructuring': "warn";
|
|
203
|
-
readonly '@tanstack/query/stable-query-client': "error";
|
|
204
|
-
readonly '@tanstack/query/no-unstable-deps': "error";
|
|
205
|
-
readonly '@tanstack/query/infinite-query-property-order': "error";
|
|
206
|
-
readonly '@tanstack/query/no-void-query-fn': "error";
|
|
207
|
-
readonly '@tanstack/query/mutation-property-order': "error";
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
|
-
recommendedStrict: {
|
|
211
|
-
plugins: string[];
|
|
212
|
-
rules: {
|
|
213
|
-
readonly '@tanstack/query/prefer-query-options': "error";
|
|
214
|
-
readonly '@tanstack/query/exhaustive-deps': "error";
|
|
215
|
-
readonly '@tanstack/query/no-rest-destructuring': "warn";
|
|
216
|
-
readonly '@tanstack/query/stable-query-client': "error";
|
|
217
|
-
readonly '@tanstack/query/no-unstable-deps': "error";
|
|
218
|
-
readonly '@tanstack/query/infinite-query-property-order': "error";
|
|
219
|
-
readonly '@tanstack/query/no-void-query-fn': "error";
|
|
220
|
-
readonly '@tanstack/query/mutation-property-order': "error";
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
'flat/recommended': {
|
|
224
|
-
name: string;
|
|
225
|
-
plugins: {
|
|
226
|
-
'@tanstack/query': {};
|
|
227
|
-
};
|
|
228
|
-
rules: {
|
|
229
|
-
readonly '@tanstack/query/exhaustive-deps': "error";
|
|
230
|
-
readonly '@tanstack/query/no-rest-destructuring': "warn";
|
|
231
|
-
readonly '@tanstack/query/stable-query-client': "error";
|
|
232
|
-
readonly '@tanstack/query/no-unstable-deps': "error";
|
|
233
|
-
readonly '@tanstack/query/infinite-query-property-order': "error";
|
|
234
|
-
readonly '@tanstack/query/no-void-query-fn': "error";
|
|
235
|
-
readonly '@tanstack/query/mutation-property-order': "error";
|
|
236
|
-
};
|
|
237
|
-
}[];
|
|
238
|
-
'flat/recommended-strict': {
|
|
239
|
-
name: string;
|
|
240
|
-
plugins: {
|
|
241
|
-
'@tanstack/query': {};
|
|
242
|
-
};
|
|
243
|
-
rules: {
|
|
244
|
-
readonly '@tanstack/query/prefer-query-options': "error";
|
|
245
|
-
readonly '@tanstack/query/exhaustive-deps': "error";
|
|
246
|
-
readonly '@tanstack/query/no-rest-destructuring': "warn";
|
|
247
|
-
readonly '@tanstack/query/stable-query-client': "error";
|
|
248
|
-
readonly '@tanstack/query/no-unstable-deps': "error";
|
|
249
|
-
readonly '@tanstack/query/infinite-query-property-order': "error";
|
|
250
|
-
readonly '@tanstack/query/no-void-query-fn': "error";
|
|
251
|
-
readonly '@tanstack/query/mutation-property-order': "error";
|
|
252
|
-
};
|
|
253
|
-
}[];
|
|
254
|
-
};
|
|
255
|
-
rules: Record<string, RuleModule<string, readonly unknown[], ExtraRuleDocs, RuleListener>>;
|
|
256
|
-
};
|
|
257
|
-
export { plugin as default_alias }
|
|
258
|
-
export { plugin }
|
|
259
|
-
|
|
260
|
-
declare interface Plugin_2 extends Omit<ESLint.Plugin, 'rules'> {
|
|
261
|
-
rules: Record<RuleKey, RuleModule<any, any, any>>;
|
|
262
|
-
configs: {
|
|
263
|
-
recommended: ESLint.ConfigData;
|
|
264
|
-
recommendedStrict: ESLint.ConfigData;
|
|
265
|
-
'flat/recommended': Array<Linter.Config>;
|
|
266
|
-
'flat/recommended-strict': Array<Linter.Config>;
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
export { Plugin_2 as Plugin }
|
|
270
|
-
|
|
271
|
-
export declare const reactHookNames: string[];
|
|
272
|
-
|
|
273
|
-
export declare const rule: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
274
|
-
name: string;
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
export declare const rule_alias_1: RuleModule<string, readonly unknown[], ExtraRuleDocs, RuleListener> & {
|
|
278
|
-
name: string;
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
export declare const rule_alias_2: RuleModule<string, readonly unknown[], ExtraRuleDocs, RuleListener> & {
|
|
282
|
-
name: string;
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
export declare const rule_alias_3: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
286
|
-
name: string;
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
export declare const rule_alias_4: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
290
|
-
name: string;
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
export declare const rule_alias_5: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
294
|
-
name: string;
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
export declare const rule_alias_6: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
298
|
-
name: string;
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
export declare const rule_alias_7: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
302
|
-
name: string;
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
declare type RuleKey = keyof typeof rules;
|
|
306
|
-
|
|
307
|
-
export declare const rules: Record<string, ESLintUtils.RuleModule<string, ReadonlyArray<unknown>, ExtraRuleDocs, ESLintUtils.RuleListener>>;
|
|
308
|
-
|
|
309
|
-
export declare function sortDataByOrder<T, TKey extends keyof T>(data: Array<T> | ReadonlyArray<T>, orderRules: ReadonlyArray<Readonly<[ReadonlyArray<T[TKey]>, ReadonlyArray<T[TKey]>]>>, key: TKey): Array<T> | null;
|
|
310
|
-
|
|
311
|
-
export declare const sortRules: readonly [readonly [readonly ["queryFn"], readonly ["getPreviousPageParam", "getNextPageParam"]]];
|
|
312
|
-
|
|
313
|
-
export declare const sortRules_alias_1: readonly [readonly [readonly ["onMutate"], readonly ["onError", "onSettled"]]];
|
|
314
|
-
|
|
315
|
-
export declare function uniqueBy<T>(arr: Array<T>, fn: (x: T) => unknown): Array<T>;
|
|
316
|
-
|
|
317
|
-
export declare const useQueryHookNames: string[];
|
|
318
|
-
|
|
319
|
-
export { }
|
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
-
import type { ESLint } from 'eslint';
|
|
3
|
-
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
4
|
-
import type { Linter } from 'eslint';
|
|
5
|
-
import type { ParserServices } from '@typescript-eslint/utils';
|
|
6
|
-
import { RuleListener } from '@typescript-eslint/utils/ts-eslint';
|
|
7
|
-
import { RuleModule } from '@typescript-eslint/utils/ts-eslint';
|
|
8
|
-
import type { TSESLint } from '@typescript-eslint/utils';
|
|
9
|
-
import { TSESTree } from '@typescript-eslint/utils';
|
|
10
|
-
|
|
11
|
-
export declare const ASTUtils: {
|
|
12
|
-
isNodeOfOneOf<T extends AST_NODE_TYPES>(node: TSESTree.Node, types: ReadonlyArray<T>): node is TSESTree.Node & {
|
|
13
|
-
type: T;
|
|
14
|
-
};
|
|
15
|
-
isIdentifier(node: TSESTree.Node): node is TSESTree.Identifier;
|
|
16
|
-
isIdentifierWithName(node: TSESTree.Node, name: string): node is TSESTree.Identifier;
|
|
17
|
-
isIdentifierWithOneOfNames<T extends Array<string>>(node: TSESTree.Node, name: T): node is TSESTree.Identifier & {
|
|
18
|
-
name: T[number];
|
|
19
|
-
};
|
|
20
|
-
isProperty(node: TSESTree.Node): node is TSESTree.Property;
|
|
21
|
-
isObjectExpression(node: TSESTree.Node): node is TSESTree.ObjectExpression;
|
|
22
|
-
isPropertyWithIdentifierKey(node: TSESTree.Node, key: string): node is TSESTree.Property;
|
|
23
|
-
findPropertyWithIdentifierKey(properties: Array<TSESTree.ObjectLiteralElement>, key: string): TSESTree.Property | undefined;
|
|
24
|
-
getNestedIdentifiers(node: TSESTree.Node): Array<TSESTree.Identifier>;
|
|
25
|
-
traverseUpOnly(identifier: TSESTree.Node, allowedNodeTypes: Array<AST_NODE_TYPES>): TSESTree.Node;
|
|
26
|
-
traverseUpMemberExpression(node: TSESTree.Node): TSESTree.Node;
|
|
27
|
-
isDeclaredInNode(params: {
|
|
28
|
-
functionNode: TSESTree.Node;
|
|
29
|
-
reference: TSESLint.Scope.Reference;
|
|
30
|
-
scopeManager: TSESLint.Scope.ScopeManager;
|
|
31
|
-
}): boolean;
|
|
32
|
-
getExternalRefs(params: {
|
|
33
|
-
scopeManager: TSESLint.Scope.ScopeManager;
|
|
34
|
-
sourceCode: Readonly<TSESLint.SourceCode>;
|
|
35
|
-
node: TSESTree.Node;
|
|
36
|
-
}): Array<TSESLint.Scope.Reference>;
|
|
37
|
-
mapKeyNodeToText(node: TSESTree.Node, sourceCode: Readonly<TSESLint.SourceCode>): string;
|
|
38
|
-
mapKeyNodeToBaseText(node: TSESTree.Node, sourceCode: Readonly<TSESLint.SourceCode>): string;
|
|
39
|
-
isValidReactComponentOrHookName(identifier: TSESTree.Identifier | null | undefined): boolean;
|
|
40
|
-
getFunctionAncestor(sourceCode: Readonly<TSESLint.SourceCode>, node: TSESTree.Node): TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | undefined;
|
|
41
|
-
getReferencedExpressionByIdentifier(params: {
|
|
42
|
-
node: TSESTree.Node;
|
|
43
|
-
context: Readonly<TSESLint.RuleContext<string, ReadonlyArray<unknown>>>;
|
|
44
|
-
}): TSESTree.Expression | null;
|
|
45
|
-
getClosestVariableDeclarator(node: TSESTree.Node): TSESTree.VariableDeclaratorDefiniteAssignment | TSESTree.VariableDeclaratorMaybeInit | undefined;
|
|
46
|
-
getNestedReturnStatements(node: TSESTree.Node): Array<TSESTree.ReturnStatement>;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export declare const checkedProperties: readonly ["queryFn", "getPreviousPageParam", "getNextPageParam"];
|
|
50
|
-
|
|
51
|
-
export declare const checkedProperties_alias_1: readonly ["onMutate", "onError", "onSettled"];
|
|
52
|
-
|
|
53
|
-
declare type Context = Parameters<Create>[0];
|
|
54
|
-
|
|
55
|
-
declare type Create = Parameters<ReturnType<typeof ESLintUtils.RuleCreator>>[0]['create'];
|
|
56
|
-
|
|
57
|
-
export declare function createPropertyOrderRule<TFunc extends string, TProp extends string>(options: Omit<Parameters<typeof createRule>[0], 'create'>, targetFunctions: ReadonlyArray<TFunc> | Array<TFunc>, orderRules: ReadonlyArray<Readonly<[ReadonlyArray<TProp>, ReadonlyArray<TProp>]>>): ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
58
|
-
name: string;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, ExtraRuleDocs>>) => ESLintUtils.RuleModule<MessageIds, Options, ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
62
|
-
name: string;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export declare function detectTanstackQueryImports(create: EnhancedCreate): Create;
|
|
66
|
-
|
|
67
|
-
declare type EnhancedCreate = (context: Context, options: Options, helpers: Helpers) => ReturnType<Create>;
|
|
68
|
-
|
|
69
|
-
export declare const ExhaustiveDepsUtils: {
|
|
70
|
-
isRelevantReference(params: {
|
|
71
|
-
sourceCode: Readonly<TSESLint.SourceCode>;
|
|
72
|
-
reference: TSESLint.Scope.Reference;
|
|
73
|
-
scopeManager: TSESLint.Scope.ScopeManager;
|
|
74
|
-
node: TSESTree.Node;
|
|
75
|
-
filename: string;
|
|
76
|
-
}): boolean;
|
|
77
|
-
isFunctionCallTarget(identifier: TSESTree.Identifier | TSESTree.JSXIdentifier): boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Given required refs and existing queryKey entries, compute missing dependency paths
|
|
80
|
-
* respecting allowlisted variables and types.
|
|
81
|
-
*/
|
|
82
|
-
computeFilteredMissingPaths(params: {
|
|
83
|
-
requiredRefs: Array<{
|
|
84
|
-
path: string;
|
|
85
|
-
root: string;
|
|
86
|
-
allowlistedByType: boolean;
|
|
87
|
-
}>;
|
|
88
|
-
allowlistedVariables: Set<string>;
|
|
89
|
-
existingRootIdentifiers: Set<string>;
|
|
90
|
-
existingFullPaths: Set<string>;
|
|
91
|
-
}): Array<string>;
|
|
92
|
-
/**
|
|
93
|
-
* Extract existing queryKey deps as root identifiers and full member paths.
|
|
94
|
-
*/
|
|
95
|
-
collectQueryKeyDeps(params: {
|
|
96
|
-
sourceCode: Readonly<TSESLint.SourceCode>;
|
|
97
|
-
scopeManager: TSESLint.Scope.ScopeManager;
|
|
98
|
-
queryKeyNode: TSESTree.Node;
|
|
99
|
-
}): {
|
|
100
|
-
roots: Set<string>;
|
|
101
|
-
paths: Set<string>;
|
|
102
|
-
};
|
|
103
|
-
isNode(value: unknown): value is TSESTree.Node;
|
|
104
|
-
/**
|
|
105
|
-
* Checks whether the resolved variable is allowlisted by its type annotation
|
|
106
|
-
*/
|
|
107
|
-
variableIsAllowlistedByType(params: {
|
|
108
|
-
allowlistedTypes: Set<string>;
|
|
109
|
-
variable: TSESLint.Scope.Variable | null;
|
|
110
|
-
}): boolean;
|
|
111
|
-
isInstanceOfKind(node: TSESTree.Node): boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Normalizes a chain by removing optional chaining operators
|
|
114
|
-
*
|
|
115
|
-
* Example: `a?.b.c!` -> `a.b.c`
|
|
116
|
-
*/
|
|
117
|
-
normalizeChain(text: string): string;
|
|
118
|
-
/**
|
|
119
|
-
* Computes the reference path for an identifier
|
|
120
|
-
*
|
|
121
|
-
* Example: `a.b.c!` -> `{ path: 'a.b.c', root: 'a' }`
|
|
122
|
-
*/
|
|
123
|
-
computeRefPath(params: {
|
|
124
|
-
identifier: TSESTree.Identifier;
|
|
125
|
-
sourceCode: Readonly<TSESLint.SourceCode>;
|
|
126
|
-
}): {
|
|
127
|
-
path: string;
|
|
128
|
-
root: string;
|
|
129
|
-
coversRootMembers: boolean;
|
|
130
|
-
} | null;
|
|
131
|
-
collectExternalRefsInFunction(params: {
|
|
132
|
-
functionNode: TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression;
|
|
133
|
-
scopeManager: TSESLint.Scope.ScopeManager;
|
|
134
|
-
}): Array<TSESLint.Scope.Reference>;
|
|
135
|
-
/**
|
|
136
|
-
* Recursively collects type identifiers from a type annotation
|
|
137
|
-
*/
|
|
138
|
-
collectTypeIdentifiers(typeNode: TSESTree.TypeNode, out: Set<string>): void;
|
|
139
|
-
/**
|
|
140
|
-
* Gets the function expression nodes from a queryFn property, handling conditional expressions.
|
|
141
|
-
* When neither branch is skipToken, returns both branches so all deps are scanned.
|
|
142
|
-
*/
|
|
143
|
-
getQueryFnNodes(queryFn: TSESTree.Property): Array<TSESTree.Node>;
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
export declare type ExtraRuleDocs = {
|
|
147
|
-
recommended: 'strict' | 'error' | 'warn';
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export declare const getDocsUrl: (ruleName: string) => string;
|
|
151
|
-
|
|
152
|
-
declare type Helpers = {
|
|
153
|
-
isSpecificTanstackQueryImport: (node: TSESTree.Identifier, source: string) => boolean;
|
|
154
|
-
isTanstackQueryImport: (node: TSESTree.Identifier) => boolean;
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export declare type InfiniteQueryFunctions = (typeof infiniteQueryFunctions)[number];
|
|
158
|
-
|
|
159
|
-
export declare const infiniteQueryFunctions: readonly ["infiniteQueryOptions", "useInfiniteQuery", "useSuspenseInfiniteQuery"];
|
|
160
|
-
|
|
161
|
-
export declare type InfiniteQueryProperties = (typeof checkedProperties)[number];
|
|
162
|
-
|
|
163
|
-
export declare type MutationFunctions = (typeof mutationFunctions)[number];
|
|
164
|
-
|
|
165
|
-
export declare const mutationFunctions: readonly ["useMutation"];
|
|
166
|
-
|
|
167
|
-
export declare type MutationProperties = (typeof checkedProperties_alias_1)[number];
|
|
168
|
-
|
|
169
|
-
declare const name_2 = "exhaustive-deps";
|
|
170
|
-
export { name_2 as name }
|
|
171
|
-
|
|
172
|
-
export declare const name_alias_1 = "infinite-query-property-order";
|
|
173
|
-
|
|
174
|
-
export declare const name_alias_2 = "mutation-property-order";
|
|
175
|
-
|
|
176
|
-
export declare const name_alias_3 = "no-rest-destructuring";
|
|
177
|
-
|
|
178
|
-
export declare const name_alias_4 = "no-unstable-deps";
|
|
179
|
-
|
|
180
|
-
export declare const name_alias_5 = "no-void-query-fn";
|
|
181
|
-
|
|
182
|
-
export declare const name_alias_6 = "prefer-query-options";
|
|
183
|
-
|
|
184
|
-
export declare const name_alias_7 = "stable-query-client";
|
|
185
|
-
|
|
186
|
-
export declare const NoRestDestructuringUtils: {
|
|
187
|
-
isObjectRestDestructuring(node: TSESTree.Node): boolean;
|
|
188
|
-
isQueryResultCall(node: TSESTree.CallExpression, parserServices: Partial<ParserServices> | null | undefined): boolean;
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
declare type Options = Parameters<Create>[1];
|
|
192
|
-
|
|
193
|
-
declare const plugin: {
|
|
194
|
-
meta: {
|
|
195
|
-
name: string;
|
|
196
|
-
};
|
|
197
|
-
configs: {
|
|
198
|
-
recommended: {
|
|
199
|
-
plugins: string[];
|
|
200
|
-
rules: {
|
|
201
|
-
readonly '@tanstack/query/exhaustive-deps': "error";
|
|
202
|
-
readonly '@tanstack/query/no-rest-destructuring': "warn";
|
|
203
|
-
readonly '@tanstack/query/stable-query-client': "error";
|
|
204
|
-
readonly '@tanstack/query/no-unstable-deps': "error";
|
|
205
|
-
readonly '@tanstack/query/infinite-query-property-order': "error";
|
|
206
|
-
readonly '@tanstack/query/no-void-query-fn': "error";
|
|
207
|
-
readonly '@tanstack/query/mutation-property-order': "error";
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
|
-
recommendedStrict: {
|
|
211
|
-
plugins: string[];
|
|
212
|
-
rules: {
|
|
213
|
-
readonly '@tanstack/query/prefer-query-options': "error";
|
|
214
|
-
readonly '@tanstack/query/exhaustive-deps': "error";
|
|
215
|
-
readonly '@tanstack/query/no-rest-destructuring': "warn";
|
|
216
|
-
readonly '@tanstack/query/stable-query-client': "error";
|
|
217
|
-
readonly '@tanstack/query/no-unstable-deps': "error";
|
|
218
|
-
readonly '@tanstack/query/infinite-query-property-order': "error";
|
|
219
|
-
readonly '@tanstack/query/no-void-query-fn': "error";
|
|
220
|
-
readonly '@tanstack/query/mutation-property-order': "error";
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
'flat/recommended': {
|
|
224
|
-
name: string;
|
|
225
|
-
plugins: {
|
|
226
|
-
'@tanstack/query': {};
|
|
227
|
-
};
|
|
228
|
-
rules: {
|
|
229
|
-
readonly '@tanstack/query/exhaustive-deps': "error";
|
|
230
|
-
readonly '@tanstack/query/no-rest-destructuring': "warn";
|
|
231
|
-
readonly '@tanstack/query/stable-query-client': "error";
|
|
232
|
-
readonly '@tanstack/query/no-unstable-deps': "error";
|
|
233
|
-
readonly '@tanstack/query/infinite-query-property-order': "error";
|
|
234
|
-
readonly '@tanstack/query/no-void-query-fn': "error";
|
|
235
|
-
readonly '@tanstack/query/mutation-property-order': "error";
|
|
236
|
-
};
|
|
237
|
-
}[];
|
|
238
|
-
'flat/recommended-strict': {
|
|
239
|
-
name: string;
|
|
240
|
-
plugins: {
|
|
241
|
-
'@tanstack/query': {};
|
|
242
|
-
};
|
|
243
|
-
rules: {
|
|
244
|
-
readonly '@tanstack/query/prefer-query-options': "error";
|
|
245
|
-
readonly '@tanstack/query/exhaustive-deps': "error";
|
|
246
|
-
readonly '@tanstack/query/no-rest-destructuring': "warn";
|
|
247
|
-
readonly '@tanstack/query/stable-query-client': "error";
|
|
248
|
-
readonly '@tanstack/query/no-unstable-deps': "error";
|
|
249
|
-
readonly '@tanstack/query/infinite-query-property-order': "error";
|
|
250
|
-
readonly '@tanstack/query/no-void-query-fn': "error";
|
|
251
|
-
readonly '@tanstack/query/mutation-property-order': "error";
|
|
252
|
-
};
|
|
253
|
-
}[];
|
|
254
|
-
};
|
|
255
|
-
rules: Record<string, RuleModule<string, readonly unknown[], ExtraRuleDocs, RuleListener>>;
|
|
256
|
-
};
|
|
257
|
-
export { plugin as default_alias }
|
|
258
|
-
export { plugin }
|
|
259
|
-
|
|
260
|
-
declare interface Plugin_2 extends Omit<ESLint.Plugin, 'rules'> {
|
|
261
|
-
rules: Record<RuleKey, RuleModule<any, any, any>>;
|
|
262
|
-
configs: {
|
|
263
|
-
recommended: ESLint.ConfigData;
|
|
264
|
-
recommendedStrict: ESLint.ConfigData;
|
|
265
|
-
'flat/recommended': Array<Linter.Config>;
|
|
266
|
-
'flat/recommended-strict': Array<Linter.Config>;
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
export { Plugin_2 as Plugin }
|
|
270
|
-
|
|
271
|
-
export declare const reactHookNames: string[];
|
|
272
|
-
|
|
273
|
-
export declare const rule: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
274
|
-
name: string;
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
export declare const rule_alias_1: RuleModule<string, readonly unknown[], ExtraRuleDocs, RuleListener> & {
|
|
278
|
-
name: string;
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
export declare const rule_alias_2: RuleModule<string, readonly unknown[], ExtraRuleDocs, RuleListener> & {
|
|
282
|
-
name: string;
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
export declare const rule_alias_3: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
286
|
-
name: string;
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
export declare const rule_alias_4: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
290
|
-
name: string;
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
export declare const rule_alias_5: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
294
|
-
name: string;
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
export declare const rule_alias_6: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
298
|
-
name: string;
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
export declare const rule_alias_7: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
302
|
-
name: string;
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
declare type RuleKey = keyof typeof rules;
|
|
306
|
-
|
|
307
|
-
export declare const rules: Record<string, ESLintUtils.RuleModule<string, ReadonlyArray<unknown>, ExtraRuleDocs, ESLintUtils.RuleListener>>;
|
|
308
|
-
|
|
309
|
-
export declare function sortDataByOrder<T, TKey extends keyof T>(data: Array<T> | ReadonlyArray<T>, orderRules: ReadonlyArray<Readonly<[ReadonlyArray<T[TKey]>, ReadonlyArray<T[TKey]>]>>, key: TKey): Array<T> | null;
|
|
310
|
-
|
|
311
|
-
export declare const sortRules: readonly [readonly [readonly ["queryFn"], readonly ["getPreviousPageParam", "getNextPageParam"]]];
|
|
312
|
-
|
|
313
|
-
export declare const sortRules_alias_1: readonly [readonly [readonly ["onMutate"], readonly ["onError", "onSettled"]]];
|
|
314
|
-
|
|
315
|
-
export declare function uniqueBy<T>(arr: Array<T>, fn: (x: T) => unknown): Array<T>;
|
|
316
|
-
|
|
317
|
-
export declare const useQueryHookNames: string[];
|
|
318
|
-
|
|
319
|
-
export { }
|