We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 794d6bd commit c068394Copy full SHA for c068394
1 file changed
eslint-plugin-epic-web.js
@@ -86,7 +86,18 @@ function getHookName(node) {
86
const callPath = getCallPath(node)
87
if (!callPath || callPath.length === 0) return null
88
const lastSegment = callPath.at(-1)
89
- return HOOK_NAMES.has(lastSegment) ? lastSegment : null
+ if (!HOOK_NAMES.has(lastSegment)) return null
90
+
91
+ if (callPath.length === 1) return lastSegment
92
93
+ if (
94
+ callPath.length === 2 &&
95
+ (TEST_CALL_ROOTS.has(callPath[0]) || SUITE_CALL_ROOTS.has(callPath[0]))
96
+ ) {
97
+ return lastSegment
98
+ }
99
100
+ return null
101
}
102
103
function isFunctionNode(node) {
0 commit comments