From 674dab9681be67f8290839e5fe3c63a036c9cf23 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Wed, 17 Dec 2025 21:15:30 +0000 Subject: [PATCH] fix(linter/plugins): fix indentation in error message (#17018) Follow-on after #15569. Just improve indentation in error message when user tries to use a reserved plugin name. --- .../custom_plugin_name_alias_reserved_name/output.snap.md | 2 +- apps/oxlint/test/fixtures/reserved_name/output.snap.md | 2 +- crates/oxc_linter/src/config/config_builder.rs | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/oxlint/test/fixtures/custom_plugin_name_alias_reserved_name/output.snap.md b/apps/oxlint/test/fixtures/custom_plugin_name_alias_reserved_name/output.snap.md index 7317811eceb00..5b19b9eb06393 100644 --- a/apps/oxlint/test/fixtures/custom_plugin_name_alias_reserved_name/output.snap.md +++ b/apps/oxlint/test/fixtures/custom_plugin_name_alias_reserved_name/output.snap.md @@ -17,7 +17,7 @@ Failed to parse configuration file. | Then reference rules using your alias: | | "rules": { - | "jsdoc-js/rule-name": "error" + | "jsdoc-js/rule-name": "error" | } | | See: https://oxc.rs/docs/guide/usage/linter/js-plugins.html diff --git a/apps/oxlint/test/fixtures/reserved_name/output.snap.md b/apps/oxlint/test/fixtures/reserved_name/output.snap.md index 991ebbd412da4..f20f98f869a71 100644 --- a/apps/oxlint/test/fixtures/reserved_name/output.snap.md +++ b/apps/oxlint/test/fixtures/reserved_name/output.snap.md @@ -17,7 +17,7 @@ Failed to parse configuration file. | Then reference rules using your alias: | | "rules": { - | "import-js/rule-name": "error" + | "import-js/rule-name": "error" | } | | See: https://oxc.rs/docs/guide/usage/linter/js-plugins.html diff --git a/crates/oxc_linter/src/config/config_builder.rs b/crates/oxc_linter/src/config/config_builder.rs index 9dad97cfed83d..9897de2d147f0 100644 --- a/crates/oxc_linter/src/config/config_builder.rs +++ b/crates/oxc_linter/src/config/config_builder.rs @@ -670,9 +670,7 @@ impl Display for ConfigBuilderError { \n\ Then reference rules using your alias:\n\ \n\ - \"rules\": {{\n\ - \"{plugin_name}-js/rule-name\": \"error\"\n\ - }}\n\ + \"rules\": {{\n \"{plugin_name}-js/rule-name\": \"error\"\n}}\n\ \n\ See: https://oxc.rs/docs/guide/usage/linter/js-plugins.html", )?;