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
| Option | Description |
|---|---|
--no-clear | Do 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
| Code | Meaning |
|---|---|
0 | You stopped the watch with Ctrl+C. Fallow prints Watch stopped. |
2 | The 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
Related
fallow dead-code: run the same analysis once.fallow fix: remove the unused code that the analysis finds.- VS Code extension: findings in the editor while you type.