Where Does JSCPD Store Config and Baselines?
JSCPD reads thresholds and reporters from .jscpd.json in the project root, with reports written next to it.
Last updated
JSCPD configures through a .jscpd.json file in the scanned project: thresholds, min lines and tokens, ignore globs, reporters. A jscpd key in package.json or a --config path serve the same role when you prefer fewer dotfiles.
Reports land where you point them, defaulting to a report folder with jscpd-report files inside. Baselines deserve a commit alongside the config; generated HTML reports do not.
Where JSCPD stores this, by platform
[RepoDir]\.jscpd.json
Thresholds, reporters and ignores. Fallbacks in order: --config path, .jscpd.json here, .config/jscpd.json, package.json jscpd key. Baseline file .jscpd-baseline.json sits beside it.
[RepoDir]/.jscpd.json
Same discovery order. Reports default to ./report/ (override with --output); keep the baseline committed and the HTML output ignored.
[RepoDir]/.jscpd.json
Same layout. A root .jscpd.json always beats the .config/ location, so moving the file there is opt-in and safe for gradual migration.
Frequently asked questions
How do I stop JSCPD failing on legacy duplication?
Commit a .jscpd-baseline.json and run with --baseline plus --fail-on-new-clones. Old duplication passes silently while anything new fails the build.
My config seems ignored. How do I see what JSCPD actually uses?
Run jscpd --debug. It prints the merged CLI plus file config as JSON and exits, which shows exactly which file won and what values resulted.
Notice an outdated path? Let us know.