@tanstack/eslint-plugin-query 5.95.2 → 5.96.1

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.
@@ -2,7 +2,6 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
2
2
  import type { ESLint } from 'eslint';
3
3
  import { ESLintUtils } from '@typescript-eslint/utils';
4
4
  import type { Linter } from 'eslint';
5
- import { Options as Options_2 } from 'tsup';
6
5
  import { RuleListener } from '@typescript-eslint/utils/ts-eslint';
7
6
  import { RuleModule } from '@typescript-eslint/utils/ts-eslint';
8
7
  import type { TSESLint } from '@typescript-eslint/utils';
@@ -45,12 +44,8 @@ export declare const ASTUtils: {
45
44
  getNestedReturnStatements(node: TSESTree.Node): Array<TSESTree.ReturnStatement>;
46
45
  };
47
46
 
48
- declare type CheckedProperties = (typeof checkedProperties)[number];
49
-
50
47
  export declare const checkedProperties: readonly ["queryFn", "getPreviousPageParam", "getNextPageParam"];
51
48
 
52
- declare type CheckedProperties_2 = (typeof checkedProperties_alias_1)[number];
53
-
54
49
  export declare const checkedProperties_alias_1: readonly ["onMutate", "onError", "onSettled"];
55
50
 
56
51
  declare type Context = Parameters<Create>[0];
@@ -65,14 +60,6 @@ declare const createRule: <Options extends readonly unknown[], MessageIds extend
65
60
  name: string;
66
61
  };
67
62
 
68
- export declare const default_alias_1: any[];
69
-
70
- export declare const default_alias_2: any[];
71
-
72
- export declare const default_alias_3: Options_2 | Options_2[] | ((overrideOptions: Options_2) => Options_2 | Options_2[] | Promise<Options_2 | Options_2[]>);
73
-
74
- export declare const default_alias_4: Record<string, any>;
75
-
76
63
  export declare function detectTanstackQueryImports(create: EnhancedCreate): Create;
77
64
 
78
65
  declare type EnhancedCreate = (context: Context, options: Options, helpers: Helpers) => ReturnType<Create>;
@@ -153,28 +140,10 @@ export declare const ExhaustiveDepsUtils: {
153
140
  getQueryFnNodes(queryFn: TSESTree.Property): Array<TSESTree.Node>;
154
141
  };
155
142
 
156
- export declare function expectArrayEqualIgnoreOrder<T>(a: Array<T>, b: Array<T>): void;
157
-
158
143
  export declare type ExtraRuleDocs = {
159
144
  recommended: 'strict' | 'error' | 'warn';
160
145
  };
161
146
 
162
- export declare function generateInterleavedCombinations<TData, TAdditional, TResult extends TData | TAdditional>(data: Array<TData> | ReadonlyArray<TData>, additional: Array<TAdditional> | ReadonlyArray<TAdditional>): Array<Array<TResult>>;
163
-
164
- export declare function generateInvalidPermutations(arr: ReadonlyArray<CheckedProperties>): Array<{
165
- invalid: Array<CheckedProperties>;
166
- valid: Array<CheckedProperties>;
167
- }>;
168
-
169
- export declare function generateInvalidPermutations_alias_1(arr: ReadonlyArray<CheckedProperties_2>): Array<{
170
- invalid: Array<CheckedProperties_2>;
171
- valid: Array<CheckedProperties_2>;
172
- }>;
173
-
174
- export declare function generatePartialCombinations<T>(arr: ReadonlyArray<T>, minLength: number): Array<Array<T>>;
175
-
176
- export declare function generatePermutations<T>(arr: Array<T>): Array<Array<T>>;
177
-
178
147
  export declare const getDocsUrl: (ruleName: string) => string;
179
148
 
