@tanstack/eslint-plugin-query 5.94.4 → 5.94.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/build/legacy/_tsup-dts-rollup.d.cts +275 -0
- package/build/legacy/_tsup-dts-rollup.d.ts +275 -0
- package/build/legacy/chunk-HD2KSEKJ.js +1145 -0
- package/build/legacy/chunk-HD2KSEKJ.js.map +1 -0
- package/build/legacy/index.cjs +1214 -0
- package/build/legacy/index.cjs.map +1 -0
- package/build/legacy/index.d.cts +3 -0
- package/build/legacy/index.d.ts +3 -0
- package/build/legacy/index.js +50 -0
- package/build/legacy/index.js.map +1 -0
- package/build/legacy/rules.cjs +1171 -0
- package/build/legacy/rules.cjs.map +1 -0
- package/build/legacy/rules.d.cts +1 -0
- package/build/legacy/rules.d.ts +1 -0
- package/build/legacy/rules.js +7 -0
- package/build/legacy/rules.js.map +1 -0
- package/build/legacy/types.cjs +19 -0
- package/build/legacy/types.cjs.map +1 -0
- package/build/legacy/types.d.cts +1 -0
- package/build/legacy/types.d.ts +1 -0
- package/build/legacy/types.js +1 -0
- package/build/legacy/types.js.map +1 -0
- package/build/modern/_tsup-dts-rollup.d.cts +275 -0
- package/build/modern/_tsup-dts-rollup.d.ts +275 -0
- package/build/modern/chunk-XO2SGL7P.js +1137 -0
- package/build/modern/chunk-XO2SGL7P.js.map +1 -0
- package/build/modern/index.cjs +1207 -0
- package/build/modern/index.cjs.map +1 -0
- package/build/modern/index.d.cts +3 -0
- package/build/modern/index.d.ts +3 -0
- package/build/modern/index.js +50 -0
- package/build/modern/index.js.map +1 -0
- package/build/modern/rules.cjs +1164 -0
- package/build/modern/rules.cjs.map +1 -0
- package/build/modern/rules.d.cts +1 -0
- package/build/modern/rules.d.ts +1 -0
- package/build/modern/rules.js +7 -0
- package/build/modern/rules.js.map +1 -0
- package/build/modern/types.cjs +20 -0
- package/build/modern/types.cjs.map +1 -0
- package/build/modern/types.d.cts +1 -0
- package/build/modern/types.d.ts +1 -0
- package/build/modern/types.js +1 -0
- package/build/modern/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,275 @@
|
|
|
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 { Options as Options_2 } from 'tsup';
|
|
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
|
+
isAncestorIsCallee(identifier: TSESTree.Node): boolean;
|
|
26
|
+
traverseUpOnly(identifier: TSESTree.Node, allowedNodeTypes: Array<AST_NODE_TYPES>): 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
|
+
declare type CheckedProperties = (typeof checkedProperties)[number];
|
|
50
|
+
|
|
51
|
+
export declare const checkedProperties: readonly ["queryFn", "getPreviousPageParam", "getNextPageParam"];
|
|
52
|
+
|
|
53
|
+
declare type CheckedProperties_2 = (typeof checkedProperties_alias_1)[number];
|
|
54
|
+
|
|
55
|
+
export declare const checkedProperties_alias_1: readonly ["onMutate", "onError", "onSettled"];
|
|
56
|
+
|
|
57
|
+
declare type Context = Parameters<Create>[0];
|
|
58
|
+
|
|
59
|
+
declare type Create = Parameters<ReturnType<typeof ESLintUtils.RuleCreator>>[0]['create'];
|
|
60
|
+
|
|
61
|
+
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> & {
|
|
62
|
+
name: string;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
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> & {
|
|
66
|
+
name: string;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export declare const default_alias_1: any[];
|
|
70
|
+
|
|
71
|
+
export declare const default_alias_2: any[];
|
|
72
|
+
|
|
73
|
+
export declare const default_alias_3: Options_2 | Options_2[] | ((overrideOptions: Options_2) => Options_2 | Options_2[] | Promise<Options_2 | Options_2[]>);
|
|
74
|
+
|
|
75
|
+
export declare const default_alias_4: Record<string, any>;
|
|
76
|
+
|
|
77
|
+
export declare function detectTanstackQueryImports(create: EnhancedCreate): Create;
|
|
78
|
+
|
|
79
|
+
declare type EnhancedCreate = (context: Context, options: Options, helpers: Helpers) => ReturnType<Create>;
|
|
80
|
+
|
|
81
|
+
export declare const ExhaustiveDepsUtils: {
|
|
82
|
+
isRelevantReference(params: {
|
|
83
|
+
sourceCode: Readonly<TSESLint.SourceCode>;
|
|
84
|
+
reference: TSESLint.Scope.Reference;
|
|
85
|
+
scopeManager: TSESLint.Scope.ScopeManager;
|
|
86
|
+
node: TSESTree.Node;
|
|
87
|
+
filename: string;
|
|
88
|
+
}): boolean;
|
|
89
|
+
isInstanceOfKind(node: TSESTree.Node): boolean;
|
|
90
|
+
collectQueryKeyDeps(params: {
|
|
91
|
+
sourceCode: Readonly<TSESLint.SourceCode>;
|
|
92
|
+
scopeManager: TSESLint.Scope.ScopeManager;
|
|
93
|
+
queryKeyNode: TSESTree.Node;
|
|
94
|
+
}): Set<string>;
|
|
95
|
+
isNode(value: unknown): value is TSESTree.Node;
|
|
96
|
+
collectExternalRefsInFunction(params: {
|
|
97
|
+
functionNode: TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression;
|
|
98
|
+
scopeManager: TSESLint.Scope.ScopeManager;
|
|
99
|
+
}): Array<TSESLint.Scope.Reference>;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export declare function expectArrayEqualIgnoreOrder<T>(a: Array<T>, b: Array<T>): void;
|
|
103
|
+
|
|
104
|
+
export declare type ExtraRuleDocs = {
|
|
105
|
+
recommended: 'strict' | 'error' | 'warn';
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export declare function generateInterleavedCombinations<TData, TAdditional, TResult extends TData | TAdditional>(data: Array<TData> | ReadonlyArray<TData>, additional: Array<TAdditional> | ReadonlyArray<TAdditional>): Array<Array<TResult>>;
|
|
109
|
+
|
|
110
|
+
export declare function generateInvalidPermutations(arr: ReadonlyArray<CheckedProperties>): Array<{
|
|
111
|
+
invalid: Array<CheckedProperties>;
|
|
112
|
+
valid: Array<CheckedProperties>;
|
|
113
|
+
}>;
|
|
114
|
+
|
|
115
|
+
export declare function generateInvalidPermutations_alias_1(arr: ReadonlyArray<CheckedProperties_2>): Array<{
|
|
116
|
+
invalid: Array<CheckedProperties_2>;
|
|
117
|
+
valid: Array<CheckedProperties_2>;
|
|
118
|
+
}>;
|
|
119
|
+
|
|
120
|
+
export declare function generatePartialCombinations<T>(arr: ReadonlyArray<T>, minLength: number): Array<Array<T>>;
|
|
121
|
+
|
|
122
|
+
export declare function generatePermutations<T>(arr: Array<T>): Array<Array<T>>;
|
|
123
|
+
|
|
124
|
+
export declare const getDocsUrl: (ruleName: string) => string;
|
|
125
|
+
|
|
126
|
+
declare type Helpers = {
|
|
127
|
+
isSpecificTanstackQueryImport: (node: TSESTree.Identifier, source: string) => boolean;
|
|
128
|
+
isTanstackQueryImport: (node: TSESTree.Identifier) => boolean;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export declare type InfiniteQueryFunctions = (typeof infiniteQueryFunctions)[number];
|
|
132
|
+
|
|
133
|
+
export declare const infiniteQueryFunctions: readonly ["infiniteQueryOptions", "useInfiniteQuery", "useSuspenseInfiniteQuery"];
|
|
134
|
+
|
|
135
|
+
export declare type InfiniteQueryProperties = (typeof checkedProperties)[number];
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @param {Object} opts - Options for building configurations.
|
|
139
|
+
* @param {string[]} opts.entry - The entry array.
|
|
140
|
+
* @returns {import('tsup').Options}
|
|
141
|
+
*/
|
|
142
|
+
export declare function legacyConfig(opts: {
|
|
143
|
+
entry: string[];
|
|
144
|
+
}): Options_2;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @param {Object} opts - Options for building configurations.
|
|
148
|
+
* @param {string[]} opts.entry - The entry array.
|
|
149
|
+
* @returns {import('tsup').Options}
|
|
150
|
+
*/
|
|
151
|
+
export declare function modernConfig(opts: {
|
|
152
|
+
entry: string[];
|
|
153
|
+
}): Options_2;
|
|
154
|
+
|
|
155
|
+
export declare type MutationFunctions = (typeof mutationFunctions)[number];
|
|
156
|
+
|
|
157
|
+
export declare const mutationFunctions: readonly ["useMutation"];
|
|
158
|
+
|
|
159
|
+
export declare type MutationProperties = (typeof checkedProperties_alias_1)[number];
|
|
160
|
+
|
|
161
|
+
declare const name_2 = "exhaustive-deps";
|
|
162
|
+
export { name_2 as name }
|
|
163
|
+
|
|
164
|
+
export declare const name_alias_1 = "infinite-query-property-order";
|
|
165
|
+
|
|
166
|
+
export declare const name_alias_2 = "mutation-property-order";
|
|
167
|
+
|
|
168
|
+
export declare const name_alias_3 = "no-rest-destructuring";
|
|
169
|
+
|
|
170
|
+
export declare const name_alias_4 = "no-unstable-deps";
|
|
171
|
+
|
|
172
|
+
export declare const name_alias_5 = "no-void-query-fn";
|
|
173
|
+
|
|
174
|
+
export declare const name_alias_6 = "stable-query-client";
|
|
175
|
+
|
|
176
|
+
export declare const NoRestDestructuringUtils: {
|
|
177
|
+
isObjectRestDestructuring(node: TSESTree.Node): boolean;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export declare function normalizeIndent(template: TemplateStringsArray): string;
|
|
181
|
+
|
|
182
|
+
declare type Options = Parameters<Create>[1];
|
|
183
|
+
|
|
184
|
+
declare const plugin: {
|
|
185
|
+
meta: {
|
|
186
|
+
name: string;
|
|
187
|
+
};
|
|
188
|
+
configs: {
|
|
189
|
+
recommended: {
|
|
190
|
+
plugins: string[];
|
|
191
|
+
rules: {
|
|
192
|
+
'@tanstack/query/exhaustive-deps': "error";
|
|
193
|
+
'@tanstack/query/no-rest-destructuring': "warn";
|
|
194
|
+
'@tanstack/query/stable-query-client': "error";
|
|
195
|
+
'@tanstack/query/no-unstable-deps': "error";
|
|
196
|
+
'@tanstack/query/infinite-query-property-order': "error";
|
|
197
|
+
'@tanstack/query/no-void-query-fn': "error";
|
|
198
|
+
'@tanstack/query/mutation-property-order': "error";
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
'flat/recommended': {
|
|
202
|
+
name: string;
|
|
203
|
+
plugins: {
|
|
204
|
+
'@tanstack/query': {};
|
|
205
|
+
};
|
|
206
|
+
rules: {
|
|
207
|
+
'@tanstack/query/exhaustive-deps': "error";
|
|
208
|
+
'@tanstack/query/no-rest-destructuring': "warn";
|
|
209
|
+
'@tanstack/query/stable-query-client': "error";
|
|
210
|
+
'@tanstack/query/no-unstable-deps': "error";
|
|
211
|
+
'@tanstack/query/infinite-query-property-order': "error";
|
|
212
|
+
'@tanstack/query/no-void-query-fn': "error";
|
|
213
|
+
'@tanstack/query/mutation-property-order': "error";
|
|
214
|
+
};
|
|
215
|
+
}[];
|
|
216
|
+
};
|
|
217
|
+
rules: Record<string, RuleModule<string, readonly unknown[], ExtraRuleDocs, RuleListener>>;
|
|
218
|
+
};
|
|
219
|
+
export { plugin as default_alias }
|
|
220
|
+
export { plugin }
|
|
221
|
+
|
|
222
|
+
declare interface Plugin_2 extends Omit<ESLint.Plugin, 'rules'> {
|
|
223
|
+
rules: Record<RuleKey, RuleModule<any, any, any>>;
|
|
224
|
+
configs: {
|
|
225
|
+
recommended: ESLint.ConfigData;
|
|
226
|
+
'flat/recommended': Array<Linter.Config>;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
export { Plugin_2 as Plugin }
|
|
230
|
+
|
|
231
|
+
export declare const reactHookNames: string[];
|
|
232
|
+
|
|
233
|
+
export declare const rule: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
234
|
+
name: string;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
export declare const rule_alias_1: RuleModule<string, readonly unknown[], ExtraRuleDocs, RuleListener> & {
|
|
238
|
+
name: string;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export declare const rule_alias_2: RuleModule<string, readonly unknown[], ExtraRuleDocs, RuleListener> & {
|
|
242
|
+
name: string;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export declare const rule_alias_3: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
246
|
+
name: string;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export declare const rule_alias_4: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
250
|
+
name: string;
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
export declare const rule_alias_5: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
254
|
+
name: string;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export declare const rule_alias_6: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
258
|
+
name: string;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
declare type RuleKey = keyof typeof rules;
|
|
262
|
+
|
|
263
|
+
export declare const rules: Record<string, ESLintUtils.RuleModule<string, ReadonlyArray<unknown>, ExtraRuleDocs, ESLintUtils.RuleListener>>;
|
|
264
|
+
|
|
265
|
+
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;
|
|
266
|
+
|
|
267
|
+
export declare const sortRules: readonly [readonly [readonly ["queryFn"], readonly ["getPreviousPageParam", "getNextPageParam"]]];
|
|
268
|
+
|
|
269
|
+
export declare const sortRules_alias_1: readonly [readonly [readonly ["onMutate"], readonly ["onError", "onSettled"]]];
|
|
270
|
+
|
|
271
|
+
export declare function uniqueBy<T>(arr: Array<T>, fn: (x: T) => unknown): Array<T>;
|
|
272
|
+
|
|
273
|
+
export declare const useQueryHookNames: string[];
|
|
274
|
+
|
|
275
|
+
export { }
|
|
@@ -0,0 +1,275 @@
|
|
|
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 { Options as Options_2 } from 'tsup';
|
|
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
|
+
isAncestorIsCallee(identifier: TSESTree.Node): boolean;
|
|
26
|
+
traverseUpOnly(identifier: TSESTree.Node, allowedNodeTypes: Array<AST_NODE_TYPES>): 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
|
+
declare type CheckedProperties = (typeof checkedProperties)[number];
|
|
50
|
+
|
|
51
|
+
export declare const checkedProperties: readonly ["queryFn", "getPreviousPageParam", "getNextPageParam"];
|
|
52
|
+
|
|
53
|
+
declare type CheckedProperties_2 = (typeof checkedProperties_alias_1)[number];
|
|
54
|
+
|
|
55
|
+
export declare const checkedProperties_alias_1: readonly ["onMutate", "onError", "onSettled"];
|
|
56
|
+
|
|
57
|
+
declare type Context = Parameters<Create>[0];
|
|
58
|
+
|
|
59
|
+
declare type Create = Parameters<ReturnType<typeof ESLintUtils.RuleCreator>>[0]['create'];
|
|
60
|
+
|
|
61
|
+
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> & {
|
|
62
|
+
name: string;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
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> & {
|
|
66
|
+
name: string;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export declare const default_alias_1: any[];
|
|
70
|
+
|
|
71
|
+
export declare const default_alias_2: any[];
|
|
72
|
+
|
|
73
|
+
export declare const default_alias_3: Options_2 | Options_2[] | ((overrideOptions: Options_2) => Options_2 | Options_2[] | Promise<Options_2 | Options_2[]>);
|
|
74
|
+
|
|
75
|
+
export declare const default_alias_4: Record<string, any>;
|
|
76
|
+
|
|
77
|
+
export declare function detectTanstackQueryImports(create: EnhancedCreate): Create;
|
|
78
|
+
|
|
79
|
+
declare type EnhancedCreate = (context: Context, options: Options, helpers: Helpers) => ReturnType<Create>;
|
|
80
|
+
|
|
81
|
+
export declare const ExhaustiveDepsUtils: {
|
|
82
|
+
isRelevantReference(params: {
|
|
83
|
+
sourceCode: Readonly<TSESLint.SourceCode>;
|
|
84
|
+
reference: TSESLint.Scope.Reference;
|
|
85
|
+
scopeManager: TSESLint.Scope.ScopeManager;
|
|
86
|
+
node: TSESTree.Node;
|
|
87
|
+
filename: string;
|
|
88
|
+
}): boolean;
|
|
89
|
+
isInstanceOfKind(node: TSESTree.Node): boolean;
|
|
90
|
+
collectQueryKeyDeps(params: {
|
|
91
|
+
sourceCode: Readonly<TSESLint.SourceCode>;
|
|
92
|
+
scopeManager: TSESLint.Scope.ScopeManager;
|
|
93
|
+
queryKeyNode: TSESTree.Node;
|
|
94
|
+
}): Set<string>;
|
|
95
|
+
isNode(value: unknown): value is TSESTree.Node;
|
|
96
|
+
collectExternalRefsInFunction(params: {
|
|
97
|
+
functionNode: TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression;
|
|
98
|
+
scopeManager: TSESLint.Scope.ScopeManager;
|
|
99
|
+
}): Array<TSESLint.Scope.Reference>;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export declare function expectArrayEqualIgnoreOrder<T>(a: Array<T>, b: Array<T>): void;
|
|
103
|
+
|
|
104
|
+
export declare type ExtraRuleDocs = {
|
|
105
|
+
recommended: 'strict' | 'error' | 'warn';
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export declare function generateInterleavedCombinations<TData, TAdditional, TResult extends TData | TAdditional>(data: Array<TData> | ReadonlyArray<TData>, additional: Array<TAdditional> | ReadonlyArray<TAdditional>): Array<Array<TResult>>;
|
|
109
|
+
|
|
110
|
+
export declare function generateInvalidPermutations(arr: ReadonlyArray<CheckedProperties>): Array<{
|
|
111
|
+
invalid: Array<CheckedProperties>;
|
|
112
|
+
valid: Array<CheckedProperties>;
|
|
113
|
+
}>;
|
|
114
|
+
|
|
115
|
+
export declare function generateInvalidPermutations_alias_1(arr: ReadonlyArray<CheckedProperties_2>): Array<{
|
|
116
|
+
invalid: Array<CheckedProperties_2>;
|
|
117
|
+
valid: Array<CheckedProperties_2>;
|
|
118
|
+
}>;
|
|
119
|
+
|
|
120
|
+
export declare function generatePartialCombinations<T>(arr: ReadonlyArray<T>, minLength: number): Array<Array<T>>;
|
|
121
|
+
|
|
122
|
+
export declare function generatePermutations<T>(arr: Array<T>): Array<Array<T>>;
|
|
123
|
+
|
|
124
|
+
export declare const getDocsUrl: (ruleName: string) => string;
|
|
125
|
+
|
|
126
|
+
declare type Helpers = {
|
|
127
|
+
isSpecificTanstackQueryImport: (node: TSESTree.Identifier, source: string) => boolean;
|
|
128
|
+
isTanstackQueryImport: (node: TSESTree.Identifier) => boolean;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export declare type InfiniteQueryFunctions = (typeof infiniteQueryFunctions)[number];
|
|
132
|
+
|
|
133
|
+
export declare const infiniteQueryFunctions: readonly ["infiniteQueryOptions", "useInfiniteQuery", "useSuspenseInfiniteQuery"];
|
|
134
|
+
|
|
135
|
+
export declare type InfiniteQueryProperties = (typeof checkedProperties)[number];
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @param {Object} opts - Options for building configurations.
|
|
139
|
+
* @param {string[]} opts.entry - The entry array.
|
|
140
|
+
* @returns {import('tsup').Options}
|
|
141
|
+
*/
|
|
142
|
+
export declare function legacyConfig(opts: {
|
|
143
|
+
entry: string[];
|
|
144
|
+
}): Options_2;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @param {Object} opts - Options for building configurations.
|
|
148
|
+
* @param {string[]} opts.entry - The entry array.
|
|
149
|
+
* @returns {import('tsup').Options}
|
|
150
|
+
*/
|
|
151
|
+
export declare function modernConfig(opts: {
|
|
152
|
+
entry: string[];
|
|
153
|
+
}): Options_2;
|
|
154
|
+
|
|
155
|
+
export declare type MutationFunctions = (typeof mutationFunctions)[number];
|
|
156
|
+
|
|
157
|
+
export declare const mutationFunctions: readonly ["useMutation"];
|
|
158
|
+
|
|
159
|
+
export declare type MutationProperties = (typeof checkedProperties_alias_1)[number];
|
|
160
|
+
|
|
161
|
+
declare const name_2 = "exhaustive-deps";
|
|
162
|
+
export { name_2 as name }
|
|
163
|
+
|
|
164
|
+
export declare const name_alias_1 = "infinite-query-property-order";
|
|
165
|
+
|
|
166
|
+
export declare const name_alias_2 = "mutation-property-order";
|
|
167
|
+
|
|
168
|
+
export declare const name_alias_3 = "no-rest-destructuring";
|
|
169
|
+
|
|
170
|
+
export declare const name_alias_4 = "no-unstable-deps";
|
|
171
|
+
|
|
172
|
+
export declare const name_alias_5 = "no-void-query-fn";
|
|
173
|
+
|
|
174
|
+
export declare const name_alias_6 = "stable-query-client";
|
|
175
|
+
|
|
176
|
+
export declare const NoRestDestructuringUtils: {
|
|
177
|
+
isObjectRestDestructuring(node: TSESTree.Node): boolean;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export declare function normalizeIndent(template: TemplateStringsArray): string;
|
|
181
|
+
|
|
182
|
+
declare type Options = Parameters<Create>[1];
|
|
183
|
+
|
|
184
|
+
declare const plugin: {
|
|
185
|
+
meta: {
|
|
186
|
+
name: string;
|
|
187
|
+
};
|
|
188
|
+
configs: {
|
|
189
|
+
recommended: {
|
|
190
|
+
plugins: string[];
|
|
191
|
+
rules: {
|
|
192
|
+
'@tanstack/query/exhaustive-deps': "error";
|
|
193
|
+
'@tanstack/query/no-rest-destructuring': "warn";
|
|
194
|
+
'@tanstack/query/stable-query-client': "error";
|
|
195
|
+
'@tanstack/query/no-unstable-deps': "error";
|
|
196
|
+
'@tanstack/query/infinite-query-property-order': "error";
|
|
197
|
+
'@tanstack/query/no-void-query-fn': "error";
|
|
198
|
+
'@tanstack/query/mutation-property-order': "error";
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
'flat/recommended': {
|
|
202
|
+
name: string;
|
|
203
|
+
plugins: {
|
|
204
|
+
'@tanstack/query': {};
|
|
205
|
+
};
|
|
206
|
+
rules: {
|
|
207
|
+
'@tanstack/query/exhaustive-deps': "error";
|
|
208
|
+
'@tanstack/query/no-rest-destructuring': "warn";
|
|
209
|
+
'@tanstack/query/stable-query-client': "error";
|
|
210
|
+
'@tanstack/query/no-unstable-deps': "error";
|
|
211
|
+
'@tanstack/query/infinite-query-property-order': "error";
|
|
212
|
+
'@tanstack/query/no-void-query-fn': "error";
|
|
213
|
+
'@tanstack/query/mutation-property-order': "error";
|
|
214
|
+
};
|
|
215
|
+
}[];
|
|
216
|
+
};
|
|
217
|
+
rules: Record<string, RuleModule<string, readonly unknown[], ExtraRuleDocs, RuleListener>>;
|
|
218
|
+
};
|
|
219
|
+
export { plugin as default_alias }
|
|
220
|
+
export { plugin }
|
|
221
|
+
|
|
222
|
+
declare interface Plugin_2 extends Omit<ESLint.Plugin, 'rules'> {
|
|
223
|
+
rules: Record<RuleKey, RuleModule<any, any, any>>;
|
|
224
|
+
configs: {
|
|
225
|
+
recommended: ESLint.ConfigData;
|
|
226
|
+
'flat/recommended': Array<Linter.Config>;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
export { Plugin_2 as Plugin }
|
|
230
|
+
|
|
231
|
+
export declare const reactHookNames: string[];
|
|
232
|
+
|
|
233
|
+
export declare const rule: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
234
|
+
name: string;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
export declare const rule_alias_1: RuleModule<string, readonly unknown[], ExtraRuleDocs, RuleListener> & {
|
|
238
|
+
name: string;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export declare const rule_alias_2: RuleModule<string, readonly unknown[], ExtraRuleDocs, RuleListener> & {
|
|
242
|
+
name: string;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export declare const rule_alias_3: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
246
|
+
name: string;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export declare const rule_alias_4: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
250
|
+
name: string;
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
export declare const rule_alias_5: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
254
|
+
name: string;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export declare const rule_alias_6: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
|
|
258
|
+
name: string;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
declare type RuleKey = keyof typeof rules;
|
|
262
|
+
|
|
263
|
+
export declare const rules: Record<string, ESLintUtils.RuleModule<string, ReadonlyArray<unknown>, ExtraRuleDocs, ESLintUtils.RuleListener>>;
|
|
264
|
+
|
|
265
|
+
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;
|
|
266
|
+
|
|
267
|
+
export declare const sortRules: readonly [readonly [readonly ["queryFn"], readonly ["getPreviousPageParam", "getNextPageParam"]]];
|
|
268
|
+
|
|
269
|
+
export declare const sortRules_alias_1: readonly [readonly [readonly ["onMutate"], readonly ["onError", "onSettled"]]];
|
|
270
|
+
|
|
271
|
+
export declare function uniqueBy<T>(arr: Array<T>, fn: (x: T) => unknown): Array<T>;
|
|
272
|
+
|
|
273
|
+
export declare const useQueryHookNames: string[];
|
|
274
|
+
|
|
275
|
+
export { }
|