Skip to content

Commit

Permalink
fix: other apis for eslint v9
Browse files Browse the repository at this point in the history
  • Loading branch information
aladdin-add committed Dec 8, 2023
1 parent 48edece commit aa17b17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rules/require-meta-docs-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 === '<input>'
? undefined
Expand Down
4 changes: 3 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,9 @@ 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));
Expand Down

0 comments on commit aa17b17

Please sign in to comment.