@tanstack/eslint-plugin-query
Advanced tools
Comparing version 5.61.4 to 5.61.6
@@ -77,7 +77,10 @@ import { ESLintUtils, AST_NODE_TYPES } from "@typescript-eslint/utils"; | ||
const existingKeys = ASTUtils.getNestedIdentifiers(queryKeyNode).map( | ||
(identifier) => ASTUtils.mapKeyNodeToText(identifier, context.sourceCode) | ||
(identifier) => ASTUtils.mapKeyNodeToBaseText(identifier, context.sourceCode) | ||
); | ||
const missingRefs = relevantRefs.map((ref) => ({ | ||
ref, | ||
text: ASTUtils.mapKeyNodeToText(ref.identifier, context.sourceCode) | ||
text: ASTUtils.mapKeyNodeToBaseText( | ||
ref.identifier, | ||
context.sourceCode | ||
) | ||
})).filter(({ ref, text }) => { | ||
@@ -84,0 +87,0 @@ return !ref.isTypeReference && !ASTUtils.isAncestorIsCallee(ref.identifier) && !existingKeys.some((existingKey) => existingKey === text) && !existingKeys.includes(text.split(/[?.]/)[0] ?? ""); |
@@ -29,2 +29,3 @@ import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; | ||
mapKeyNodeToText(node: TSESTree.Node, sourceCode: Readonly<TSESLint.SourceCode>): string; | ||
mapKeyNodeToBaseText(node: TSESTree.Node, sourceCode: Readonly<TSESLint.SourceCode>): string; | ||
isValidReactComponentOrHookName(identifier: TSESTree.Identifier | null | undefined): boolean; | ||
@@ -31,0 +32,0 @@ getFunctionAncestor(sourceCode: Readonly<TSESLint.SourceCode>, node: TSESTree.Node): TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | undefined; |
@@ -156,2 +156,3 @@ import { AST_NODE_TYPES } from "@typescript-eslint/utils"; | ||
AST_NODE_TYPES.MemberExpression, | ||
AST_NODE_TYPES.TSNonNullExpression, | ||
AST_NODE_TYPES.Identifier | ||
@@ -161,2 +162,8 @@ ]) | ||
}, | ||
mapKeyNodeToBaseText(node, sourceCode) { | ||
return ASTUtils.mapKeyNodeToText(node, sourceCode).replace( | ||
/(\?\.|!\.)/g, | ||
"." | ||
); | ||
}, | ||
isValidReactComponentOrHookName(identifier) { | ||
@@ -163,0 +170,0 @@ return identifier !== null && identifier !== void 0 && /^(use|[A-Z])/.test(identifier.name); |
{ | ||
"name": "@tanstack/eslint-plugin-query", | ||
"version": "5.61.4", | ||
"version": "5.61.6", | ||
"description": "ESLint plugin for TanStack Query", | ||
@@ -5,0 +5,0 @@ "author": "Eliya Cohen", |
@@ -105,3 +105,3 @@ import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils' | ||
(identifier) => | ||
ASTUtils.mapKeyNodeToText(identifier, context.sourceCode), | ||
ASTUtils.mapKeyNodeToBaseText(identifier, context.sourceCode), | ||
) | ||
@@ -112,3 +112,6 @@ | ||
ref: ref, | ||
text: ASTUtils.mapKeyNodeToText(ref.identifier, context.sourceCode), | ||
text: ASTUtils.mapKeyNodeToBaseText( | ||
ref.identifier, | ||
context.sourceCode, | ||
), | ||
})) | ||
@@ -115,0 +118,0 @@ .filter(({ ref, text }) => { |
@@ -227,2 +227,3 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils' | ||
AST_NODE_TYPES.MemberExpression, | ||
AST_NODE_TYPES.TSNonNullExpression, | ||
AST_NODE_TYPES.Identifier, | ||
@@ -232,2 +233,11 @@ ]), | ||
}, | ||
mapKeyNodeToBaseText( | ||
node: TSESTree.Node, | ||
sourceCode: Readonly<TSESLint.SourceCode>, | ||
) { | ||
return ASTUtils.mapKeyNodeToText(node, sourceCode).replace( | ||
/(\?\.|!\.)/g, | ||
'.', | ||
) | ||
}, | ||
isValidReactComponentOrHookName( | ||
@@ -234,0 +244,0 @@ identifier: TSESTree.Identifier | null | undefined, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
252285
3153