Generates a JSON schema from i18n-tagged template literals in a JavaScript project for translation key validation and autocompletion in JSON translation files. Version 2.5.0 is stable, with regular releases (semantic-release). Key differentiators: detects template literals tagged with i18n from es2015-i18n-tag, supports custom translation groups, file module groups, export of translation keys, and built-in JSON validator for coverage. Ships TypeScript types and works with Node >= 8.10.
npm install i18n-tag-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Generates a JSON schema from i18n-tagged literals in project and validates a translation file for coverage.
Ensure all translation strings use i18n`...` syntax from the es2015-i18n-tag package.
Use __translationGroup = 'groupName' in your source files instead of passing customTranslationGroups to generateSchema.
Set rootPath to the root of your source code (e.g., 'src' or '.'). The tool resolves __translationGroup relative to rootPath.
Use validateTranslationFile() to compare schema keys against an actual JSON translation file.
Use async/await or .then() when calling generateSchema(). For Node 8+, update to latest.
Use 'npx i18n-tag-schema generate' or update scripts.
Pass an object with 'file' property for output destination.
Use 'const { generateSchema } = require('i18n-tag-schema');' or switch to ESM import.Run 'npm install glob' to install it as a dependency.
Ensure you have i18n`...` literals in your code and set rootPath correctly (e.g., './src').
Add the missing 'community.name' key to your translation JSON.
Ensure your project uses ES2015+ syntax and Node >= 8.10.