From aab76514ee3e7e64620796f7958189a7f8977e26 Mon Sep 17 00:00:00 2001 From: Victorien Elvinger Date: Mon, 16 Oct 2023 14:08:43 +0200 Subject: [PATCH] refactor(lint/noUselessLoneBlockStatements): add fix kind metadata (#531) --- .../analyzers/nursery/no_useless_lone_block_statements.rs | 5 ++++- website/src/content/docs/linter/rules/index.mdx | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/biome_js_analyze/src/analyzers/nursery/no_useless_lone_block_statements.rs b/crates/biome_js_analyze/src/analyzers/nursery/no_useless_lone_block_statements.rs index 5199585c6ade..1d8a532e69b4 100644 --- a/crates/biome_js_analyze/src/analyzers/nursery/no_useless_lone_block_statements.rs +++ b/crates/biome_js_analyze/src/analyzers/nursery/no_useless_lone_block_statements.rs @@ -1,6 +1,8 @@ use crate::semantic_services::Semantic; use crate::JsRuleAction; -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, FixKind, Rule, RuleDiagnostic, +}; use biome_console::markup; use biome_diagnostics::Applicability; use biome_js_factory::make; @@ -47,6 +49,7 @@ declare_rule! { version: "next", name: "noUselessLoneBlockStatements", recommended: false, + fix_kind: FixKind::Unsafe, } } diff --git a/website/src/content/docs/linter/rules/index.mdx b/website/src/content/docs/linter/rules/index.mdx index 1af58882734a..7cccc92539de 100644 --- a/website/src/content/docs/linter/rules/index.mdx +++ b/website/src/content/docs/linter/rules/index.mdx @@ -219,7 +219,7 @@ Rules that belong to this group are not subject to semantic version⚠️ | | [noUnusedImports](/linter/rules/no-unused-imports) | Disallow unused imports. | 🔧 | | [noUselessElse](/linter/rules/no-useless-else) | Disallow else block when the if block breaks early. | ⚠️ | -| [noUselessLoneBlockStatements](/linter/rules/no-useless-lone-block-statements) | Disallow unnecessary nested block statements. | | +| [noUselessLoneBlockStatements](/linter/rules/no-useless-lone-block-statements) | Disallow unnecessary nested block statements. | ⚠️ | | [noVoid](/linter/rules/no-void) | Disallow the use of void operators, which is not a familiar operator. | | | [useAriaActivedescendantWithTabindex](/linter/rules/use-aria-activedescendant-with-tabindex) | Enforce that tabIndex is assigned to non-interactive HTML elements with aria-activedescendant. | | | [useArrowFunction](/linter/rules/use-arrow-function) | Use arrow functions over function expressions. | 🔧 |