Where Does lint-staged Store Its Config?
lint-staged reads its task list from the repo itself: package.json, a .lintstagedrc file, or a lint-staged.config.js.
Last updated
lint-staged has no global settings to lose. Configuration lives in the repo: a lint-staged key in package.json, a .lintstagedrc file, or a lint-staged.config.js for logic like thresholds. The hook in .husky/pre-commit just calls the binary; every real decision sits in those files.
Monorepos multiply the files instead of merging them. Each package can carry its own config, and a staged file answers only to the nearest one.
Where lint-staged stores this, by platform
[RepoDir]\.lintstagedrc.json
Usual home: .lintstagedrc.json at the root, or the lint-staged key in package.json. Per-package configs override the root for files inside that package.
[RepoDir]/.lintstagedrc.json
Same candidates (.lintstagedrc.json, package.json key, lint-staged.config.js). The .husky/pre-commit hook only invokes the runner; tasks come from these files.
[RepoDir]/.lintstagedrc.json
Same layout. CI often runs lint-staged --config explicitly, which disables discovery and errors out if the file is absent.
Frequently asked questions
My monorepo package tasks never run. What is wrong?
The closest config file to each staged file wins, and files are not merged. A package level .lintstagedrc.json that matches nothing means those files simply get no tasks.
How do I point lint-staged at a config in another folder?
Pass it explicitly with lint-staged --config <path>. When --config is given, no search happens and a missing file is a hard error instead of a silent fallback.
Notice an outdated path? Let us know.