Skip to content
Fallow home
All docs pages

Migrating from jscpd

Move from jscpd to fallow: one command converts your jscpd config to fallow duplication settings. Learn what gets migrated and how detection modes map.

The fallow migrate command translates your jscpd configuration to the duplicates section of a fallow config. This page shows the steps, the field mapping, and the detection mode mapping.

Migration workflow

  1. Preview the migration

    Run fallow migrate --dry-run to see the generated config. The command writes no files.

    fallow migrate --dry-run

    fallow looks for .jscpd.json and the jscpd field in package.json.

  2. Generate the config

    When the preview looks correct, run the migration:

    fallow migrate            # Write .fallowrc.json
    fallow migrate --toml     # Or output as fallow.toml
  3. Review the config

    Open the generated config. Check the translated thresholds, token counts, and ignore patterns.

  4. Run fallow dupes

    Run your first duplication analysis:

    fallow dupes

What gets migrated

jscpdFallow
thresholdduplicates.threshold
minTokensduplicates.minTokens
minLinesduplicates.minLines
modeduplicates.mode (fallow warns that weak can differ)
skipLocalduplicates.skipLocal
ignoreduplicates.ignore
format-- (fallow auto-detects languages)

Detection mode mapping

jscpd v5 has strict, mild, and weak modes. For exact token matching, the closest fallow mode is strict.

Fallow uses mild mode by default. This mode normalizes syntax variations, so a migrated project can show clones that strict mode does not report. To report only exact token matches, use strict mode:

fallow dupes --mode strict

To also match clones with renamed variables, use semantic mode:

fallow dupes --mode semantic

Other analyses

The same binary runs the other fallow analyses:

fallow dead-code    # Unused code + circular deps + boundaries
fallow dupes        # Code duplication
fallow health       # Complexity hotspots + maintainability scores
fallow              # All of the above in one pass

See also