From 16036a8a5170030a95a56b28b29b1b355d0d0f80 Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Tue, 19 Jan 2021 23:09:35 +0530 Subject: feat: add markdown support to deno fmt (#8887) This commit adds support for formatting markdown files with "deno fmt". Additionally "--ext={js|jsx|ts|tsx|md}" flag was added to "deno fmt" that allows to specify file type when providing contents over stdio. --- cli/tests/fmt/expected_fmt_check_formatted_files.out | 2 +- cli/tests/fmt/expected_fmt_check_ignore.out | 2 +- cli/tests/fmt/expected_fmt_check_tests_dir.out | 2 +- cli/tests/fmt/formatted3.md | 17 +++++++++++++++++ 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 cli/tests/fmt/formatted3.md (limited to 'cli/tests/fmt') diff --git a/cli/tests/fmt/expected_fmt_check_formatted_files.out b/cli/tests/fmt/expected_fmt_check_formatted_files.out index 158c556c2..7c1e471b9 100644 --- a/cli/tests/fmt/expected_fmt_check_formatted_files.out +++ b/cli/tests/fmt/expected_fmt_check_formatted_files.out @@ -1 +1 @@ -Checked 2 files +Checked 3 files diff --git a/cli/tests/fmt/expected_fmt_check_ignore.out b/cli/tests/fmt/expected_fmt_check_ignore.out index c05ac45a1..158c556c2 100644 --- a/cli/tests/fmt/expected_fmt_check_ignore.out +++ b/cli/tests/fmt/expected_fmt_check_ignore.out @@ -1 +1 @@ -Checked 1 file +Checked 2 files diff --git a/cli/tests/fmt/expected_fmt_check_tests_dir.out b/cli/tests/fmt/expected_fmt_check_tests_dir.out index 00d7cb3fa..e2dc2b4ae 100644 --- a/cli/tests/fmt/expected_fmt_check_tests_dir.out +++ b/cli/tests/fmt/expected_fmt_check_tests_dir.out @@ -1,2 +1,2 @@ [WILDCARD] -error: Found 5 not formatted files in [WILDCARD] files +error: Found 6 not formatted files in [WILDCARD] files diff --git a/cli/tests/fmt/formatted3.md b/cli/tests/fmt/formatted3.md new file mode 100644 index 000000000..e6e616584 --- /dev/null +++ b/cli/tests/fmt/formatted3.md @@ -0,0 +1,17 @@ +# Hello + +```js +function foo() { + return 42; +} + +foo(); +``` + +```ts +function bar(): number { + return 42; +} + +bar(); +``` -- cgit v1.2.3