Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Add support for .html files #182

Closed
1 task done
khoait opened this issue Apr 25, 2023 · 2 comments
Closed
1 task done

Add support for .html files #182

khoait opened this issue Apr 25, 2023 · 2 comments

Comments

@khoait
Copy link

khoait commented Apr 25, 2023

Is your feature request related to a problem? Please describe.

I'm trying to use the plugin for .html containing liquid. and I get the error

Extension 'Shopify Liquid' is configured as formatted but it cannot format 'HTML'-files

It would be nice if the plugin can support .html in addition to .liquid files.

Describe the solution you'd like

the plugin can format .html files in the same manner as .liquid files.

Describe alternatives you've considered
N/A

Checklist

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

Additional context
I'm using VS Code on Windows.

@aurelienbobenrieth
Copy link

Have you tried changing your VS Code user settings with:

  "[html]": {
    "editor.defaultFormatter": "Shopify.theme-check-vscode",
  }

Didn't try it myself though, just an idea.

@johnpuddephatt
Copy link

I was able to do this by adding the following to my .prettierrc.json:

{
  "plugins": ["@shopify/prettier-plugin-liquid"],
  "overrides": [
    {
      "files": "*.html",
      "options": {
        "parser": "liquid-html"
      }
    }
  ]
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants