DenoDDeno
Powered by
vrugtehagelV
Denoβ€’2y ago
vrugtehagel

Deno fmt force `njk` content type for `.liquid` files

With the arrival of support for formatting Nunjucks in Deno 2, I would like to use this functionality to format
.liquid
.liquid
files (which are very similar in syntax). However, I'm struggling to get the
--ext
--ext
flag to work properly. It doesn't seem to recognize
njk
njk
as a possible value for
--ext
--ext
, but even if I use a recognized value, it says the target file is not found even though it exists. Note that it does work if my file has a
.njk
.njk
extension.
> cat test.liquid
<body>...</body>

> deno fmt --unstable-component --ext=njk test.liquid
error: invalid value 'njk' for '--ext <ext>'
  [possible values: ts, tsx, js, jsx, md, json, jsonc, css, scss, sass, less, html, svelte, vue, astro, yml, yaml, ipynb]

> deno fmt --unstable-component --ext=js test.liquid
error: No target files found.
> cat test.liquid
<body>...</body>

> deno fmt --unstable-component --ext=njk test.liquid
error: invalid value 'njk' for '--ext <ext>'
  [possible values: ts, tsx, js, jsx, md, json, jsonc, css, scss, sass, less, html, svelte, vue, astro, yml, yaml, ipynb]

> deno fmt --unstable-component --ext=js test.liquid
error: No target files found.

Is this a Deno bug? If not, what am I doing wrong?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

deno fmt vs prettier
Gary KGGary K / help
9mo ago
Deno fmt with verbatimModuleSyntax?
vicaryVvicary / help
3y ago