File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ module.exports = {
54
54
*/
55
55
create ( context ) {
56
56
const options = context . options [ 0 ] || { } ;
57
- const filename = context . getFilename ( ) ;
57
+ const filename = context . filename || context . getFilename ( ) ;
58
58
const ruleName =
59
59
filename === '<input>'
60
60
? 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