lingo purge
Preview target-file deletion and understand which lockfile entries it removes.
lingo purge is for intentionally removing derived target files. Normal file mode previews the selected paths; --yes performs deletion. With --file or --locale, it removes only the selected targets and their lockfile entries, keeping source baselines and other targets' entries. Without filters, it also removes the entire project lockfile.
Preview an ordinary target #
For a separate-file JSON layout:
lingo purge --locale de --file locales/en.jsonConfirm that the reported target is the intended disposable file. Preserve accepted output before adding --yes. If regeneration fails later, deletion has already happened.
| Option | Behavior |
|---|---|
--locale <locale> | Repeatable target filter; defaults to configured targets. Source locale is refused. |
--file <value> | Repeatable source-path filter or concrete source path for glob entries. |
--lockfile-only | Removes only .lingo/lock.json; requires --yes and cannot be combined with --file or --locale. |
--yes, -y | Performs deletion rather than file-mode preview. |
Derived paths outside the project root are refused, including paths that reach outside it or into .git through a symbolic link; purge reports them even without --yes. In-root files can still be valuable source or shared data, so inspect their meaning as well as their location.
File selection #
Purge derives paths from concrete configured sources and concrete --file values. It skips configured globs unless concrete source paths are supplied. For concrete config entries, --file filters by substring; it is not general glob expansion.
Purge skips a target whose path is the source path and reports that its translations live in the source file. Shared XCStrings catalogs use this layout, so purge cannot remove one locale from them. Use the String Catalog correction workflow instead.
Lockfile changes #
A filtered purge removes the selected target entries even if those target files are already missing. It retains the source hashes, so pending source changes can still reach other languages on a later push. If the lockfile is malformed, filtered purge stops before deleting any targets; restore or repair it before retrying.
Unfiltered lingo purge --yes and lingo purge --lockfile-only --yes remove the whole lockfile. Lockfile-only without --yes requires confirmation rather than producing the normal file preview.
A missing lock changes incremental planning; it does not guarantee fresh model output because server reuse is separate. For ordinary missing files, use backfill. For obsolete React entries, use clean. For interrupted work, begin with recovery while preserving available state.