Skip to content

TypeScript API

Yuki edited this page Jul 13, 2026 · 2 revisions

TypeScript API

The package publishes declaration files and exports a small public API from the package root.

import { checkIdenticalTranslations, severityRank } from 'i18n-smell-detector';
import type { CheckResult, DetectorConfigInput, DetectorIssue } from 'i18n-smell-detector';

Core Types

Useful public types include:

  • DetectorConfigInput
  • DetectorConfig
  • DetectorIssue
  • IdenticalIssue
  • PlaceholderIssue
  • HardcodedIssue
  • CheckResult
  • ReportFormat
  • Severity
  • Confidence
  • HardcodedCategory
  • DoNotTranslateRule
  • IssueSuppression
  • MessageInterpolation
  • SourcePosition
  • SourceRange

Integration Guidance

Prefer consuming the public package root instead of importing internal files.

Use CLI JSON output when your integration only needs results:

npx i18n-smell-detector check --format json --fail-on none

Use the TypeScript API when your integration needs to call a specific checker or share detector types.

The issue shape is intended to stay stable enough for reports, baselines, and editor integrations.

Clone this wiki locally