Skip to content

Commit e4759a7

Browse files
committed
fix: other apis for eslint v9
1 parent 5b85dc4 commit e4759a7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/rules/require-meta-docs-url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = {
5454
*/
5555
create(context) {
5656
const options = context.options[0] || {};
57-
const filename = context.getFilename();
57+
const filename = context.filename || context.getFilename();
5858
const ruleName =
5959
filename === '<input>'
6060
? undefined

lib/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,9 @@ module.exports = {
467467
isRuleTesterConstruction(declarator.init) &&
468468
declarator.id.type === 'Identifier'
469469
) {
470-
context.getDeclaredVariables(declarator).forEach((variable) => {
470+
(sourceCode.getDeclaredVariables || context.getDeclaredVariables)(
471+
declarator
472+
).forEach((variable) => {
471473
variable.references
472474
.filter((ref) => ref.isRead())
473475
.forEach((ref) => variableIdentifiers.add(ref.identifier));

0 commit comments

Comments
 (0)