Skip to content

Commit aa8af4d

Browse files
authored
fix(unbound-method): ignore functions passed to vi.mocked (#849)
1 parent de6f08f commit aa8af4d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎src/rules/unbound-method.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'
2-
import { createEslintRule, getAccessorValue } from '../utils'
2+
import { createEslintRule, getAccessorValue, isIdentifier } from '../utils'
33
import {
44
findTopMostCallExpression,
55
parseVitestFnCall,
@@ -75,6 +75,13 @@ export default createEslintRule<Options, MESSAGE_IDS>({
7575
context,
7676
)
7777

78+
if (
79+
vitestFnCall?.type === 'vitest' &&
80+
vitestFnCall.members.length >= 1 &&
81+
isIdentifier(vitestFnCall.members[0], 'mocked')
82+
)
83+
return
84+
7885
if (vitestFnCall?.type === 'expect') {
7986
const { matcher } = vitestFnCall
8087

0 commit comments

Comments
 (0)