baseline command inserts glot-disable-next-line comments to suppress existing hardcoded text warnings. This is useful when adopting glot in an existing project.
Usage
Options
Actually insert comments. Without this flag, glot runs in dry-run mode and
only shows what would be changed.
Rules to add disable comments for. Can be specified multiple times. If not specified, all rules are applied.Possible values:
hardcoded- Suppress hardcoded text warningsuntranslated- Suppress untranslated value warnings
Override the source code root directory. Defaults to the value from configuration file.
Override the messages directory path. Defaults to the value from configuration file.
Override the primary locale. Defaults to the value from configuration file.
Enable verbose output for debugging.
Why Use Baseline?
When adding glot to an existing project, you might have hundreds of hardcoded strings. Fixing them all at once isn’t practical. The baseline command lets you:- Suppress all existing warnings
- Start with a clean slate
- Prevent new hardcoded text from being added
- Gradually fix existing issues over time
Dry-Run Mode (Default)
Preview what comments would be inserted:Apply Changes
Insert the suppression comments:Result
Before:Workflow
Commit Changes
Commit the baseline to your repository:
bash git add -A git commit -m "chore: add glot baseline comments" Smart Behavior
The baseline command is smart about where it inserts comments:- Skips lines that already have translation function calls
- Places comments on the correct line for multiline JSX
- Handles JSX attributes correctly