Find fs.rmdir() calls with the removed recursive option

Proprietary

Node.js 25 removed the recursive option of fs.rmdir(), fs.rmdirSync() and fs.promises.rmdir() (DEP0147), which now fail with ERR_INVALID_ARG_VALUE whenever it is passed, even as false. fs.rm() with recursive: true removes a directory tree the same way, but it is not an exact replacement: it deletes a file where fs.rmdir() failed with ENOTDIR, and with force: true, as Node.js suggests, it also ignores a missing path. So the calls are marked to be changed by hand. Only options written as an object literal are found.

org.openrewrite.node.migrate.fs.find-rmdir-recursive
mod run . --recipe=org.openrewrite.node.migrate.fs.find-rmdir-recursive

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