79378386

Date: 2025-01-22 15:47:10
Score: 2.5
Natty:
Report link

You can do this easily with path.scope.rename.

In you case it would be something like:

FunctionDeclaration(path) {
            path.scope.rename("x", "a");
          }

See https://github.com/jamiebuilds/babel-handbook/blob/master/translations/en/plugin-handbook.md#toc-rename-a-binding-and-its-references

Reasons:
  • Probably link only (1):
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Hillel Mermelstein