Sha256: dcccd7f1683c8f26ce1755d8dc6d47effec1b99f51532da2e6e093533fd6f1fd

Contents?: true

Size: 1.62 KB

Versions: 2

Compression:

Stored size: 1.62 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", "product": "Produit" }
  }
}
{% endschema %}
```

### ✓ Pass

```liquid
{% schema %}
{
  "locales": {
    "en": {
      "title": "Welcome",
      "product": "Product"
    },
    "fr": {
      "title": "Bienvenue",
      "product": "Produit"
    }
  }
}
{% 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

2 entries across 2 versions & 1 rubygems

Version Path
theme-check-1.15.0 docs/checks/schema_json_format.md
theme-check-1.14.0 docs/checks/schema_json_format.md