Sha256: bebba2140a41b046c87f2d75f16bf8b1c337dbaad23bf9b00224b0a41c0694e5

Contents?: true

Size: 1.61 KB

Versions: 5

Compression:

Stored size: 1.61 KB

Contents

# 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

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

### ✓ Pass

```liquid
{% schema %}
{
  "locales": {
    "en": {
      "title": "Welcome",
      "missing": "Product"
    },
    "fr": {
      "title": "Bienvenue",
      "missing": "TODO"
    }
  }
}
{% endschema %}
```

## Options

The following example contains the default configuration for this check:

```yaml
SchemaJsonFormat:
  enabled: true
  severity: style
  start_level: 0
  indent: '  '
```

| Parameter | Description |
| --- | --- |
| enabled | Whether the check is enabled. |
| severity | The [severity](https://shopify.dev/themes/tools/theme-check/configuration#check-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

- [Rule source][codesource]
- [Documentation source][docsource]

[codesource]: /lib/theme_check/checks/schema_json_format.rb
[docsource]: /docs/checks/schema_json_format.md

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
theme-check-1.13.0 docs/checks/schema_json_format.md
theme-check-1.12.1 docs/checks/schema_json_format.md
theme-check-1.12.0 docs/checks/schema_json_format.md
theme-check-1.11.0 docs/checks/schema_json_format.md
theme-check-1.10.3 docs/checks/schema_json_format.md