diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d68d5278fe..798d56be795 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -91,6 +91,18 @@ if no error diagnostics are emitted. rome check --error-on-wanrings ./src ``` +- Add a configuration to enable parsing comments inside JSON files: + + ```json + { + "json": { + "parser": { + "allowComments": true + } + } + } + ``` + ### Editors #### Other changes @@ -99,9 +111,11 @@ if no error diagnostics are emitted. ### Formatter -- Added a new option called `--jsx-quote-style` to the formatter. This option allows you to choose between single and double quotes for JSX attributes. [#4486](https://github.com/rome/tools/issues/4486) +- Add a new option called `--jsx-quote-style` to the formatter. This option allows you to choose between single and double quotes for JSX attributes. [#4486](https://github.com/rome/tools/issues/4486) -- Added a new option called `--arrow-parentheses` to the formatter. This option allows you to set the parentheses style for arrow functions. [#4666](https://github.com/rome/tools/issues/4666) +- Add a new option called `--arrow-parentheses` to the formatter. This option allows you to set the parentheses style for arrow functions. [#4666](https://github.com/rome/tools/issues/4666) + +- The JSON formatter is now able to format `.json` files that have comments. ### Linter @@ -345,7 +359,17 @@ if no error diagnostics are emitted. } } ``` +- Add for parsing comments inside JSON files: + ```json + { + "json": { + "parser": { + "allowComments": true + } + } + } + ``` ### VSCode ### JavaScript APIs diff --git a/Cargo.lock b/Cargo.lock index 8eb3b6f1c1f..1d29440b4d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2075,6 +2075,7 @@ dependencies = [ "rome_json_syntax", "rome_parser", "rome_rowan", + "rome_suppression", "serde", "serde_json", "tests_macros", @@ -2215,6 +2216,15 @@ dependencies = [ "tracing", ] +[[package]] +name = "rome_suppression" +version = "0.0.1" +dependencies = [ + "rome_console", + "rome_diagnostics", + "rome_rowan", +] + [[package]] name = "rome_text_edit" version = "0.0.1" diff --git a/Cargo.toml b/Cargo.toml index 138a7f74b94..494d9522e29 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,6 +60,7 @@ rome_migrate = { path = "./crates/rome_migrate" } rome_parser = { version = "0.0.1", path = "./crates/rome_parser" } rome_rowan = { version = "0.0.1", path = "./crates/rome_rowan" } rome_service = { path = "./crates/rome_service" } +rome_suppression = { version = "0.0.1", path = "./crates/rome_suppression" } rome_text_edit = { version = "0.0.1", path = "./crates/rome_text_edit" } rome_text_size = { version = "0.0.1", path = "./crates/rome_text_size" } tests_macros = { path = "./crates/tests_macros" } diff --git a/crates/rome_cli/tests/snapshots/main_commands_format/ignore_comments_error_when_allow_comments.snap b/crates/rome_cli/tests/snapshots/main_commands_format/ignore_comments_error_when_allow_comments.snap index 8533db6ebd7..e2c875de6ae 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_format/ignore_comments_error_when_allow_comments.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_format/ignore_comments_error_when_allow_comments.snap @@ -18,17 +18,6 @@ expression: content /*test*/ [1, 2, 3] -``` - -# Termination Message - -```block -internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × No files were processed in the specified paths. - - - ``` # Emitted Messages @@ -36,7 +25,12 @@ internalError/io ━━━━━━━━━━━━━━━━━━━━━ ```block tsconfig.json format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Format with errors is disabled. + i Formatter would have printed the following content: + + 1 │ - + 2 1 │ /*test*/ [1, 2, 3] + 3 │ - → + 2 │ + ``` @@ -45,8 +39,4 @@ tsconfig.json format ━━━━━━━━━━━━━━━━━━━ Compared 1 file(s) in