Shopify / prettier-plugin-liquid

Prettier Liquid/HTML plugin
https://npm.im/@shopify/prettier-plugin-liquid
MIT License
94 stars 15 forks source link

Add support for the `{% liquid %}` tag #94

Closed charlespwd closed 2 years ago

charlespwd commented 2 years ago

In this PR

Decisions:

Examples

It should parse tags properly and print them properly
printWidth: 1
{% liquid
  assign x = thing.property | filter1 | fitler2
  echo x | filter1 | filter2
  capture var
    if null
      echo true
    else
      echo false
    endif
  endcapture
  cycle 'one', 'two', 'three'
  for x in col reversed limit: 10
    echo x
  else
    echo 'nope'
  endfor

  form 'cart', cart
    echo 'huh?'
  endform

  increment i
  section 'string'
  layout 'string'
  paginate col by 10, window_size: 50
    render 'icon' with x as bar, foo: bar
  endpaginate
%}

Fixes #6