function markVariableAsUsed(context, name, node) {
  const sourceCode = context.getSourceCode()
  if (sourceCode.markVariableAsUsed) {
    sourceCode.markVariableAsUsed(name, node)
  } else {
    // This function does not use the given node, but the currently visited node.
    // If we need to determine the scope of a given node, we need to implement it yourself.
    context.markVariableAsUsed?.(name)
  }
}
Marks a variable with the given name in the current scope as used. This affects the no-unused-vars rule.
@param {RuleContext} context
@param {string} name
@param {ASTNode} node The node to get the current scope.