Shopify / Shopify/theme-tools

Support prettier-ignore in jinja comments

Open
#1,236 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
234
Forks
92
Avg merge
1d 3h
Merged PRs (30d)
6

Description

Is your feature request related to a problem? Please describe.
I'd like to use a prettier-ignore statement in my Lektor jinja templates, but the example {% # prettier-ignore %} doesn't work for me: when compiling, the template the engine complains about # being an unexpected character.

Describe the solution you'd like
I tried using {# prettier-ignore #} but it doesn't work, even though {# #} seems like the currently supported method of inserting comments in jinja templates.

Describe alternatives you've considered
I found a workaround which consists of {# {% # prettier-ignore %} #} and works, but I hope you'll agree, is ugly as heck.

Checklist

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported parse error with {% # prettier-ignore %}, then compare it with {# prettier-ignore #} and the documented workaround. Trace the plugin's comment parsing and ignore handling, and add coverage showing that the supported Jinja comment form produces the intended ignore behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.