From d9b1f96897239bf7de8cdfd11d40e3f99bb29a4a Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Thu, 18 Feb 2021 22:01:32 +0530 Subject: feat: add json(c) support to deno fmt (#9292) This commit adds support for formatting JSON and JSONC in "deno fmt". New values "json" and "jsonc" are added to "--ext" flag for standard input processing. --- 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/formatted4.jsonc | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 cli/tests/fmt/formatted4.jsonc (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 7c1e471b9..5a4833dd4 100644 --- a/cli/tests/fmt/expected_fmt_check_formatted_files.out +++ b/cli/tests/fmt/expected_fmt_check_formatted_files.out @@ -1 +1 @@ -Checked 3 files +Checked 4 files diff --git a/cli/tests/fmt/expected_fmt_check_ignore.out b/cli/tests/fmt/expected_fmt_check_ignore.out index 158c556c2..7c1e471b9 100644 --- a/cli/tests/fmt/expected_fmt_check_ignore.out +++ b/cli/tests/fmt/expected_fmt_check_ignore.out @@ -1 +1 @@ -Checked 2 files +Checked 3 files diff --git a/cli/tests/fmt/expected_fmt_check_tests_dir.out b/cli/tests/fmt/expected_fmt_check_tests_dir.out index e2dc2b4ae..fe84cd485 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 6 not formatted files in [WILDCARD] files +error: Found 7 not formatted files in [WILDCARD] files diff --git a/cli/tests/fmt/formatted4.jsonc b/cli/tests/fmt/formatted4.jsonc new file mode 100644 index 000000000..f0f72a6ed --- /dev/null +++ b/cli/tests/fmt/formatted4.jsonc @@ -0,0 +1,4 @@ +{ + // Comment + "key": "value" +} -- cgit v1.2.3