Skip to content
Fallow home
All docs pages

Docs home

fallow watch

fallow watch runs the dead-code analysis again each time a source file or a config file changes.

Run the dead-code analysis again each time a source file or a config file changes.

For the findings of the analysis, read Dead code.

Synopsis

fallow watch [OPTIONS]

Options

OptionDescription
--no-clearDo not clear the screen between re-analyses

The global options are in these groups: Project, Output, Scope, Baselines, Gates, Duplication, Type-aware, Performance.

Fallow analyzes the project once at the start. Then it waits 500 ms after the last change, and analyzes again. A change to a source file, package.json, tsconfig.json, a workspace manifest (pnpm-workspace.yaml, deno.json or deno.jsonc) or a fallow config file starts a run. Fallow also watches a config that --config selects outside the project, and reloads when an editor replaces that file. Fallow skips the files that .gitignore or ignorePatterns ignores. Press Ctrl+C to stop.

The global options apply, for example --production, --format and --quiet. The issue type filters of fallow dead-code, for example --unused-exports, do not apply.

Output

Each run prints the report of fallow dead-code in the format that --format selects. Before a new run, fallow prints the changed files after Changed:. After each run, fallow prints Watching for changes... (press Ctrl+C to stop) on stderr. Fallow clears the screen before each run when stderr is a terminal, except with --no-clear.

Exit codes

CodeMeaning
0You stopped the watch with Ctrl+C. Fallow prints Watch stopped.
2The first analysis, the config or the file watcher failed.

After the first run, a failed analysis does not stop the watch. Fallow prints Watch analysis failed; continuing to watch for changes.

Examples

# Watch the project
fallow watch

# Watch only the production code
fallow watch --production

# Keep the output of each run on the screen
fallow watch --no-clear