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

JSON output inconsistent with Theme Check #201

Closed
nikitaourazbaev opened this issue Aug 4, 2023 · 1 comment
Closed

JSON output inconsistent with Theme Check #201

nikitaourazbaev opened this issue Aug 4, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@nikitaourazbaev
Copy link

nikitaourazbaev commented Aug 4, 2023

Describe the bug
The plugin formats the JSON inside a section’s schema, but the output differs from Theme Check so running both Prettier and Theme Check in a theme results in one formatter overwriting the other’s output.

Unformatted source

{% schema %}
{
  "name": "Test section",
  "disabled_on": {
    "groups": [
      "header",
      "footer"
    ]
  }
}
{% endschema %}

Expected output

{% schema %}
{
  "name": "Test section",
  "disabled_on": {
    "groups": [
      "header",
      "footer"
    ]
  }
}
{% endschema %}

Actual output

{% schema %}
{
  "name": "Test section",
  "disabled_on": {
    "groups": ["header", "footer"]
  }
}
{% endschema %}

Debugging information

  • macOS Ventura 13.5 (22G74)
  • Version 1.2.2

Additional context
I think this is due to this plugin using the json parser, maybe the json-stringify parser would produce results more in line with Theme Check? Example in a Prettier.io Playground.

Alternatively, a setting to disable JSON formatting and let Theme Check handle it would be nice to have.

Or is disabling Theme Check’s schema JSON formatting the better solution?

@nikitaourazbaev nikitaourazbaev added the bug Something isn't working label Aug 4, 2023
@charlespwd
Copy link
Collaborator

Acknowledged, but fixed in future version of theme-check (2.0) already running in the admin. The CLI/VS Code updates are coming soon, we're polishing things up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants