shipglot

parse-error

File cannot be parsed.

Default severity: error

What it checks

The file is not valid for its format (broken JSON, YAML, XML, PO or PHP syntax), so no key in it can be checked or loaded by the app. The location points at the first error the parser met.

The file's parser reports it while reading the file, before any comparison.

Example

A French JSON file cut off before its closing brace. Config used for both runs:

{
  "sourceLocale": "en",
  "files": [
    {
      "format": "next-intl-json",
      "path": "messages/{locale}.json"
    }
  ]
}

Fails

messages/en.json

{
  "title": "Welcome"
}

messages/fr.json

{
  "title": "Bienvenue"

Gate output

  • title
    missing in fr
    messages/en.json:2
  • Invalid JSON: closing brace expected (file ends unexpectedly)
    messages/fr.json:3

Passes

messages/en.json

{
  "title": "Welcome"
}

messages/fr.json

{
  "title": "Bienvenue"
}

Gate output

No parse-error finding.

Change its severity

{
  "checks": {
    "parse-error": "warning"
  }
}

Use "off" to disable it. To hide one finding, add "suppress": ["parse-error:key"]; a suppress rule that stops matching is reported so it can be removed.

All checks