@hua-labs/eslint-plugin-i18n
v0.1.1
Published
ESLint plugin for i18n type safety — missing keys, unused keys, raw text, dynamic keys
Maintainers
Readme
@hua-labs/eslint-plugin-i18n
ESLint plugin for i18n type safety — catch missing keys, hardcoded text, and dynamic key patterns at lint time.
Features
- no-missing-key — Detect t() keys not found in generated types
- no-raw-text — Catch CJK hardcoded text in JSX (Korean, Japanese, Chinese)
- no-dynamic-key — Warn on non-literal arguments to t() / tArray()
- no-unused-key — Placeholder rule for unused translation key detection
Installation
pnpm add @hua-labs/eslint-plugin-i18nPeer dependencies: eslint >=8.0.0
Quick Start
// eslint.config.js (flat config)
import i18nPlugin from '@hua-labs/eslint-plugin-i18n';
export default [
{
plugins: { i18n: i18nPlugin },
rules: {
'i18n/no-missing-key': ['error', {
generatedKeysPath: './types/i18n-types.generated.ts'
}],
'i18n/no-raw-text': ['warn', {
allowedTerms: ['HUA', 'Sum']
}],
'i18n/no-dynamic-key': 'warn',
},
},
];
API
| Export | Type | Description | |--------|------|-------------|
Related Packages
License
MIT — HUA Labs
