Change import

MSAL

Changes an import from one module/member to another, updating all type attributions.

org.openrewrite.javascript.change-import

Required

The module to change imports from

The member to change (or 'default' for default imports, '*' for namespace imports)

The module to change imports to

Optional

The new member name. If not specified, keeps the same member name.

The local name to bind the new member under. Defaults to the alias the import already had, or to the new member name where it had none.

mod run . --recipe=org.openrewrite.javascript.change-import \ -P oldModule=react-dom/test-utils \ -P oldMember=act \ -P newModule=react

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.