function findVariableByName(context, node, name) {
  const variable = getVariableFromContext(context, node, name);

  if (!variable || !variable.defs[0] || !variable.defs[0].node) {
    return null;
  }

  if (variable.defs[0].node.type === 'TypeAlias') {
    return variable.defs[0].node.right;
  }

  if (variable.defs[0].type === 'ImportBinding') {
    return variable.defs[0].node;
  }

  return variable.defs[0].node.init;
}
Find a variable by name in the current scope.
@param {Object} context The current rule context.
@param {ASTNode} node The node to check. Must be an Identifier node.
@param  {string} name Name of the variable to look for.
@returns {ASTNode|null} Return null if the variable could not be found, ASTNode otherwise.