From 3c8ac3bcb3cfa79aad845e17d3280ba4113165cf Mon Sep 17 00:00:00 2001 From: ekusiadadus Date: Thu, 7 Sep 2023 10:24:19 +0900 Subject: [PATCH] refactor: format with `cargo format` --- crates/biome_lsp/src/session.rs | 2 +- crates/biome_test_utils/src/lib.rs | 2 +- crates/rome_cli/src/execute/migrate.rs | 2 +- crates/rome_js_analyze/src/analyzers/a11y/no_access_key.rs | 4 +++- crates/rome_js_analyze/src/analyzers/a11y/no_auto_focus.rs | 4 +++- .../src/analyzers/complexity/no_extra_boolean_cast.rs | 4 +++- .../no_multiple_spaces_in_regular_expression_literals.rs | 4 +++- .../src/analyzers/complexity/no_useless_constructor.rs | 4 +++- .../src/analyzers/complexity/use_literal_keys.rs | 4 +++- .../src/analyzers/complexity/use_optional_chain.rs | 4 +++- .../src/analyzers/complexity/use_simple_number_keys.rs | 4 +++- .../analyzers/complexity/use_simplified_logic_expression.rs | 4 +++- .../src/analyzers/correctness/no_unnecessary_continue.rs | 4 +++- .../src/analyzers/correctness/no_unreachable.rs | 2 +- .../src/analyzers/nursery/no_excessive_complexity.rs | 2 +- .../src/analyzers/nursery/no_nonoctal_decimal_escape.rs | 4 +++- .../src/analyzers/nursery/no_useless_empty_export.rs | 4 +++- .../src/analyzers/nursery/use_collapsed_else_if.rs | 4 +++- .../src/analyzers/nursery/use_grouped_type_import.rs | 4 +++- .../rome_js_analyze/src/analyzers/performance/no_delete.rs | 4 +++- .../src/analyzers/style/no_implicit_boolean.rs | 4 +++- .../src/analyzers/style/no_inferrable_types.rs | 4 +++- .../rome_js_analyze/src/analyzers/style/no_negation_else.rs | 4 +++- .../src/analyzers/style/no_non_null_assertion.rs | 4 +++- .../src/analyzers/style/use_self_closing_elements.rs | 4 +++- .../src/analyzers/style/use_shorthand_array_type.rs | 4 +++- .../src/analyzers/style/use_single_case_statement.rs | 4 +++- .../src/analyzers/style/use_single_var_declarator.rs | 4 +++- crates/rome_js_analyze/src/analyzers/style/use_template.rs | 4 +++- crates/rome_js_analyze/src/analyzers/style/use_while.rs | 4 +++- .../src/analyzers/suspicious/no_comment_text.rs | 4 +++- .../src/analyzers/suspicious/no_compare_neg_zero.rs | 4 +++- .../rome_js_analyze/src/analyzers/suspicious/no_debugger.rs | 4 +++- .../src/analyzers/suspicious/no_double_equals.rs | 4 +++- .../src/analyzers/suspicious/no_redundant_use_strict.rs | 4 +++- .../src/analyzers/suspicious/no_sparse_array.rs | 4 +++- .../src/analyzers/suspicious/no_unsafe_negation.rs | 4 +++- .../src/analyzers/suspicious/use_namespace_keyword.rs | 4 +++- .../src/analyzers/suspicious/use_valid_typeof.rs | 4 +++- crates/rome_js_analyze/src/options.rs | 2 +- .../nursery/use_exhaustive_dependencies.rs | 2 +- .../src/semantic_analyzers/nursery/use_naming_convention.rs | 2 +- .../src/semantic_analyzers/style/no_restricted_globals.rs | 2 +- crates/rome_js_analyze/tests/spec_tests.rs | 2 +- crates/rome_js_transform/tests/spec_tests.rs | 2 +- crates/rome_json_analyze/tests/spec_tests.rs | 2 +- crates/rome_service/src/configuration/mod.rs | 2 +- crates/rome_service/src/file_handlers/javascript.rs | 2 +- crates/rome_service/src/file_handlers/mod.rs | 2 +- crates/rome_service/src/workspace/server.rs | 2 +- xtask/bench/src/language.rs | 2 +- xtask/codegen/src/generate_configuration.rs | 6 +++--- xtask/lintdoc/src/main.rs | 4 ++-- 53 files changed, 124 insertions(+), 56 deletions(-) diff --git a/crates/biome_lsp/src/session.rs b/crates/biome_lsp/src/session.rs index ccf1ae908aba..de2fa26f3dc9 100644 --- a/crates/biome_lsp/src/session.rs +++ b/crates/biome_lsp/src/session.rs @@ -4,9 +4,9 @@ use crate::extension_settings::ExtensionSettings; use crate::extension_settings::CONFIGURATION_SECTION; use crate::utils; use anyhow::Result; +use biome_analyze::RuleCategories; use futures::stream::futures_unordered::FuturesUnordered; use futures::StreamExt; -use biome_analyze::RuleCategories; use rome_console::markup; use rome_fs::{FileSystem, OsFileSystem, RomePath}; use rome_service::workspace::{ diff --git a/crates/biome_test_utils/src/lib.rs b/crates/biome_test_utils/src/lib.rs index 44d5fe8185e8..4b11d5c45b6e 100644 --- a/crates/biome_test_utils/src/lib.rs +++ b/crates/biome_test_utils/src/lib.rs @@ -1,5 +1,5 @@ -use json_comments::StripComments; use biome_analyze::{AnalyzerAction, AnalyzerOptions}; +use json_comments::StripComments; use rome_console::fmt::{Formatter, Termcolor}; use rome_console::markup; use rome_diagnostics::termcolor::Buffer; diff --git a/crates/rome_cli/src/execute/migrate.rs b/crates/rome_cli/src/execute/migrate.rs index 47844cda22e7..712055d81e67 100644 --- a/crates/rome_cli/src/execute/migrate.rs +++ b/crates/rome_cli/src/execute/migrate.rs @@ -1,11 +1,11 @@ use crate::execute::diagnostics::{ContentDiffAdvice, MigrateDiffDiagnostic}; use crate::{CliDiagnostic, CliSession}; +use biome_migrate::{migrate_configuration, ControlFlow}; use rome_console::{markup, ConsoleExt}; use rome_diagnostics::{category, PrintDiagnostic}; use rome_fs::{FileSystemExt, OpenOptions}; use rome_json_parser::JsonParserOptions; use rome_json_syntax::JsonRoot; -use biome_migrate::{migrate_configuration, ControlFlow}; use rome_rowan::AstNode; use rome_service::workspace::FixAction; use std::borrow::Cow; diff --git a/crates/rome_js_analyze/src/analyzers/a11y/no_access_key.rs b/crates/rome_js_analyze/src/analyzers/a11y/no_access_key.rs index 77c26375c7cc..b989d3297f68 100644 --- a/crates/rome_js_analyze/src/analyzers/a11y/no_access_key.rs +++ b/crates/rome_js_analyze/src/analyzers/a11y/no_access_key.rs @@ -1,5 +1,7 @@ use crate::JsRuleAction; -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_syntax::{jsx_ext::AnyJsxElement, JsxAttribute, JsxAttributeList}; diff --git a/crates/rome_js_analyze/src/analyzers/a11y/no_auto_focus.rs b/crates/rome_js_analyze/src/analyzers/a11y/no_auto_focus.rs index f2fdcfc00848..51e9bc20145f 100644 --- a/crates/rome_js_analyze/src/analyzers/a11y/no_auto_focus.rs +++ b/crates/rome_js_analyze/src/analyzers/a11y/no_auto_focus.rs @@ -1,5 +1,7 @@ use crate::JsRuleAction; -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_syntax::{jsx_ext::AnyJsxElement, JsxAttribute}; diff --git a/crates/rome_js_analyze/src/analyzers/complexity/no_extra_boolean_cast.rs b/crates/rome_js_analyze/src/analyzers/complexity/no_extra_boolean_cast.rs index adbb220b4c50..7f182e06098b 100644 --- a/crates/rome_js_analyze/src/analyzers/complexity/no_extra_boolean_cast.rs +++ b/crates/rome_js_analyze/src/analyzers/complexity/no_extra_boolean_cast.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_syntax::{ diff --git a/crates/rome_js_analyze/src/analyzers/complexity/no_multiple_spaces_in_regular_expression_literals.rs b/crates/rome_js_analyze/src/analyzers/complexity/no_multiple_spaces_in_regular_expression_literals.rs index efc39bbd1abe..3c32b005db18 100644 --- a/crates/rome_js_analyze/src/analyzers/complexity/no_multiple_spaces_in_regular_expression_literals.rs +++ b/crates/rome_js_analyze/src/analyzers/complexity/no_multiple_spaces_in_regular_expression_literals.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_syntax::{JsRegexLiteralExpression, JsSyntaxKind, JsSyntaxToken, TextRange, TextSize}; diff --git a/crates/rome_js_analyze/src/analyzers/complexity/no_useless_constructor.rs b/crates/rome_js_analyze/src/analyzers/complexity/no_useless_constructor.rs index 3ec8c0391483..bb81689fface 100644 --- a/crates/rome_js_analyze/src/analyzers/complexity/no_useless_constructor.rs +++ b/crates/rome_js_analyze/src/analyzers/complexity/no_useless_constructor.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_syntax::{ diff --git a/crates/rome_js_analyze/src/analyzers/complexity/use_literal_keys.rs b/crates/rome_js_analyze/src/analyzers/complexity/use_literal_keys.rs index b5ee7ed52156..691b7bb58054 100644 --- a/crates/rome_js_analyze/src/analyzers/complexity/use_literal_keys.rs +++ b/crates/rome_js_analyze/src/analyzers/complexity/use_literal_keys.rs @@ -1,5 +1,7 @@ use crate::JsRuleAction; -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make::{ diff --git a/crates/rome_js_analyze/src/analyzers/complexity/use_optional_chain.rs b/crates/rome_js_analyze/src/analyzers/complexity/use_optional_chain.rs index ac77e831d558..ddb13ffd5910 100644 --- a/crates/rome_js_analyze/src/analyzers/complexity/use_optional_chain.rs +++ b/crates/rome_js_analyze/src/analyzers/complexity/use_optional_chain.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/complexity/use_simple_number_keys.rs b/crates/rome_js_analyze/src/analyzers/complexity/use_simple_number_keys.rs index 979b0176940d..15128396eba2 100644 --- a/crates/rome_js_analyze/src/analyzers/complexity/use_simple_number_keys.rs +++ b/crates/rome_js_analyze/src/analyzers/complexity/use_simple_number_keys.rs @@ -1,5 +1,7 @@ use crate::JsRuleAction; -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/complexity/use_simplified_logic_expression.rs b/crates/rome_js_analyze/src/analyzers/complexity/use_simplified_logic_expression.rs index a7b2eb837640..22a2ed6d22c6 100644 --- a/crates/rome_js_analyze/src/analyzers/complexity/use_simplified_logic_expression.rs +++ b/crates/rome_js_analyze/src/analyzers/complexity/use_simplified_logic_expression.rs @@ -1,5 +1,7 @@ use crate::JsRuleAction; -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/correctness/no_unnecessary_continue.rs b/crates/rome_js_analyze/src/analyzers/correctness/no_unnecessary_continue.rs index 108c110f8b1f..05791a76bf3e 100644 --- a/crates/rome_js_analyze/src/analyzers/correctness/no_unnecessary_continue.rs +++ b/crates/rome_js_analyze/src/analyzers/correctness/no_unnecessary_continue.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_syntax::{JsContinueStatement, JsLabeledStatement, JsSyntaxKind, JsSyntaxNode}; diff --git a/crates/rome_js_analyze/src/analyzers/correctness/no_unreachable.rs b/crates/rome_js_analyze/src/analyzers/correctness/no_unreachable.rs index 9014403a2b8e..a4b8caa1b54d 100644 --- a/crates/rome_js_analyze/src/analyzers/correctness/no_unreachable.rs +++ b/crates/rome_js_analyze/src/analyzers/correctness/no_unreachable.rs @@ -1,7 +1,7 @@ use std::{cmp::Ordering, collections::VecDeque, num::NonZeroU32, vec::IntoIter}; -use roaring::bitmap::RoaringBitmap; use biome_analyze::{context::RuleContext, declare_rule, Rule, RuleDiagnostic}; +use roaring::bitmap::RoaringBitmap; use rome_control_flow::{ builder::BlockId, ExceptionHandler, ExceptionHandlerKind, Instruction, InstructionKind, }; diff --git a/crates/rome_js_analyze/src/analyzers/nursery/no_excessive_complexity.rs b/crates/rome_js_analyze/src/analyzers/nursery/no_excessive_complexity.rs index 3162839a5288..d43605485487 100644 --- a/crates/rome_js_analyze/src/analyzers/nursery/no_excessive_complexity.rs +++ b/crates/rome_js_analyze/src/analyzers/nursery/no_excessive_complexity.rs @@ -1,8 +1,8 @@ -use bpaf::Bpaf; use biome_analyze::{ context::RuleContext, declare_rule, AddVisitor, Phases, QueryMatch, Queryable, Rule, RuleDiagnostic, ServiceBag, Visitor, VisitorContext, }; +use bpaf::Bpaf; use rome_console::markup; use rome_deserialize::{ json::{has_only_known_keys, VisitJsonNode}, diff --git a/crates/rome_js_analyze/src/analyzers/nursery/no_nonoctal_decimal_escape.rs b/crates/rome_js_analyze/src/analyzers/nursery/no_nonoctal_decimal_escape.rs index 2d26ce479e9e..835c9c771bae 100644 --- a/crates/rome_js_analyze/src/analyzers/nursery/no_nonoctal_decimal_escape.rs +++ b/crates/rome_js_analyze/src/analyzers/nursery/no_nonoctal_decimal_escape.rs @@ -1,5 +1,7 @@ use crate::JsRuleAction; -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/nursery/no_useless_empty_export.rs b/crates/rome_js_analyze/src/analyzers/nursery/no_useless_empty_export.rs index 451be5f3c5e9..f68fd9373491 100644 --- a/crates/rome_js_analyze/src/analyzers/nursery/no_useless_empty_export.rs +++ b/crates/rome_js_analyze/src/analyzers/nursery/no_useless_empty_export.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_syntax::{AnyJsModuleItem, JsExport, JsModuleItemList, JsSyntaxToken}; diff --git a/crates/rome_js_analyze/src/analyzers/nursery/use_collapsed_else_if.rs b/crates/rome_js_analyze/src/analyzers/nursery/use_collapsed_else_if.rs index 7d343f91dc65..14e7f78e9bd4 100644 --- a/crates/rome_js_analyze/src/analyzers/nursery/use_collapsed_else_if.rs +++ b/crates/rome_js_analyze/src/analyzers/nursery/use_collapsed_else_if.rs @@ -1,5 +1,7 @@ use crate::JsRuleAction; -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_syntax::{AnyJsStatement, JsBlockStatement, JsElseClause, JsIfStatement}; diff --git a/crates/rome_js_analyze/src/analyzers/nursery/use_grouped_type_import.rs b/crates/rome_js_analyze/src/analyzers/nursery/use_grouped_type_import.rs index a80bbdd2116e..a83a43b7c2e3 100644 --- a/crates/rome_js_analyze/src/analyzers/nursery/use_grouped_type_import.rs +++ b/crates/rome_js_analyze/src/analyzers/nursery/use_grouped_type_import.rs @@ -1,5 +1,7 @@ use crate::JsRuleAction; -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/performance/no_delete.rs b/crates/rome_js_analyze/src/analyzers/performance/no_delete.rs index 00a5cf2905ad..cb2ecee89005 100644 --- a/crates/rome_js_analyze/src/analyzers/performance/no_delete.rs +++ b/crates/rome_js_analyze/src/analyzers/performance/no_delete.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/style/no_implicit_boolean.rs b/crates/rome_js_analyze/src/analyzers/style/no_implicit_boolean.rs index 5336fd154926..08870d5ecb9d 100644 --- a/crates/rome_js_analyze/src/analyzers/style/no_implicit_boolean.rs +++ b/crates/rome_js_analyze/src/analyzers/style/no_implicit_boolean.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/style/no_inferrable_types.rs b/crates/rome_js_analyze/src/analyzers/style/no_inferrable_types.rs index a12f8bcb6c54..e6857bf0928f 100644 --- a/crates/rome_js_analyze/src/analyzers/style/no_inferrable_types.rs +++ b/crates/rome_js_analyze/src/analyzers/style/no_inferrable_types.rs @@ -1,5 +1,7 @@ use crate::JsRuleAction; -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_syntax::{ diff --git a/crates/rome_js_analyze/src/analyzers/style/no_negation_else.rs b/crates/rome_js_analyze/src/analyzers/style/no_negation_else.rs index d7d038a00014..34c730f4c941 100644 --- a/crates/rome_js_analyze/src/analyzers/style/no_negation_else.rs +++ b/crates/rome_js_analyze/src/analyzers/style/no_negation_else.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/style/no_non_null_assertion.rs b/crates/rome_js_analyze/src/analyzers/style/no_non_null_assertion.rs index 7c0afb5318ce..5f7e4cf1c6a5 100644 --- a/crates/rome_js_analyze/src/analyzers/style/no_non_null_assertion.rs +++ b/crates/rome_js_analyze/src/analyzers/style/no_non_null_assertion.rs @@ -1,5 +1,7 @@ use crate::JsRuleAction; -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/style/use_self_closing_elements.rs b/crates/rome_js_analyze/src/analyzers/style/use_self_closing_elements.rs index 1869ee6bac94..13fe2e9c46ce 100644 --- a/crates/rome_js_analyze/src/analyzers/style/use_self_closing_elements.rs +++ b/crates/rome_js_analyze/src/analyzers/style/use_self_closing_elements.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/style/use_shorthand_array_type.rs b/crates/rome_js_analyze/src/analyzers/style/use_shorthand_array_type.rs index ef56e0f2b4f2..f8fdd31664fa 100644 --- a/crates/rome_js_analyze/src/analyzers/style/use_shorthand_array_type.rs +++ b/crates/rome_js_analyze/src/analyzers/style/use_shorthand_array_type.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/style/use_single_case_statement.rs b/crates/rome_js_analyze/src/analyzers/style/use_single_case_statement.rs index 1aa7a2a460c7..800a693ee584 100644 --- a/crates/rome_js_analyze/src/analyzers/style/use_single_case_statement.rs +++ b/crates/rome_js_analyze/src/analyzers/style/use_single_case_statement.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/style/use_single_var_declarator.rs b/crates/rome_js_analyze/src/analyzers/style/use_single_var_declarator.rs index 4b4a262b940f..bc7bbbce6fb1 100644 --- a/crates/rome_js_analyze/src/analyzers/style/use_single_var_declarator.rs +++ b/crates/rome_js_analyze/src/analyzers/style/use_single_var_declarator.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/style/use_template.rs b/crates/rome_js_analyze/src/analyzers/style/use_template.rs index 8cd0a9ad21a2..f3c177bddaeb 100644 --- a/crates/rome_js_analyze/src/analyzers/style/use_template.rs +++ b/crates/rome_js_analyze/src/analyzers/style/use_template.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/style/use_while.rs b/crates/rome_js_analyze/src/analyzers/style/use_while.rs index 96c985303445..0b20cd4e8f1a 100644 --- a/crates/rome_js_analyze/src/analyzers/style/use_while.rs +++ b/crates/rome_js_analyze/src/analyzers/style/use_while.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/suspicious/no_comment_text.rs b/crates/rome_js_analyze/src/analyzers/suspicious/no_comment_text.rs index bd2b2c327b0b..80641833a3fe 100644 --- a/crates/rome_js_analyze/src/analyzers/suspicious/no_comment_text.rs +++ b/crates/rome_js_analyze/src/analyzers/suspicious/no_comment_text.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/suspicious/no_compare_neg_zero.rs b/crates/rome_js_analyze/src/analyzers/suspicious/no_compare_neg_zero.rs index 46208c658ea1..4a6390486f19 100644 --- a/crates/rome_js_analyze/src/analyzers/suspicious/no_compare_neg_zero.rs +++ b/crates/rome_js_analyze/src/analyzers/suspicious/no_compare_neg_zero.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/suspicious/no_debugger.rs b/crates/rome_js_analyze/src/analyzers/suspicious/no_debugger.rs index f6821a7228e2..64036045086c 100644 --- a/crates/rome_js_analyze/src/analyzers/suspicious/no_debugger.rs +++ b/crates/rome_js_analyze/src/analyzers/suspicious/no_debugger.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_syntax::JsDebuggerStatement; diff --git a/crates/rome_js_analyze/src/analyzers/suspicious/no_double_equals.rs b/crates/rome_js_analyze/src/analyzers/suspicious/no_double_equals.rs index 1a33531fec1f..67dad3b3db29 100644 --- a/crates/rome_js_analyze/src/analyzers/suspicious/no_double_equals.rs +++ b/crates/rome_js_analyze/src/analyzers/suspicious/no_double_equals.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/suspicious/no_redundant_use_strict.rs b/crates/rome_js_analyze/src/analyzers/suspicious/no_redundant_use_strict.rs index 045a264ae90b..68ec09ffd38a 100644 --- a/crates/rome_js_analyze/src/analyzers/suspicious/no_redundant_use_strict.rs +++ b/crates/rome_js_analyze/src/analyzers/suspicious/no_redundant_use_strict.rs @@ -1,5 +1,7 @@ use crate::JsRuleAction; -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_syntax::{ diff --git a/crates/rome_js_analyze/src/analyzers/suspicious/no_sparse_array.rs b/crates/rome_js_analyze/src/analyzers/suspicious/no_sparse_array.rs index b4e460ca61f9..aeee2baeaf85 100644 --- a/crates/rome_js_analyze/src/analyzers/suspicious/no_sparse_array.rs +++ b/crates/rome_js_analyze/src/analyzers/suspicious/no_sparse_array.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/suspicious/no_unsafe_negation.rs b/crates/rome_js_analyze/src/analyzers/suspicious/no_unsafe_negation.rs index f6d25aaa6d97..c19db08857b0 100644 --- a/crates/rome_js_analyze/src/analyzers/suspicious/no_unsafe_negation.rs +++ b/crates/rome_js_analyze/src/analyzers/suspicious/no_unsafe_negation.rs @@ -1,5 +1,7 @@ use crate::JsRuleAction; -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/suspicious/use_namespace_keyword.rs b/crates/rome_js_analyze/src/analyzers/suspicious/use_namespace_keyword.rs index 5955e5a6785e..7532348154ab 100644 --- a/crates/rome_js_analyze/src/analyzers/suspicious/use_namespace_keyword.rs +++ b/crates/rome_js_analyze/src/analyzers/suspicious/use_namespace_keyword.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/analyzers/suspicious/use_valid_typeof.rs b/crates/rome_js_analyze/src/analyzers/suspicious/use_valid_typeof.rs index 65e2e2d0b40f..362d53db48da 100644 --- a/crates/rome_js_analyze/src/analyzers/suspicious/use_valid_typeof.rs +++ b/crates/rome_js_analyze/src/analyzers/suspicious/use_valid_typeof.rs @@ -1,4 +1,6 @@ -use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic}; +use biome_analyze::{ + context::RuleContext, declare_rule, ActionCategory, Ast, Rule, RuleDiagnostic, +}; use rome_console::markup; use rome_diagnostics::Applicability; use rome_js_factory::make; diff --git a/crates/rome_js_analyze/src/options.rs b/crates/rome_js_analyze/src/options.rs index 801dc8f109ab..6a81c916c3d5 100644 --- a/crates/rome_js_analyze/src/options.rs +++ b/crates/rome_js_analyze/src/options.rs @@ -10,9 +10,9 @@ use crate::semantic_analyzers::nursery::use_naming_convention::{ use crate::semantic_analyzers::style::no_restricted_globals::{ restricted_globals_options, RestrictedGlobalsOptions, }; -use bpaf::Bpaf; use biome_analyze::options::RuleOptions; use biome_analyze::RuleKey; +use bpaf::Bpaf; use rome_deserialize::json::VisitJsonNode; use rome_deserialize::{DeserializationDiagnostic, VisitNode}; use rome_json_syntax::{AnyJsonValue, JsonLanguage, JsonMemberName, JsonObjectValue}; diff --git a/crates/rome_js_analyze/src/semantic_analyzers/nursery/use_exhaustive_dependencies.rs b/crates/rome_js_analyze/src/semantic_analyzers/nursery/use_exhaustive_dependencies.rs index 627ea8f58102..ce11351df0bc 100644 --- a/crates/rome_js_analyze/src/semantic_analyzers/nursery/use_exhaustive_dependencies.rs +++ b/crates/rome_js_analyze/src/semantic_analyzers/nursery/use_exhaustive_dependencies.rs @@ -1,7 +1,7 @@ use crate::react::hooks::*; use crate::semantic_services::Semantic; -use bpaf::Bpaf; use biome_analyze::{context::RuleContext, declare_rule, Rule, RuleDiagnostic}; +use bpaf::Bpaf; use rome_console::markup; use rome_deserialize::json::{has_only_known_keys, VisitJsonNode}; use rome_deserialize::{DeserializationDiagnostic, VisitNode}; diff --git a/crates/rome_js_analyze/src/semantic_analyzers/nursery/use_naming_convention.rs b/crates/rome_js_analyze/src/semantic_analyzers/nursery/use_naming_convention.rs index b11bbf77451a..5d399458de6b 100644 --- a/crates/rome_js_analyze/src/semantic_analyzers/nursery/use_naming_convention.rs +++ b/crates/rome_js_analyze/src/semantic_analyzers/nursery/use_naming_convention.rs @@ -7,8 +7,8 @@ use crate::{ utils::rename::{AnyJsRenamableDeclaration, RenameSymbolExtensions}, JsRuleAction, }; -use bpaf::Bpaf; use biome_analyze::{context::RuleContext, declare_rule, ActionCategory, Rule, RuleDiagnostic}; +use bpaf::Bpaf; use rome_console::markup; use rome_deserialize::{ json::{has_only_known_keys, with_only_known_variants, VisitJsonNode}, diff --git a/crates/rome_js_analyze/src/semantic_analyzers/style/no_restricted_globals.rs b/crates/rome_js_analyze/src/semantic_analyzers/style/no_restricted_globals.rs index 7f47018271b2..44c35173b12b 100644 --- a/crates/rome_js_analyze/src/semantic_analyzers/style/no_restricted_globals.rs +++ b/crates/rome_js_analyze/src/semantic_analyzers/style/no_restricted_globals.rs @@ -1,7 +1,7 @@ use crate::semantic_services::SemanticServices; -use bpaf::Bpaf; use biome_analyze::context::RuleContext; use biome_analyze::{declare_rule, Rule, RuleDiagnostic}; +use bpaf::Bpaf; use rome_console::markup; use rome_deserialize::json::{has_only_known_keys, VisitJsonNode}; use rome_deserialize::{DeserializationDiagnostic, VisitNode}; diff --git a/crates/rome_js_analyze/tests/spec_tests.rs b/crates/rome_js_analyze/tests/spec_tests.rs index 498371a23b1d..4884076d0892 100644 --- a/crates/rome_js_analyze/tests/spec_tests.rs +++ b/crates/rome_js_analyze/tests/spec_tests.rs @@ -1,9 +1,9 @@ +use biome_analyze::{AnalysisFilter, AnalyzerAction, ControlFlow, Never, RuleFilter}; use biome_test_utils::{ assert_errors_are_absent, code_fix_to_string, create_analyzer_options, diagnostic_to_string, has_bogus_nodes_or_empty_slots, parse_test_path, register_leak_checker, scripts_from_json, write_analyzer_snapshot, CheckActionType, }; -use biome_analyze::{AnalysisFilter, AnalyzerAction, ControlFlow, Never, RuleFilter}; use rome_diagnostics::advice::CodeSuggestionAdvice; use rome_diagnostics::{DiagnosticExt, Severity}; use rome_js_parser::{parse, JsParserOptions}; diff --git a/crates/rome_js_transform/tests/spec_tests.rs b/crates/rome_js_transform/tests/spec_tests.rs index 6ad55c4f0990..50079332d456 100644 --- a/crates/rome_js_transform/tests/spec_tests.rs +++ b/crates/rome_js_transform/tests/spec_tests.rs @@ -1,9 +1,9 @@ +use biome_analyze::{AnalysisFilter, AnalyzerTransformation, ControlFlow, Never, RuleFilter}; use biome_test_utils::{ assert_errors_are_absent, create_analyzer_options, diagnostic_to_string, has_bogus_nodes_or_empty_slots, register_leak_checker, scripts_from_json, write_transformation_snapshot, }; -use biome_analyze::{AnalysisFilter, AnalyzerTransformation, ControlFlow, Never, RuleFilter}; use rome_js_formatter::context::JsFormatOptions; use rome_js_formatter::format_node; use rome_js_parser::{parse, JsParserOptions}; diff --git a/crates/rome_json_analyze/tests/spec_tests.rs b/crates/rome_json_analyze/tests/spec_tests.rs index add9766c55ab..1e7d0871934b 100644 --- a/crates/rome_json_analyze/tests/spec_tests.rs +++ b/crates/rome_json_analyze/tests/spec_tests.rs @@ -1,9 +1,9 @@ +use biome_analyze::{AnalysisFilter, AnalyzerAction, ControlFlow, Never, RuleFilter}; use biome_test_utils::{ assert_errors_are_absent, code_fix_to_string, create_analyzer_options, diagnostic_to_string, has_bogus_nodes_or_empty_slots, parse_test_path, register_leak_checker, write_analyzer_snapshot, }; -use biome_analyze::{AnalysisFilter, AnalyzerAction, ControlFlow, Never, RuleFilter}; use rome_diagnostics::advice::CodeSuggestionAdvice; use rome_diagnostics::{DiagnosticExt, Severity}; use rome_json_parser::{parse_json, JsonParserOptions}; diff --git a/crates/rome_service/src/configuration/mod.rs b/crates/rome_service/src/configuration/mod.rs index 10f3d96c5571..7b2c1dad5bf9 100644 --- a/crates/rome_service/src/configuration/mod.rs +++ b/crates/rome_service/src/configuration/mod.rs @@ -20,12 +20,12 @@ use crate::configuration::organize_imports::{organize_imports, OrganizeImports}; use crate::configuration::vcs::{vcs_configuration, VcsConfiguration}; use crate::settings::{LanguagesSettings, LinterSettings}; use crate::{DynRef, WorkspaceError, VERSION}; +use biome_analyze::{AnalyzerConfiguration, AnalyzerRules}; use bpaf::Bpaf; pub use formatter::{formatter_configuration, FormatterConfiguration, PlainIndentStyle}; pub use javascript::{javascript_configuration, JavascriptConfiguration, JavascriptFormatter}; pub use json::{json_configuration, JsonConfiguration}; pub use linter::{linter_configuration, LinterConfiguration, RuleConfiguration, Rules}; -use biome_analyze::{AnalyzerConfiguration, AnalyzerRules}; use rome_deserialize::json::deserialize_from_json_str; use rome_deserialize::{Deserialized, StringSet}; use rome_fs::{AutoSearchResult, FileSystem, OpenOptions}; diff --git a/crates/rome_service/src/file_handlers/javascript.rs b/crates/rome_service/src/file_handlers/javascript.rs index ab66c4265bce..30524fba60be 100644 --- a/crates/rome_service/src/file_handlers/javascript.rs +++ b/crates/rome_service/src/file_handlers/javascript.rs @@ -13,11 +13,11 @@ use crate::{ }, Rules, WorkspaceError, }; -use indexmap::IndexSet; use biome_analyze::{ AnalysisFilter, AnalyzerOptions, ControlFlow, GroupCategory, Never, QueryMatch, RegistryVisitor, RuleCategories, RuleCategory, RuleFilter, RuleGroup, }; +use indexmap::IndexSet; use rome_diagnostics::{category, Applicability, Diagnostic, DiagnosticExt, Severity}; use rome_formatter::{FormatError, Printed}; use rome_fs::RomePath; diff --git a/crates/rome_service/src/file_handlers/mod.rs b/crates/rome_service/src/file_handlers/mod.rs index d9f723368c09..483299b23a28 100644 --- a/crates/rome_service/src/file_handlers/mod.rs +++ b/crates/rome_service/src/file_handlers/mod.rs @@ -5,8 +5,8 @@ use crate::{ workspace::{FixFileResult, GetSyntaxTreeResult, PullActionsResult, RenameResult}, Rules, WorkspaceError, }; -pub use javascript::JsFormatterSettings; use biome_analyze::{AnalysisFilter, AnalyzerDiagnostic}; +pub use javascript::JsFormatterSettings; use rome_console::fmt::Formatter; use rome_console::markup; use rome_diagnostics::{Diagnostic, Severity}; diff --git a/crates/rome_service/src/workspace/server.rs b/crates/rome_service/src/workspace/server.rs index d29d4ce7d296..d1e4522bcd54 100644 --- a/crates/rome_service/src/workspace/server.rs +++ b/crates/rome_service/src/workspace/server.rs @@ -15,9 +15,9 @@ use crate::{ settings::{SettingsHandle, WorkspaceSettings}, Rules, Workspace, WorkspaceError, }; +use biome_analyze::{AnalysisFilter, RuleFilter}; use dashmap::{mapref::entry::Entry, DashMap}; use indexmap::IndexSet; -use biome_analyze::{AnalysisFilter, RuleFilter}; use rome_diagnostics::{serde::Diagnostic as SerdeDiagnostic, Diagnostic, DiagnosticExt, Severity}; use rome_formatter::Printed; use rome_fs::RomePath; diff --git a/xtask/bench/src/language.rs b/xtask/bench/src/language.rs index d80f5869cd0b..c8ba5d9d45dd 100644 --- a/xtask/bench/src/language.rs +++ b/xtask/bench/src/language.rs @@ -1,6 +1,6 @@ use crate::test_case::TestCase; -use criterion::black_box; use biome_analyze::{AnalysisFilter, AnalyzerOptions, ControlFlow, Never, RuleCategories}; +use criterion::black_box; use rome_formatter::{FormatResult, Formatted, PrintResult, Printed}; use rome_js_analyze::analyze; use rome_js_formatter::context::{JsFormatContext, JsFormatOptions}; diff --git a/xtask/codegen/src/generate_configuration.rs b/xtask/codegen/src/generate_configuration.rs index 36897126b1c9..912972df6fa3 100644 --- a/xtask/codegen/src/generate_configuration.rs +++ b/xtask/codegen/src/generate_configuration.rs @@ -1,10 +1,10 @@ +use biome_analyze::{ + GroupCategory, Queryable, RegistryVisitor, Rule, RuleCategory, RuleGroup, RuleMetadata, +}; use case::CaseExt; use proc_macro2::{Ident, Literal, Span, TokenStream}; use pulldown_cmark::{Event, Parser, Tag}; use quote::quote; -use biome_analyze::{ - GroupCategory, Queryable, RegistryVisitor, Rule, RuleCategory, RuleGroup, RuleMetadata, -}; use rome_js_syntax::JsLanguage; use rome_json_syntax::JsonLanguage; use std::collections::BTreeMap; diff --git a/xtask/lintdoc/src/main.rs b/xtask/lintdoc/src/main.rs index 330a1543f17d..1dec29c50026 100644 --- a/xtask/lintdoc/src/main.rs +++ b/xtask/lintdoc/src/main.rs @@ -1,9 +1,9 @@ -use convert_case::{Case, Casing}; -use pulldown_cmark::{html::write_html, CodeBlockKind, Event, LinkType, Parser, Tag}; use biome_analyze::{ AnalysisFilter, AnalyzerOptions, ControlFlow, GroupCategory, Queryable, RegistryVisitor, Rule, RuleCategory, RuleFilter, RuleGroup, RuleMetadata, }; +use convert_case::{Case, Casing}; +use pulldown_cmark::{html::write_html, CodeBlockKind, Event, LinkType, Parser, Tag}; use rome_console::fmt::Termcolor; use rome_console::{ fmt::{Formatter, HTML},