lingo clean
Remove obsolete JSONC catalog entries after confirming that their source messages are no longer used.
When a message leaves source code, extraction marks its catalog entry as orphaned. lingo clean removes those source entries and target keys no longer present in the active source set. It edits entries, not whole locale files, and does not translate missing values.
Confirm the removal first #
Run extraction and inspect its warnings and orphaned entries. A dynamic or destructured call can stop being recognized while the application still uses it. Fix that extraction problem instead of deleting the required message.
Preserve a recoverable diff before cleaning. The command immediately rewrites the source and all discovered target JSONC catalogs; there is no dry run, confirmation flag, or target-locale filter.
lingo clean --source-locale en--source-locale defaults to en. --out overrides configured i18n.messagesPath, then locales, relative to the project root. The source <locale>.jsonc must exist and be nonempty; otherwise the command fails and directs extraction first.
Complete catalog maintenance #
Read the reported source and per-target removal counts, then inspect the diff. Clean does not regenerate TypeScript declarations. Run extract and check with the same paths and source locale, followed by the application's checks.
Use purge for intentional target-file or baseline deletion. Use clean for orphaned catalog entries.