Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Latest commit

 

History

History
76 lines (58 loc) · 1.62 KB

schema_json_format.md

File metadata and controls

76 lines (58 loc) · 1.62 KB

Prevent unformatted schema tags (SchemaJsonFormat)

Version 1.9.0+

This check exists to ensure the JSON in your schemas is pretty.

It exists as a facilitator for its auto-correction. This way you can right-click fix the problem.

Examples

The following examples contain code snippets that either fail or pass this check.

✗ Fail

{% schema %}
{
  "locales": {
"en": {
  "title": "Welcome", "product": "Product"
},
          "fr": { "title": "Bienvenue", "product": "Produit" }
  }
}
{% endschema %}

✓ Pass

{% schema %}
{
  "locales": {
    "en": {
      "title": "Welcome",
      "product": "Product"
    },
    "fr": {
      "title": "Bienvenue",
      "product": "Produit"
    }
  }
}
{% endschema %}

Options

The following example contains the default configuration for this check:

SchemaJsonFormat:
  enabled: true
  severity: style
  start_level: 0
  indent: '  '
Parameter Description
enabled Whether the check is enabled.
severity The severity of the check.
start_level The indentation level. If you prefer an indented schema, set this to 1.
indent The character(s) used for indentation levels.

Disabling this check

This check is safe to disable. You might want to disable this check if you do not care about the visual appearance of your schema tags.

Resources