Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@hayhaydz

Description

@hayhaydz
Issue body actions

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
Reactions are currently unavailable

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.