180
149
  declare type Helpers = {
@@ -188,24 +157,6 @@ export declare const infiniteQueryFunctions: readonly ["infiniteQueryOptions", "
188
157
 
189
158
  export declare type InfiniteQueryProperties = (typeof checkedProperties)[number];
190
159
 
191
- /**
192
- * @param {Object} opts - Options for building configurations.
193
- * @param {string[]} opts.entry - The entry array.
194
- * @returns {import('tsup').Options}
195
- */
196
- export declare function legacyConfig(opts: {
197
- entry: string[];
198
- }): Options_2;
199
-
200
- /**
201
- * @param {Object} opts - Options for building configurations.
202
- * @param {string[]} opts.entry - The entry array.
203
- * @returns {import('tsup').Options}
204
- */
205
- export declare function modernConfig(opts: {
206
- entry: string[];
207
- }): Options_2;
208
-
209
160
  export declare type MutationFunctions = (typeof mutationFunctions)[number];
210
161
 
211
162
  export declare const mutationFunctions: readonly ["useMutation"];
@@ -225,14 +176,14 @@ export declare const name_alias_4 = "no-unstable-deps";
225
176
 
226
177
  export declare const name_alias_5 = "no-void-query-fn";
227
178
 
228
- export declare const name_alias_6 = "stable-query-client";
179
+ export declare const name_alias_6 = "prefer-query-options";
180
+
181
+ export declare const name_alias_7 = "stable-query-client";
229
182
 
230
183
  export declare const NoRestDestructuringUtils: {
231
184
  isObjectRestDestructuring(node: TSESTree.Node): boolean;
232
185
  };
233
186
 
234
- export declare function normalizeIndent(template: TemplateStringsArray): string;
235
-
236
187
  declare type Options = Parameters<Create>[1];
237
188
 
238
189
  declare const plugin: {
@@ -243,13 +194,26 @@ declare const plugin: {
243
194
  recommended: {
244
195
  plugins: string[];
245
196
  rules: {
246
- '@tanstack/query/exhaustive-deps': "error";
247
- '@tanstack/query/no-rest-destructuring': "warn";
248
- '@tanstack/query/stable-query-client': "error";
249
- '@tanstack/query/no-unstable-deps': "error";
250
- '@tanstack/query/infinite-query-property-order': "error";
251
- '@tanstack/query/no-void-query-fn': "error";
252
- '@tanstack/query/mutation-property-order': "error";
197
+ readonly '@tanstack/query/exhaustive-deps': "error";
198
+ readonly '@tanstack/query/no-rest-destructuring': "warn";
199
+ readonly '@tanstack/query/stable-query-client': "error";
200
+ readonly '@tanstack/query/no-unstable-deps': "error";
201
+ readonly '@tanstack/query/infinite-query-property-order': "error";
202
+ readonly '@tanstack/query/no-void-query-fn': "error";
203
+ readonly '@tanstack/query/mutation-property-order': "error";
204
+ };
205
+ };
206
+ recommendedStrict: {
207
+ plugins: string[];
208
+ rules: {
209
+ readonly '@tanstack/query/prefer-query-options': "error";
210
+ readonly '@tanstack/query/exhaustive-deps': "error";
211
+ readonly '@tanstack/query/no-rest-destructuring': "warn";
212
+ readonly '@tanstack/query/stable-query-client': "error";
213
+ readonly '@tanstack/query/no-unstable-deps': "error";
214
+ readonly '@tanstack/query/infinite-query-property-order': "error";
215
+ readonly '@tanstack/query/no-void-query-fn': "error";
216
+ readonly '@tanstack/query/mutation-property-order': "error";
253
217
  };
254
218
  };
255
219
  'flat/recommended': {
@@ -258,13 +222,29 @@ declare const plugin: {
258
222
  '@tanstack/query': {};
259
223
  };
260
224
  rules: {
261
- '@tanstack/query/exhaustive-deps': "error";
262
- '@tanstack/query/no-rest-destructuring': "warn";
263
- '@tanstack/query/stable-query-client': "error";
264
- '@tanstack/query/no-unstable-deps': "error";
265
- '@tanstack/query/infinite-query-property-order': "error";
266
- '@tanstack/query/no-void-query-fn': "error";
267
- '@tanstack/query/mutation-property-order': "error";
225
+ readonly '@tanstack/query/exhaustive-deps': "error";
226
+ readonly '@tanstack/query/no-rest-destructuring': "warn";
227
+ readonly '@tanstack/query/stable-query-client': "error";
228
+ readonly '@tanstack/query/no-unstable-deps': "error";
229
+ readonly '@tanstack/query/infinite-query-property-order': "error";
230
+ readonly '@tanstack/query/no-void-query-fn': "error";
231
+ readonly '@tanstack/query/mutation-property-order': "error";
232
+ };
233
+ }[];
234
+ 'flat/recommended-strict': {
235
+ name: string;
236
+ plugins: {
237
+ '@tanstack/query': {};
238
+ };
239
+ rules: {
240
+ readonly '@tanstack/query/prefer-query-options': "error";
241
+ readonly '@tanstack/query/exhaustive-deps': "error";
242
+ readonly '@tanstack/query/no-rest-destructuring': "warn";
243
+ readonly '@tanstack/query/stable-query-client': "error";
244
+ readonly '@tanstack/query/no-unstable-deps': "error";
245
+ readonly '@tanstack/query/infinite-query-property-order': "error";
246
+ readonly '@tanstack/query/no-void-query-fn': "error";
247
+ readonly '@tanstack/query/mutation-property-order': "error";
268
248
  };
269
249
  }[];
270
250
  };
@@ -277,7 +257,9 @@ declare interface Plugin_2 extends Omit<ESLint.Plugin, 'rules'> {
277
257
  rules: Record<RuleKey, RuleModule<any, any, any>>;
278
258
  configs: {
279
259
  recommended: ESLint.ConfigData;
260
+ recommendedStrict: ESLint.ConfigData;
280
261
  'flat/recommended': Array<Linter.Config>;
262
+ 'flat/recommended-strict': Array<Linter.Config>;
281
263
  };
282
264
  }
283
265
  export { Plugin_2 as Plugin }
@@ -312,6 +294,10 @@ export declare const rule_alias_6: ESLintUtils.RuleModule<string, readonly unkno
312
294
  name: string;
313
295
  };
314
296
 
297
+ export declare const rule_alias_7: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
298
+ name: string;
299
+ };
300
+
315
301
  declare type RuleKey = keyof typeof rules;
316
302
 
317
303
  export declare const rules: Record<string, ESLintUtils.RuleModule<string, ReadonlyArray<unknown>, ExtraRuleDocs, ESLintUtils.RuleListener>>;
@@ -2,7 +2,6 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
2
2
  import type { ESLint } from 'eslint';
3
3
  import { ESLintUtils } from '@typescript-eslint/utils';
4
4
  import type { Linter } from 'eslint';
5
- import { Options as Options_2 } from 'tsup';
6
5
  import { RuleListener } from '@typescript-eslint/utils/ts-eslint';
7
6
  import { RuleModule } from '@typescript-eslint/utils/ts-eslint';
8
7
  import type { TSESLint } from '@typescript-eslint/utils';
@@ -45,12 +44,8 @@ export declare const ASTUtils: {
45
44
  getNestedReturnStatements(node: TSESTree.Node): Array<TSESTree.ReturnStatement>;
46
45
  };
47
46
 
48
- declare type CheckedProperties = (typeof checkedProperties)[number];
49
-
50
47
  export declare const checkedProperties: readonly ["queryFn", "getPreviousPageParam", "getNextPageParam"];
51
48
 
52
- declare type CheckedProperties_2 = (typeof checkedProperties_alias_1)[number];
53
-
54
49
  export declare const checkedProperties_alias_1: readonly ["onMutate", "onError", "onSettled"];
55
50
 
56
51
  declare type Context = Parameters<Create>[0];
@@ -65,14 +60,6 @@ declare const createRule: <Options extends readonly unknown[], MessageIds extend
65
60
  name: string;
66
61
  };
