Skip to content

Commit aa17b17

Browse files
committed
fix: other apis for eslint v9
1 parent 48edece commit aa17b17

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = {
5050
*/
5151
create(context) {
5252
const options = context.options[0] || {};
53-
const filename = context.getFilename();
53+
const filename = context.filename || context.getFilename();
5454
const ruleName =
5555
filename === '<input>'
5656
? undefined

lib/utils.js

+3-1
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)