Skip to content

Baseline

Yuki edited this page Jul 13, 2026 · 2 revisions

Baseline

Baselines let existing projects adopt the detector gradually.

Create or Update a Baseline

npx i18n-smell-detector check \
  --config i18n-smell.config.mjs \
  --baseline .i18n-smell-baseline.json \
  --update-baseline

Use a Baseline

npx i18n-smell-detector check \
  --config i18n-smell.config.mjs \
  --baseline .i18n-smell-baseline.json

Issues found in the baseline are marked as ignored with reason baseline. New issues remain visible and can fail CI.

Include Ignored Issues

npx i18n-smell-detector check \
  --config i18n-smell.config.mjs \
  --baseline .i18n-smell-baseline.json \
  --include-ignored

Baseline Shape

{
  "version": 3,
  "issues": [
    {
      "id": "identical:zh:home.title",
      "key": "home.title",
      "targetLocale": "zh",
      "value": "Welcome back"
    },
    {
      "id": "placeholders:zh:user.greeting",
      "key": "user.greeting",
      "targetLocale": "zh",
      "value": "你好"
    },
    {
      "id": "hardcoded:v3:ba2ceaa5db551ba38603",
      "file": "src/components/UserPanel.vue",
      "line": 3,
      "column": 9,
      "value": "Account settings",
      "contextHash": "031ada8157f7057f5d5e",
      "relativeRange": { "start": 4, "end": 20 }
    }
  ]
}

Notes

  • Updating a baseline writes current non-ignored findings.
  • Stale baseline entries disappear when the baseline is updated.
  • Version 3 hardcoded fingerprints use normalized message content, finding kind, AST context, and a source anchor.
  • Absolute line, column, and file offsets are not part of v3 identity, so adding imports or blank lines does not invalidate entries.
  • Version 1 and version 2 baseline files remain readable. Updating a baseline rewrites it as version 3.

Clone this wiki locally