67
62
 
68
- export declare const default_alias_1: any[];
69
-
70
- export declare const default_alias_2: any[];
71
-
72
- export declare const default_alias_3: Options_2 | Options_2[] | ((overrideOptions: Options_2) => Options_2 | Options_2[] | Promise<Options_2 | Options_2[]>);
73
-
74
- export declare const default_alias_4: Record<string, any>;
75
-
76
63
  export declare function detectTanstackQueryImports(create: EnhancedCreate): Create;
77
64
 
78
65
  declare type EnhancedCreate = (context: Context, options: Options, helpers: Helpers) => ReturnType<Create>;
@@ -153,28 +140,10 @@ export declare const ExhaustiveDepsUtils: {
153
140
  getQueryFnNodes(queryFn: TSESTree.Property): Array<TSESTree.Node>;
154
141
  };
155
142
 
156
- export declare function expectArrayEqualIgnoreOrder<T>(a: Array<T>, b: Array<T>): void;
157
-
158
143
  export declare type ExtraRuleDocs = {
159
144
  recommended: 'strict' | 'error' | 'warn';
160
145
  };
161
146
 
162
- export declare function generateInterleavedCombinations<TData, TAdditional, TResult extends TData | TAdditional>(data: Array<TData> | ReadonlyArray<TData>, additional: Array<TAdditional> | ReadonlyArray<TAdditional>): Array<Array<TResult>>;
163
-
164
- export declare function generateInvalidPermutations(arr: ReadonlyArray<CheckedProperties>): Array<{
165
- invalid: Array<CheckedProperties>;
166
- valid: Array<CheckedProperties>;
167
- }>;
168
-
169
- export declare function generateInvalidPermutations_alias_1(arr: ReadonlyArray<CheckedProperties_2>): Array<{
170
- invalid: Array<CheckedProperties_2>;
171
- valid: Array<CheckedProperties_2>;
172
- }>;
173
-
174
- export declare function generatePartialCombinations<T>(arr: ReadonlyArray<T>, minLength: number): Array<Array<T>>;
175
-
176
- export declare function generatePermutations<T>(arr: Array<T>): Array<Array<T>>;
177
-
178
147
  export declare const getDocsUrl: (ruleName: string) => string;
