summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
authorÓscar Otero <oom@oscarotero.com>2024-09-23 20:27:58 +0200
committerGitHub <noreply@github.com>2024-09-23 14:27:58 -0400
commit1287739ddfa659c0b2bd88930eb10e9469b59099 (patch)
tree3bb0e19efdb3e6fb822f09d12bb8a9c3460b1792 /tests/specs
parenta7ac89935b092f86245ce0370042f4bef14ad82d (diff)
feat(fmt): support vto and njk extensions (#25831)
Fixes #25802 markup_fmt plugin supports some HTML-like formats like Angular, Jinja, Twig, Nunjucks or Vento, that are not supported by `deno fmt`. This PR adds support for the extensions `njk` (Nunjucks) and `vto` (Vento). Angular doesn't have a custom extension (it uses `html` afaik) and Jinja and Twig are template engines written in Python and PHP respectively so it doesn't make sense to be supported by Deno.
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/fmt/njk/__test__.jsonc5
-rw-r--r--tests/specs/fmt/njk/badly_formatted.njk3
-rw-r--r--tests/specs/fmt/vento/__test__.jsonc5
-rw-r--r--tests/specs/fmt/vento/badly_formatted.vto3
4 files changed, 16 insertions, 0 deletions
diff --git a/tests/specs/fmt/njk/__test__.jsonc b/tests/specs/fmt/njk/__test__.jsonc
new file mode 100644
index 000000000..8b6bc87d4
--- /dev/null
+++ b/tests/specs/fmt/njk/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "tempDir": true,
+ "args": "fmt --unstable-component",
+ "output": "[WILDLINE]badly_formatted.njk\nChecked 1 file\n"
+} \ No newline at end of file
diff --git a/tests/specs/fmt/njk/badly_formatted.njk b/tests/specs/fmt/njk/badly_formatted.njk
new file mode 100644
index 000000000..71b0578d1
--- /dev/null
+++ b/tests/specs/fmt/njk/badly_formatted.njk
@@ -0,0 +1,3 @@
+<h1> {{ "Hello, world!" | upper }}
+ </h1>
+
diff --git a/tests/specs/fmt/vento/__test__.jsonc b/tests/specs/fmt/vento/__test__.jsonc
new file mode 100644
index 000000000..c3e3bbf7d
--- /dev/null
+++ b/tests/specs/fmt/vento/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "tempDir": true,
+ "args": "fmt --unstable-component",
+ "output": "[WILDLINE]badly_formatted.vto\nChecked 1 file\n"
+} \ No newline at end of file
diff --git a/tests/specs/fmt/vento/badly_formatted.vto b/tests/specs/fmt/vento/badly_formatted.vto
new file mode 100644
index 000000000..ad4644390
--- /dev/null
+++ b/tests/specs/fmt/vento/badly_formatted.vto
@@ -0,0 +1,3 @@
+<h1> {{ "Hello, world!" |> toUpperCase }}
+ </h1>
+