@tanstack/eslint-plugin-query 4.21.0 → 4.24.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.
@@ -0,0 +1,3 @@
1
+ import type { TSESLint } from '@typescript-eslint/utils';
2
+ export declare const name = "exhaustive-deps";
3
+ export declare const rule: TSESLint.RuleModule<string, readonly unknown[], TSESLint.RuleListener>;
@@ -0,0 +1,4 @@
1
+ export declare const rules: {
2
+ "exhaustive-deps": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<string, readonly unknown[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
3
+ "prefer-query-object-syntax": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"preferObjectSyntax" | "returnTypeAreNotObjectSyntax", readonly unknown[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
+ };
@@ -0,0 +1,9 @@
1
+ import type { TSESLint } from '@typescript-eslint/utils';
2
+ declare const messages: {
3
+ preferObjectSyntax: string;
4
+ returnTypeAreNotObjectSyntax: string;
5
+ };
6
+ declare type MessageKey = keyof typeof messages;
7
+ export declare const name = "prefer-query-object-syntax";
8
+ export declare const rule: TSESLint.RuleModule<MessageKey, readonly unknown[]>;
9
+ export {};
@@ -0,0 +1,30 @@
1
+ import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
2
+ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
3
+ import type { RuleContext } from '@typescript-eslint/utils/dist/ts-eslint';
4
+ export declare const ASTUtils: {
5
+ isNodeOfOneOf<T extends TSESTree.AST_NODE_TYPES>(node: TSESTree.Node, types: readonly T[]): node is TSESTree.Node & {
6
+ type: T;
7
+ };
8
+ isIdentifier(node: TSESTree.Node): node is TSESTree.Identifier;
9
+ isIdentifierWithName(node: TSESTree.Node, name: string): node is TSESTree.Identifier;
10
+ isIdentifierWithOneOfNames<T_1 extends string[]>(node: TSESTree.Node, name: T_1): node is TSESTree.Identifier & {
11
+ name: T_1[number];
12
+ };
13
+ isProperty(node: TSESTree.Node): node is TSESTree.Property;
14
+ isObjectExpression(node: TSESTree.Node): node is TSESTree.ObjectExpression;
15
+ isPropertyWithIdentifierKey(node: TSESTree.Node, key: string): node is TSESTree.Property;
16
+ findPropertyWithIdentifierKey(properties: TSESTree.ObjectLiteralElement[], key: string): TSESTree.Property | undefined;
17
+ getNestedIdentifiers(node: TSESTree.Node): TSESTree.Identifier[];
18
+ isAncestorIsCallee(identifier: TSESTree.Node): boolean;
19
+ traverseUpOnly(identifier: TSESTree.Node, allowedNodeTypes: AST_NODE_TYPES[]): TSESTree.Node;
20
+ getExternalRefs(params: {
21
+ scopeManager: TSESLint.Scope.ScopeManager;
22
+ node: TSESTree.Node;
23
+ }): TSESLint.Scope.Reference[];
24
+ mapKeyNodeToText(node: TSESTree.Node, sourceCode: Readonly<TSESLint.SourceCode>): string;
25
+ getReferencedExpressionByIdentifier(params: {
26
+ node: TSESTree.Node;
27
+ context: Readonly<RuleContext<string, readonly unknown[]>>;
28
+ }): TSESTree.Expression | null;
29
+ getNestedReturnStatements(node: TSESTree.Node): TSESTree.ReturnStatement[];
30
+ };
@@ -0,0 +1,7 @@
1
+ import { ESLintUtils } from '@typescript-eslint/utils';
2
+ import type { EnhancedCreate } from './detect-react-query-imports';
3
+ declare type EslintRule = Omit<Parameters<ReturnType<typeof ESLintUtils.RuleCreator>>[0], 'create'> & {
4
+ create: EnhancedCreate;
5
+ };
6
+ export declare function createRule({ create, ...rest }: EslintRule): import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<string, readonly unknown[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { ESLintUtils, TSESTree } from '@typescript-eslint/utils';
2
+ declare type Create = Parameters<ReturnType<typeof ESLintUtils.RuleCreator>>[0]['create'];
3
+ declare type Context = Parameters<Create>[0];
4
+ declare type Options = Parameters<Create>[1];
5
+ declare type Helpers = {
6
+ isTanstackQueryImport: (node: TSESTree.Identifier) => boolean;
7
+ };
8
+ export declare type EnhancedCreate = (context: Context, options: Options, helpers: Helpers) => ReturnType<Create>;
9
+ export declare function detectTanstackQueryImports(create: EnhancedCreate): Create;
10
+ export {};
@@ -0,0 +1 @@
1
+ export declare function objectKeys<T extends Record<string, unknown>>(obj: T): Array<keyof T>;
@@ -0,0 +1 @@
1
+ export declare function normalizeIndent(template: TemplateStringsArray): string;
@@ -0,0 +1 @@
1
+ export declare function uniqueBy<T>(arr: T[], fn: (x: T) => unknown): T[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/eslint-plugin-query",
3
- "version": "4.21.0",
3
+ "version": "4.24.5",
4
4
  "description": "ESLint plugin for TanStack Query",
5
5
  "author": "Eliya Cohen",
6
6
  "license": "MIT",
@@ -33,12 +33,12 @@
33
33
  "tsup": "^6.3.0"
34
34
  },
35
35
  "scripts": {
36
- "typecheck": "tsc",
37
- "build": "tsup --minify",
36
+ "clean": "rimraf ./build",
38
37
  "dev": "tsup --watch --sourcemap",
39
- "clean": "rm -rf ./build",
40
- "test:jest": "../../node_modules/.bin/jest --config ./jest.config.ts",
41
- "test:eslint": "../../node_modules/.bin/eslint --ext .ts,.tsx ./src",
42
- "test:dev": "pnpm run test:jest --watch"
38
+ "test:eslint": "eslint --ext .ts,.tsx ./src",
39
+ "test:types": "tsc",
40
+ "test:lib": "jest --config ./jest.config.ts",
41
+ "test:lib:dev": "pnpm run test:lib --watch",
42
+ "build": "tsup --minify"
43
43
  }
44
44
  }