Skip to main content
The baseline command inserts glot-disable-next-line comments to suppress existing hardcoded text and untranslated value issues. This is useful when adopting glot in an existing project.

Usage

Options

boolean
default:"false"
Actually insert comments. Without this flag, glot runs in dry-run mode and only shows what would be changed.
string[]
default:"all"
Rules to add disable comments for. Can be specified multiple times. If not specified, all rules are applied.Possible values:
  • hardcoded - Suppress hardcoded text issues
  • untranslated - Suppress untranslated value issues that have source usages
string
Override the source code root directory. Defaults to the value from configuration file.
string
Override the messages directory path. Defaults to the value from configuration file.
string
Override the primary locale. Defaults to the value from configuration file.
boolean
default:"false"
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:
  1. Suppress existing source-level issues
  2. Start with a clean slate
  3. Prevent new hardcoded text from being added
  4. Gradually fix existing issues over time
baseline --rules untranslated inserts source comments only for untranslated values that have source usages. Untranslated catalog values with no usage cannot be suppressed with source comments; translate them, remove unused keys, or configure severities.untranslated for a project-wide policy.

Dry-Run Mode (Default)

Preview what comments would be inserted:
Output:

Apply Changes

Insert the suppression comments:
Output:

Result

Before:
After:

Workflow

1

Run Baseline

Insert suppression comments for all existing hardcoded text:
2

Commit Changes

Commit the baseline to your repository: bash git add -A git commit -m "chore: add glot baseline comments"
3

Add to CI

Add glot check to your CI pipeline. New hardcoded text will be caught.
4

Gradually Fix

Over time, remove the suppression comments and add proper translations.

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

Directives

Learn about inline suppression directives

Check Command

Run i18n checks