Skip to content

Support prettier-ignore-start / prettier-ignore-end in Liquid templates #1150

@hayhaydz

Description

@hayhaydz

Is your feature request related to a problem? Please describe.
Currently, @shopify/prettier-plugin-liquid does not support prettier-ignore-start / prettier-ignore-end for range-based ignores. Only node-level {% # prettier-ignore %} comments are supported.
This makes it cumbersome to preserve intentional formatting or whitespace across larger sections of Liquid templates.

Describe the solution you'd like
Support standard Prettier range ignore comments:

<!-- prettier-ignore-start -->
<div class="custom-layout">
  {{ some_variable | complicated_filter: foo: bar }}
  {% render 'component', foo: bar %}
</div>
<!-- prettier-ignore-end -->

or

{% comment %} prettier-ignore-start {% endcomment %}
<div class="custom-layout">
  {{ some_variable | complicated_filter: foo: bar }}
  {% render 'component', foo: bar %}
</div>
{% comment %} prettier-ignore-end {% endcomment %}

Describe alternatives you've considered

  • Using {% # prettier-ignore %} before every node — works but is verbose and noisy.
  • Disabling formatting for the entire file via .prettierignore — too coarse-grained.

Checklist

  • I have checked and made sure that the proposal adheres to this plugin's principles

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions