S
S
Sergiu Mitu2021-01-06 19:29:23
webstorm
Sergiu Mitu, 2021-01-06 19:29:23

How to run nunjucks file through prettier?

There is an index.njk file which is essentially the same html only with a different file extension. How can I format the code with prettier in such files?

Tried:

overrides:
  - files: "*.njk"
    options:
      parser: "html"

does not plow.

5ff5e552d8745424560773.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergiu Mitu, 2021-01-06
@EaGames

Oh .. actually

overrides:
  - files: "*.njk"
    options:
      parser: "html"

works if run through the command line, built-in webstorm just does not want to work with it.
But it doesn't matter, the nunjucks syntax messes up well, it works well with html.
For myself, the question is closed until adequate support for nunjucks appears in prettier, running it through the html parser does not make much sense, alas.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question