NeoRu4 / prettier-plugin-jinja-json-template

1 stars 0 forks source link

file stays unchanged #3

Open kvadratikk opened 1 month ago

kvadratikk commented 1 month ago

hi! I have tried to use this plugin for "answers.json.jinja" file, but it stayed unchanged. could you help me please?

{
  "rootElement": {
    "type": "ScrollWrapper",
    "content": {
      "axis": "vertical",
      "content": {
        "type": "StackView",
        "content": {
          "axis": "vertical",
          "alignment": "fill",
          "children": [
            {% for question in questions %}
  {
    "type": "LabelView",
    "content": {
      "text": {
        "value": "{{ question.question }}",
        "typography": "HeadlineSmall",
        "multiline": true,
        "maxLineCount": 2147483647
      },
      "horizontalAlignment": "left"
    },
    "paddings": {
      "top": "xl",
      "bottom": "xxs",
      "left": "m",
      "right": "m"
    }
  },{
    "type": "LabelView",
    "content": {
      "text": {
        "value": "{{ question.answer }}",
        "typography": "ParagraphPrimaryMedium",
        "multiline": true,
        "maxLineCount": 2147483647
      },
      "horizontalAlignment": "left"
    },
    "paddings": {
      "top": "xxs",
      "bottom": "m",
      "left": "m",
      "right": "m"
    }
  },
{% endfor %}
            {
              "type": "Spacer",
              "content": {},
              "size": {
                "height": 16
              }
            }
          ]
        }
      }
    }
  }
}

if I use npx prettier answers.json.jinja --debug-check I get error

[error]     --> starting at object with constructor 'Object'
[error]     |     property '`~1~`' -> object with constructor 'Object'
[error]     --- property 'nodes' closes the circle
NeoRu4 commented 1 month ago

hi, i'll try to consider this case. json has a strict structure for parsing, so can be bugs.