179
148
 
180
149
  declare type Helpers = {
@@ -188,24 +157,6 @@ export declare const infiniteQueryFunctions: readonly ["infiniteQueryOptions", "
188
157
 
189
158
  export declare type InfiniteQueryProperties = (typeof checkedProperties)[number];
190
159
 
191
- /**
192
- * @param {Object} opts - Options for building configurations.
193
- * @param {string[]} opts.entry - The entry array.
194
- * @returns {import('tsup').Options}
195
- */
196
- export declare function legacyConfig(opts: {
197
- entry: string[];
198
- }): Options_2;
199
-
200
- /**
201
- * @param {Object} opts - Options for building configurations.
202
- * @param {string[]} opts.entry - The entry array.
203
- * @returns {import('tsup').Options}
204
- */
205
- export declare function modernConfig(opts: {
206
- entry: string[];
207
- }): Options_2;
208
-
209
160
  export declare type MutationFunctions = (typeof mutationFunctions)[number];
210
161
 
211
162
  export declare const mutationFunctions: readonly ["useMutation"];
@@ -225,14 +176,14 @@ export declare const name_alias_4 = "no-unstable-deps";
225
176
 
226
177
  export declare const name_alias_5 = "no-void-query-fn";
227
178
 
228
- export declare const name_alias_6 = "stable-query-client";
179
+ export declare const name_alias_6 = "prefer-query-options";
180
+
181
+ export declare const name_alias_7 = "stable-query-client";
229
182
 
230
183
  export declare const NoRestDestructuringUtils: {
231
184
  isObjectRestDestructuring(node: TSESTree.Node): boolean;
232
185
  };
233
186
 
234
- export declare function normalizeIndent(template: TemplateStringsArray): string;
235
-
236
187
  declare type Options = Parameters<Create>[1];
237
188
 
238
189
  declare const plugin: {
@@ -243,13 +194,26 @@ declare const plugin: {
243
194
  recommended: {
244
195
  plugins: string[];
245
196
  rules: {
246
- '@tanstack/query/exhaustive-deps': "error";
247
- '@tanstack/query/no-rest-destructuring': "warn";
248
- '@tanstack/query/stable-query-client': "error";
249
- '@tanstack/query/no-unstable-deps': "error";
250
- '@tanstack/query/infinite-query-property-order': "error";
251
- '@tanstack/query/no-void-query-fn': "error";
252
- '@tanstack/query/mutation-property-order': "error";
197
+ readonly '@tanstack/query/exhaustive-deps': "error";
198
+ readonly '@tanstack/query/no-rest-destructuring': "warn";
199
+ readonly '@tanstack/query/stable-query-client': "error";
200
+ readonly '@tanstack/query/no-unstable-deps': "error";
201
+ readonly '@tanstack/query/infinite-query-property-order': "error";
202
+ readonly '@tanstack/query/no-void-query-fn': "error";
203
+ readonly '@tanstack/query/mutation-property-order': "error";
204
+ };
205
+ };
206
+ recommendedStrict: {
207
+ plugins: string[];
208
+ rules: {
209
+ readonly '@tanstack/query/prefer-query-options': "error";
210
+ readonly '@tanstack/query/exhaustive-deps': "error";
211
+ readonly '@tanstack/query/no-rest-destructuring': "warn";
212
+ readonly '@tanstack/query/stable-query-client': "error";
213
+ readonly '@tanstack/query/no-unstable-deps': "error";
214
+ readonly '@tanstack/query/infinite-query-property-order': "error";
215
+ readonly '@tanstack/query/no-void-query-fn': "error";
216
+ readonly '@tanstack/query/mutation-property-order': "error";
253
217
  };
254
218
  };
255
219
  'flat/recommended': {
@@ -258,13 +222,29 @@ declare const plugin: {
258
222
  '@tanstack/query': {};
259
223
  };
260
224
  rules: {
261
- '@tanstack/query/exhaustive-deps': "error";
262
- '@tanstack/query/no-rest-destructuring': "warn";
263
- '@tanstack/query/stable-query-client': "error";
264
- '@tanstack/query/no-unstable-deps': "error";
265
- '@tanstack/query/infinite-query-property-order': "error";
266
- '@tanstack/query/no-void-query-fn': "error";
267
- '@tanstack/query/mutation-property-order': "error";
225
+ readonly '@tanstack/query/exhaustive-deps': "error";
226
+ readonly '@tanstack/query/no-rest-destructuring': "warn";
227
+ readonly '@tanstack/query/stable-query-client': "error";
228
+ readonly '@tanstack/query/no-unstable-deps': "error";
229
+ readonly '@tanstack/query/infinite-query-property-order': "error";
230
+ readonly '@tanstack/query/no-void-query-fn': "error";
231
+ readonly '@tanstack/query/mutation-property-order': "error";
232
+ };
233
+ }[];
234
+ 'flat/recommended-strict': {
235
+ name: string;
236
+ plugins: {
237
+ '@tanstack/query': {};
238
+ };
239
+ rules: {
240
+ readonly '@tanstack/query/prefer-query-options': "error";
241
+ readonly '@tanstack/query/exhaustive-deps': "error";
242
+ readonly '@tanstack/query/no-rest-destructuring': "warn";
243
+ readonly '@tanstack/query/stable-query-client': "error";
244
+ readonly '@tanstack/query/no-unstable-deps': "error";
245
+ readonly '@tanstack/query/infinite-query-property-order': "error";
246
+ readonly '@tanstack/query/no-void-query-fn': "error";
247
+ readonly '@tanstack/query/mutation-property-order': "error";
268
248
  };
269
249
  }[];
270
250
  };
@@ -277,7 +257,9 @@ declare interface Plugin_2 extends Omit<ESLint.Plugin, 'rules'> {
277
257
  rules: Record<RuleKey, RuleModule<any, any, any>>;
278
258
  configs: {
279
259
  recommended: ESLint.ConfigData;
260
+ recommendedStrict: ESLint.ConfigData;
280
261
  'flat/recommended': Array<Linter.Config>;
262
+ 'flat/recommended-strict': Array<Linter.Config>;
281
263
  };
282
264
  }
283
265
  export { Plugin_2 as Plugin }
@@ -312,6 +294,10 @@ export declare const rule_alias_6: ESLintUtils.RuleModule<string, readonly unkno
312
294
  name: string;
313
295
  };
314
296
 
297
+ export declare const rule_alias_7: ESLintUtils.RuleModule<string, readonly unknown[], ExtraRuleDocs, ESLintUtils.RuleListener> & {
298
+ name: string;
299
+ };
300
+
315
301
  declare type RuleKey = keyof typeof rules;
316
302
 
317
303
  export declare const rules: Record<string, ESLintUtils.RuleModule<string, ReadonlyArray<unknown>, ExtraRuleDocs, ESLintUtils.RuleListener>>;