WindowsmacOSLinux

Where Does Depcheck Store Its Config?

Depcheck reads ignore rules from a .depcheckrc file next to package.json, with CLI flags winning on conflict.

Last updated

Depcheck needs no config for a first run: point it at a folder and it compares imports against package.json. A .depcheckrc file next to package.json records the lasting decisions (ignored packages, skip-missing) so the whole team shares them.

The file accepts YAML, JSON or JavaScript, with .json, .yaml and .yml variants recognized. Anything passed as a CLI flag overrides the file for that run only.

Where Depcheck stores this, by platform

Windows
[RepoDir]\.depcheckrc

Ignore rules and flags in YAML, JSON or JS form (.depcheckrc.json/.yaml/.yml also work). CLI arguments override this file and are never saved into it.

macOS
[RepoDir]/.depcheckrc

Same file next to package.json. A custom path works via depcheck --config <file>, which is handy for testing rules without touching the committed file.

Linux
[RepoDir]/.depcheckrc

Same layout. The directory argument defaults to the current folder, so run from the package root or the rc file is never found.

Frequently asked questions

How do I stop depcheck flagging a false positive?

Add the pattern to the ignores list in .depcheckrc. CLI flags beat the file on any conflict, so a passing --ignores on the command line is not stored anywhere.

Notice an outdated path? Let us know.