@tanstack/eslint-plugin-query 5.65.0 → 5.66.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/dist/cjs/rules/exhaustive-deps/exhaustive-deps.utils.cjs +1 -6
- package/dist/cjs/rules/exhaustive-deps/exhaustive-deps.utils.cjs.map +1 -1
- package/dist/cjs/rules/exhaustive-deps/exhaustive-deps.utils.d.cts +0 -1
- package/dist/esm/rules/exhaustive-deps/exhaustive-deps.utils.d.ts +0 -1
- package/dist/esm/rules/exhaustive-deps/exhaustive-deps.utils.js +1 -6
- package/dist/esm/rules/exhaustive-deps/exhaustive-deps.utils.js.map +1 -1
- package/package.json +1 -1
- package/src/rules/exhaustive-deps/exhaustive-deps.utils.ts +1 -12
|
@@ -16,15 +16,10 @@ const ExhaustiveDepsUtils = {
|
|
|
16
16
|
})) {
|
|
17
17
|
return false;
|
|
18
18
|
}
|
|
19
|
-
return reference.identifier.name !== "undefined" && reference.identifier.parent.type !== utils.AST_NODE_TYPES.NewExpression && !ExhaustiveDepsUtils.isInstanceOfKind(reference.identifier.parent)
|
|
19
|
+
return reference.identifier.name !== "undefined" && reference.identifier.parent.type !== utils.AST_NODE_TYPES.NewExpression && !ExhaustiveDepsUtils.isInstanceOfKind(reference.identifier.parent);
|
|
20
20
|
},
|
|
21
21
|
isInstanceOfKind(node) {
|
|
22
22
|
return node.type === utils.AST_NODE_TYPES.BinaryExpression && node.operator === "instanceof";
|
|
23
|
-
},
|
|
24
|
-
isQueryClientReference(reference) {
|
|
25
|
-
var _a, _b, _c;
|
|
26
|
-
const declarator = (_b = (_a = reference.resolved) == null ? void 0 : _a.defs[0]) == null ? void 0 : _b.node;
|
|
27
|
-
return (declarator == null ? void 0 : declarator.type) === utils.AST_NODE_TYPES.VariableDeclarator && ((_c = declarator.init) == null ? void 0 : _c.type) === utils.AST_NODE_TYPES.CallExpression && declarator.init.callee.type === utils.AST_NODE_TYPES.Identifier && declarator.init.callee.name === "useQueryClient";
|
|
28
23
|
}
|
|
29
24
|
};
|
|
30
25
|
exports.ExhaustiveDepsUtils = ExhaustiveDepsUtils;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exhaustive-deps.utils.cjs","sources":["../../../../src/rules/exhaustive-deps/exhaustive-deps.utils.ts"],"sourcesContent":["import { AST_NODE_TYPES } from '@typescript-eslint/utils'\nimport { ASTUtils } from '../../utils/ast-utils'\nimport type { TSESLint, TSESTree } from '@typescript-eslint/utils'\n\nexport const ExhaustiveDepsUtils = {\n isRelevantReference(params: {\n sourceCode: Readonly<TSESLint.SourceCode>\n reference: TSESLint.Scope.Reference\n scopeManager: TSESLint.Scope.ScopeManager\n node: TSESTree.Node\n }) {\n const { sourceCode, reference, scopeManager, node } = params\n const component = ASTUtils.getFunctionAncestor(sourceCode, node)\n\n if (component === undefined) {\n return false\n }\n\n if (\n !ASTUtils.isDeclaredInNode({\n scopeManager,\n reference,\n functionNode: component,\n })\n ) {\n return false\n }\n\n return (\n reference.identifier.name !== 'undefined' &&\n reference.identifier.parent.type !== AST_NODE_TYPES.NewExpression &&\n !ExhaustiveDepsUtils.isInstanceOfKind(reference.identifier.parent)
|
|
1
|
+
{"version":3,"file":"exhaustive-deps.utils.cjs","sources":["../../../../src/rules/exhaustive-deps/exhaustive-deps.utils.ts"],"sourcesContent":["import { AST_NODE_TYPES } from '@typescript-eslint/utils'\nimport { ASTUtils } from '../../utils/ast-utils'\nimport type { TSESLint, TSESTree } from '@typescript-eslint/utils'\n\nexport const ExhaustiveDepsUtils = {\n isRelevantReference(params: {\n sourceCode: Readonly<TSESLint.SourceCode>\n reference: TSESLint.Scope.Reference\n scopeManager: TSESLint.Scope.ScopeManager\n node: TSESTree.Node\n }) {\n const { sourceCode, reference, scopeManager, node } = params\n const component = ASTUtils.getFunctionAncestor(sourceCode, node)\n\n if (component === undefined) {\n return false\n }\n\n if (\n !ASTUtils.isDeclaredInNode({\n scopeManager,\n reference,\n functionNode: component,\n })\n ) {\n return false\n }\n\n return (\n reference.identifier.name !== 'undefined' &&\n reference.identifier.parent.type !== AST_NODE_TYPES.NewExpression &&\n !ExhaustiveDepsUtils.isInstanceOfKind(reference.identifier.parent)\n )\n },\n isInstanceOfKind(node: TSESTree.Node) {\n return (\n node.type === AST_NODE_TYPES.BinaryExpression &&\n node.operator === 'instanceof'\n )\n },\n}\n"],"names":["ASTUtils","AST_NODE_TYPES"],"mappings":";;;;AAIO,MAAM,sBAAsB;AAAA,EACjC,oBAAoB,QAKjB;AACD,UAAM,EAAE,YAAY,WAAW,cAAc,KAAS,IAAA;AACtD,UAAM,YAAYA,SAAA,SAAS,oBAAoB,YAAY,IAAI;AAE/D,QAAI,cAAc,QAAW;AACpB,aAAA;AAAA,IAAA;AAIP,QAAA,CAACA,kBAAS,iBAAiB;AAAA,MACzB;AAAA,MACA;AAAA,MACA,cAAc;AAAA,IAAA,CACf,GACD;AACO,aAAA;AAAA,IAAA;AAGT,WACE,UAAU,WAAW,SAAS,eAC9B,UAAU,WAAW,OAAO,SAASC,MAAA,eAAe,iBACpD,CAAC,oBAAoB,iBAAiB,UAAU,WAAW,MAAM;AAAA,EAErE;AAAA,EACA,iBAAiB,MAAqB;AACpC,WACE,KAAK,SAASA,MAAAA,eAAe,oBAC7B,KAAK,aAAa;AAAA,EAAA;AAGxB;;"}
|
|
@@ -14,15 +14,10 @@ const ExhaustiveDepsUtils = {
|
|
|
14
14
|
})) {
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
|
-
return reference.identifier.name !== "undefined" && reference.identifier.parent.type !== AST_NODE_TYPES.NewExpression && !ExhaustiveDepsUtils.isInstanceOfKind(reference.identifier.parent)
|
|
17
|
+
return reference.identifier.name !== "undefined" && reference.identifier.parent.type !== AST_NODE_TYPES.NewExpression && !ExhaustiveDepsUtils.isInstanceOfKind(reference.identifier.parent);
|
|
18
18
|
},
|
|
19
19
|
isInstanceOfKind(node) {
|
|
20
20
|
return node.type === AST_NODE_TYPES.BinaryExpression && node.operator === "instanceof";
|
|
21
|
-
},
|
|
22
|
-
isQueryClientReference(reference) {
|
|
23
|
-
var _a, _b, _c;
|
|
24
|
-
const declarator = (_b = (_a = reference.resolved) == null ? void 0 : _a.defs[0]) == null ? void 0 : _b.node;
|
|
25
|
-
return (declarator == null ? void 0 : declarator.type) === AST_NODE_TYPES.VariableDeclarator && ((_c = declarator.init) == null ? void 0 : _c.type) === AST_NODE_TYPES.CallExpression && declarator.init.callee.type === AST_NODE_TYPES.Identifier && declarator.init.callee.name === "useQueryClient";
|
|
26
21
|
}
|
|
27
22
|
};
|
|
28
23
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exhaustive-deps.utils.js","sources":["../../../../src/rules/exhaustive-deps/exhaustive-deps.utils.ts"],"sourcesContent":["import { AST_NODE_TYPES } from '@typescript-eslint/utils'\nimport { ASTUtils } from '../../utils/ast-utils'\nimport type { TSESLint, TSESTree } from '@typescript-eslint/utils'\n\nexport const ExhaustiveDepsUtils = {\n isRelevantReference(params: {\n sourceCode: Readonly<TSESLint.SourceCode>\n reference: TSESLint.Scope.Reference\n scopeManager: TSESLint.Scope.ScopeManager\n node: TSESTree.Node\n }) {\n const { sourceCode, reference, scopeManager, node } = params\n const component = ASTUtils.getFunctionAncestor(sourceCode, node)\n\n if (component === undefined) {\n return false\n }\n\n if (\n !ASTUtils.isDeclaredInNode({\n scopeManager,\n reference,\n functionNode: component,\n })\n ) {\n return false\n }\n\n return (\n reference.identifier.name !== 'undefined' &&\n reference.identifier.parent.type !== AST_NODE_TYPES.NewExpression &&\n !ExhaustiveDepsUtils.isInstanceOfKind(reference.identifier.parent)
|
|
1
|
+
{"version":3,"file":"exhaustive-deps.utils.js","sources":["../../../../src/rules/exhaustive-deps/exhaustive-deps.utils.ts"],"sourcesContent":["import { AST_NODE_TYPES } from '@typescript-eslint/utils'\nimport { ASTUtils } from '../../utils/ast-utils'\nimport type { TSESLint, TSESTree } from '@typescript-eslint/utils'\n\nexport const ExhaustiveDepsUtils = {\n isRelevantReference(params: {\n sourceCode: Readonly<TSESLint.SourceCode>\n reference: TSESLint.Scope.Reference\n scopeManager: TSESLint.Scope.ScopeManager\n node: TSESTree.Node\n }) {\n const { sourceCode, reference, scopeManager, node } = params\n const component = ASTUtils.getFunctionAncestor(sourceCode, node)\n\n if (component === undefined) {\n return false\n }\n\n if (\n !ASTUtils.isDeclaredInNode({\n scopeManager,\n reference,\n functionNode: component,\n })\n ) {\n return false\n }\n\n return (\n reference.identifier.name !== 'undefined' &&\n reference.identifier.parent.type !== AST_NODE_TYPES.NewExpression &&\n !ExhaustiveDepsUtils.isInstanceOfKind(reference.identifier.parent)\n )\n },\n isInstanceOfKind(node: TSESTree.Node) {\n return (\n node.type === AST_NODE_TYPES.BinaryExpression &&\n node.operator === 'instanceof'\n )\n },\n}\n"],"names":[],"mappings":";;AAIO,MAAM,sBAAsB;AAAA,EACjC,oBAAoB,QAKjB;AACD,UAAM,EAAE,YAAY,WAAW,cAAc,KAAS,IAAA;AACtD,UAAM,YAAY,SAAS,oBAAoB,YAAY,IAAI;AAE/D,QAAI,cAAc,QAAW;AACpB,aAAA;AAAA,IAAA;AAIP,QAAA,CAAC,SAAS,iBAAiB;AAAA,MACzB;AAAA,MACA;AAAA,MACA,cAAc;AAAA,IAAA,CACf,GACD;AACO,aAAA;AAAA,IAAA;AAGT,WACE,UAAU,WAAW,SAAS,eAC9B,UAAU,WAAW,OAAO,SAAS,eAAe,iBACpD,CAAC,oBAAoB,iBAAiB,UAAU,WAAW,MAAM;AAAA,EAErE;AAAA,EACA,iBAAiB,MAAqB;AACpC,WACE,KAAK,SAAS,eAAe,oBAC7B,KAAK,aAAa;AAAA,EAAA;AAGxB;"}
|
package/package.json
CHANGED
|
@@ -29,8 +29,7 @@ export const ExhaustiveDepsUtils = {
|
|
|
29
29
|
return (
|
|
30
30
|
reference.identifier.name !== 'undefined' &&
|
|
31
31
|
reference.identifier.parent.type !== AST_NODE_TYPES.NewExpression &&
|
|
32
|
-
!ExhaustiveDepsUtils.isInstanceOfKind(reference.identifier.parent)
|
|
33
|
-
!ExhaustiveDepsUtils.isQueryClientReference(reference)
|
|
32
|
+
!ExhaustiveDepsUtils.isInstanceOfKind(reference.identifier.parent)
|
|
34
33
|
)
|
|
35
34
|
},
|
|
36
35
|
isInstanceOfKind(node: TSESTree.Node) {
|
|
@@ -39,14 +38,4 @@ export const ExhaustiveDepsUtils = {
|
|
|
39
38
|
node.operator === 'instanceof'
|
|
40
39
|
)
|
|
41
40
|
},
|
|
42
|
-
isQueryClientReference(reference: TSESLint.Scope.Reference) {
|
|
43
|
-
const declarator = reference.resolved?.defs[0]?.node
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
declarator?.type === AST_NODE_TYPES.VariableDeclarator &&
|
|
47
|
-
declarator.init?.type === AST_NODE_TYPES.CallExpression &&
|
|
48
|
-
declarator.init.callee.type === AST_NODE_TYPES.Identifier &&
|
|
49
|
-
declarator.init.callee.name === 'useQueryClient'
|
|
50
|
-
)
|
|
51
|
-
},
|
|
52
41
|
}
|