Checks

Every built-in check of x18n check, with its default severity.

A check reads the project and reports diagnostics. A diagnostic is one reported issue with a code, a severity and optional fixes. x18n check runs every check, and the editor shows the same diagnostics.

The recommended set is every check that is not off below. Override the severity of a check in checks:

x18n.config.ts
import { defineConfig } from '@x18n/core'

export default defineConfig({
  checks: {
    'unused-key': 'error',
    'identical-to-source': 'warning',
    'key-style': ['warning', { case: 'camel' }],
  },
})

A severity is error, warning, info, hint or off. strict: true (or x18n check --strict) turns every warning into an error. ignoreKeys removes keys from every check.

CheckDefaultDescription
missing-keyerrorA usage whose key is not defined in the source locale.
invalid-syntaxerrorMessage syntax errors (ICU, linked messages, nesting).
placeholder-mismatcherrorTarget value placeholders differ from the source value.
key-conflicterrorA key that is both a leaf and a parent, or is duplicated across files of one locale.
missing-translationwarningA source-locale key that target locales lack. One diagnostic per key, at the source entry.
stale-translationwarningA translation that last changed before its source message, by the history providers (git).
empty-translationwarningA message with an empty string value.
redundant-translationwarningA message in a locale with a fallback that equals the message it falls back to, so it can be removed.
unused-keywarningA key with no usage, after keysInUse, derived keys and dynamic prefixes.
locale-code-conflictwarningLocale codes that differ only in spelling, such as zh_CN and zh-CN.
dynamic-keyoffA fully dynamic key that no check can follow.
identical-to-sourceoffA target value that equals the source value.
key-styleoffA key that does not match a naming rule (options: case, pattern).
hard-stringinfoA hard-coded string that should probably be a message. On with extract.autoDetect.
glossaryoffA glossary term translated differently from the glossary.
invalid-resourceerrorA locale file or source file that x18n failed to read, parse or scan.

The reporters of x18n check --reporter are pretty, json, markdown, github, sarif. See CLI and x18n check.