Skip to content

Commit

Permalink
fix: update rule to work with eslint v9
Browse files Browse the repository at this point in the history
  • Loading branch information
ravijayaramappa committed Jan 3, 2025
1 parent 0e46c58 commit ab05a03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rules/valid-apex-method-invocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = {
},

create(context) {
const sourceCode = context.sourceCode ?? context.getSourceCode();
function isApexMethodReference(variable) {
const [def] = variable.defs;

Expand Down Expand Up @@ -98,7 +99,7 @@ module.exports = {
}

// Retrieve the callee reference from the current scope.
const scope = context.getScope();
const scope = sourceCode.getScope ? sourceCode.getScope(node) : context.getScope();
const methodReference = scope.references.find((r) => r.identifier === callee);

// Ignore the call expression if it can't be resolved from the current scope or if the
Expand Down

0 comments on commit ab05a03

Please sign in to comment.