@@ -130,22 +130,34 @@ export default createEslintRule<Options, MESSAGE_ID>({
130
130
131
131
let shouldIgnore = false
132
132
if ( options . ignorePattern . length ) {
133
- let parent = getNodeParent ( node , [ 'VariableDeclarator' , 'Property' ] )
133
+ let varParent = getNodeParent ( node , [ 'VariableDeclarator' , 'Property' ] )
134
134
let parentId =
135
- parent ?. type === 'VariableDeclarator'
136
- ? parent . id
137
- : ( parent as TSESTree . Property | null ) ?. key
138
- let variableIdentifier =
135
+ varParent ?. type === 'VariableDeclarator'
136
+ ? varParent . id
137
+ : ( varParent as TSESTree . Property | null ) ?. key
138
+
139
+ let varIdentifier =
139
140
parentId ?. type === 'Identifier' ? parentId . name : null
140
141
141
- if (
142
- typeof variableIdentifier === 'string' &&
142
+ let checkMatch = ( identifier : string ) =>
143
143
options . ignorePattern . some ( pattern =>
144
- minimatch ( variableIdentifier , pattern , {
144
+ minimatch ( identifier , pattern , {
145
145
nocomment : true ,
146
146
} ) ,
147
147
)
148
- ) {
148
+
149
+ if ( typeof varIdentifier === 'string' && checkMatch ( varIdentifier ) ) {
150
+ shouldIgnore = true
151
+ }
152
+
153
+ let callParent = getNodeParent ( node , [ 'CallExpression' ] )
154
+ let callIdentifier =
155
+ callParent ?. type === 'CallExpression' &&
156
+ callParent . callee . type === 'Identifier'
157
+ ? callParent . callee . name
158
+ : null
159
+
160
+ if ( callIdentifier && checkMatch ( callIdentifier ) ) {
149
161
shouldIgnore = true
150
162
}
151
163
}
0 commit comments