File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ module.exports = {
50
50
*/
51
51
create ( context ) {
52
52
const options = context . options [ 0 ] || { } ;
53
- const filename = context . getFilename ( ) ;
53
+ const filename = context . filename || context . getFilename ( ) ;
54
54
const ruleName =
55
55
filename === '<input>'
56
56
? undefined
Original file line number Diff line number Diff line change @@ -467,7 +467,9 @@ module.exports = {
467
467
isRuleTesterConstruction ( declarator . init ) &&
468
468
declarator . id . type === 'Identifier'
469
469
) {
470
- context . getDeclaredVariables ( declarator ) . forEach ( ( variable ) => {
470
+ ( sourceCode . getDeclaredVariables || context . getDeclaredVariables ) (
471
+ declarator
472
+ ) . forEach ( ( variable ) => {
471
473
variable . references
472
474
. filter ( ( ref ) => ref . isRead ( ) )
473
475
. forEach ( ( ref ) => variableIdentifiers . add ( ref . identifier ) ) ;
You can’t perform that action at this time.
0 commit comments