【问题标题】:How to validate JSON in Shopify Liquid templates in VS Code?如何在 VS Code 中验证 Shopify Liquid 模板中的 JSON?
【发布时间】:2022-01-16 01:41:10
【问题描述】:

最近有一个错误是由于 Shopify Liquid 模板中下面缺少逗号引起的:

{% schema %}
  {
    ...
    "settings": [
      {
        "type": "header",
        "content": "Content"
      }
      {
        "type": "text",
        "id": "title",
        "label": "Title"
      }
    ],
    ...
  }
{% endschema %}

有没有办法在 VS Code 中自动显示红色波浪线以指示 JSON 格式错误?我尝试将此添加到我的用户设置中,但没有运气:

    "eslint.validate": [
      "javascript",
      "javascriptreact",
      { "language": "liquid" }
    ]

我安装了 ESLint 和 Liquid (Neil Ding) 扩展。

【问题讨论】:

    标签: shopify eslint liquid shopify-template


    【解决方案1】:

    Shopify 有一些工具,你应该安装 theme check and shopify cli

    【讨论】:

    • 安装此扩展会产生一千个错误和警告,但没有一个是针对 Liquid 模板中的格式错误的 JSON :(.
    猜你喜欢
    • 2017-03-28
    • 1970-01-01
    • 2022-12-18
    • 1970-01-01
    • 1970-01-01
    • 2021-12-20
    • 2015-06-22
    • 2020-10-01
    • 1970-01-01
    相关资源
    最近更新 更多