X18N2001: No format for resource

No format for resource. Map the extension in `formats`, or add a format plugin.

Message

[X18N2001] No format for resource <detail>
├▶ fix: Map the extension in `formats`, or add a format plugin.
╰▶ see: https://x18n.antfu.dev/errors/x18n2001

The CLI prints the code and why the error happened, with details such as a file name or a field. The fix and a link to this page follow. With --json, the same parts are in errors of the envelope.

What to do

x18n found a locale file, but no format reads its extension.

  1. Map the extension to a format id in the config: formats: { lang: 'json' }.
  2. Or add a plugin that has a format for the extension.

x18n check reports this as an invalid-resource diagnostic on the file.

Exit code

The CLI exits with code 1.

Source