← All recipes
Moderne licensed

Remove unused fs-extra dependency

Recipe IDorg.openrewrite.node.migrate.fs-extra.remove-unused-fs-extra-dependencyArtifact@openrewrite/recipes-nodejs

Removes fs-extra and @types/fs-extra from each package.json whose package no longer references fs-extra from any JavaScript or TypeScript source, including vi.mock/jest.mock calls, __mocks__/fs-extra files, and /// <reference types="fs-extra" />. A reference anywhere beneath a package.json's directory keeps its dependencies, since a monorepo root hoists them for its workspaces. A package is left alone when any source beneath it failed to parse, or none was parsed at all. Lock files are not regenerated; run the package manager's install afterwards.

Single recipeProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.node.migrate.fs-extra.remove-unused-fs-extra-dependency

If the recipe isn’t available locally, install it with:

mod config recipes npm install @openrewrite/recipes-nodejs

Options

NameTypeDescription
accountForMigrationStringJudge library usage as it will be once the migration recipes have run, so the dependency is dropped in the same run. Only enable alongside those recipes, as the composite migration does.