Replace namespace imports with named imports

Proprietary

Replaces a import * as ns from 'm' namespace import with named imports for the members read through it, rewriting each ns.member to the name it binds. Leaves a namespace the file passes or reads as an object of its own. Replicates the autofix of the ESLint rule import-x/no-namespace under its default options.

org.openrewrite.javascript.imports.NoNamespace
mod run . --recipe=org.openrewrite.javascript.imports.NoNamespace

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