diff --git a/lib/rules/require-meta-docs-url.js b/lib/rules/require-meta-docs-url.js index c4adc237..30433bc4 100644 --- a/lib/rules/require-meta-docs-url.js +++ b/lib/rules/require-meta-docs-url.js @@ -50,7 +50,7 @@ module.exports = { */ create(context) { const options = context.options[0] || {}; - const filename = context.getFilename(); + const filename = context.filename || context.getFilename(); const ruleName = filename === '' ? undefined diff --git a/lib/utils.js b/lib/utils.js index e33eda20..be617d31 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -467,7 +467,7 @@ module.exports = { isRuleTesterConstruction(declarator.init) && declarator.id.type === 'Identifier' ) { - context.getDeclaredVariables(declarator).forEach((variable) => { + (sourceCode.getDeclaredVariables || context.getDeclaredVariables)(declarator).forEach((variable) => { variable.references .filter((ref) => ref.isRead()) .forEach((ref) => variableIdentifiers.add(ref.identifier));