From 31c58bc78e796060211b291dd9c30d0ccf338286 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Mon, 25 Nov 2024 10:15:33 +0000 Subject: [PATCH] refactor(analyzer): severity in metadata --- crates/biome_analyze/src/rule.rs | 10 ++++++- .../src/lint/a11y/use_generic_font_names.rs | 2 ++ ...no_invalid_direction_in_linear_gradient.rs | 2 ++ .../lint/correctness/no_invalid_grid_areas.rs | 2 ++ .../no_invalid_position_at_import_rule.rs | 2 ++ .../lint/correctness/no_unknown_function.rs | 2 ++ .../no_unknown_media_feature_name.rs | 2 ++ .../lint/correctness/no_unknown_property.rs | 2 ++ .../src/lint/correctness/no_unknown_unit.rs | 2 ++ .../no_unmatchable_anb_selector.rs | 2 ++ .../lint/nursery/no_descending_specificity.rs | 2 ++ .../nursery/no_duplicate_custom_properties.rs | 2 ++ .../lint/nursery/no_duplicate_properties.rs | 2 ++ .../lint/nursery/no_missing_var_function.rs | 2 ++ .../lint/nursery/no_unknown_pseudo_class.rs | 2 ++ .../lint/nursery/no_unknown_pseudo_element.rs | 2 ++ .../lint/nursery/no_unknown_type_selector.rs | 2 ++ .../no_duplicate_at_import_rules.rs | 2 ++ .../suspicious/no_duplicate_font_names.rs | 2 ++ .../no_duplicate_selectors_keyframe_block.rs | 2 ++ .../src/lint/suspicious/no_empty_block.rs | 2 ++ .../suspicious/no_important_in_keyframe.rs | 2 ++ .../no_shorthand_property_overrides.rs | 2 ++ .../src/lint/a11y/no_access_key.rs | 2 ++ .../lint/a11y/no_aria_hidden_on_focusable.rs | 2 ++ .../lint/a11y/no_aria_unsupported_elements.rs | 2 ++ .../src/lint/a11y/no_autofocus.rs | 2 ++ .../src/lint/a11y/no_blank_target.rs | 2 ++ .../src/lint/a11y/no_distracting_elements.rs | 2 ++ .../src/lint/a11y/no_header_scope.rs | 2 ++ ...eractive_element_to_noninteractive_role.rs | 2 ++ .../src/lint/a11y/no_label_without_control.rs | 2 ++ ...interactive_element_to_interactive_role.rs | 2 ++ .../lint/a11y/no_noninteractive_tabindex.rs | 2 ++ .../src/lint/a11y/no_positive_tabindex.rs | 2 ++ .../src/lint/a11y/no_redundant_alt.rs | 2 ++ .../src/lint/a11y/no_redundant_roles.rs | 2 ++ .../src/lint/a11y/no_svg_without_title.rs | 2 ++ .../src/lint/a11y/use_alt_text.rs | 2 ++ .../src/lint/a11y/use_anchor_content.rs | 2 ++ ...use_aria_activedescendant_with_tabindex.rs | 2 ++ .../src/lint/a11y/use_aria_props_for_role.rs | 2 ++ .../src/lint/a11y/use_button_type.rs | 2 ++ .../lint/a11y/use_focusable_interactive.rs | 2 ++ .../src/lint/a11y/use_heading_content.rs | 2 ++ .../src/lint/a11y/use_html_lang.rs | 2 ++ .../src/lint/a11y/use_iframe_title.rs | 2 ++ .../lint/a11y/use_key_with_click_events.rs | 2 ++ .../lint/a11y/use_key_with_mouse_events.rs | 2 ++ .../src/lint/a11y/use_media_caption.rs | 2 ++ .../src/lint/a11y/use_semantic_elements.rs | 2 ++ .../src/lint/a11y/use_valid_anchor.rs | 2 ++ .../src/lint/a11y/use_valid_aria_props.rs | 2 ++ .../src/lint/a11y/use_valid_aria_role.rs | 2 ++ .../src/lint/a11y/use_valid_aria_values.rs | 2 ++ .../src/lint/a11y/use_valid_lang.rs | 2 ++ .../src/lint/complexity/no_banned_types.rs | 2 ++ .../complexity/no_empty_type_parameters.rs | 2 ++ .../no_excessive_nested_test_suites.rs | 2 ++ .../lint/complexity/no_extra_boolean_cast.rs | 2 ++ .../src/lint/complexity/no_for_each.rs | 2 ++ ...e_spaces_in_regular_expression_literals.rs | 2 ++ .../lint/complexity/no_static_only_class.rs | 2 ++ .../src/lint/complexity/no_this_in_static.rs | 2 ++ .../src/lint/complexity/no_useless_catch.rs | 2 ++ .../lint/complexity/no_useless_constructor.rs | 2 ++ .../complexity/no_useless_empty_export.rs | 2 ++ .../lint/complexity/no_useless_fragments.rs | 2 ++ .../src/lint/complexity/no_useless_label.rs | 2 ++ .../no_useless_lone_block_statements.rs | 2 ++ .../src/lint/complexity/no_useless_rename.rs | 2 ++ .../lint/complexity/no_useless_switch_case.rs | 2 ++ .../src/lint/complexity/no_useless_ternary.rs | 2 ++ .../lint/complexity/no_useless_this_alias.rs | 2 ++ .../complexity/no_useless_type_constraint.rs | 2 ++ .../src/lint/complexity/no_with.rs | 2 ++ .../src/lint/complexity/use_arrow_function.rs | 2 ++ .../src/lint/complexity/use_flat_map.rs | 2 ++ .../src/lint/complexity/use_literal_keys.rs | 2 ++ .../src/lint/complexity/use_optional_chain.rs | 2 ++ .../src/lint/complexity/use_regex_literals.rs | 2 ++ .../lint/complexity/use_simple_number_keys.rs | 2 ++ .../src/lint/correctness/no_children_prop.rs | 2 ++ .../src/lint/correctness/no_const_assign.rs | 2 ++ .../lint/correctness/no_constant_condition.rs | 2 ++ .../lint/correctness/no_constructor_return.rs | 2 ++ .../no_empty_character_class_in_regex.rs | 2 ++ .../src/lint/correctness/no_empty_pattern.rs | 2 ++ .../lint/correctness/no_flat_map_identity.rs | 2 ++ .../correctness/no_global_object_calls.rs | 2 ++ .../lint/correctness/no_inner_declarations.rs | 2 ++ .../no_invalid_builtin_instantiation.rs | 2 ++ .../no_invalid_constructor_super.rs | 2 ++ .../no_invalid_use_before_declaration.rs | 2 ++ .../correctness/no_nonoctal_decimal_escape.rs | 2 ++ .../src/lint/correctness/no_precision_loss.rs | 2 ++ .../correctness/no_render_return_value.rs | 2 ++ .../src/lint/correctness/no_self_assign.rs | 2 ++ .../src/lint/correctness/no_setter_return.rs | 2 ++ .../correctness/no_string_case_mismatch.rs | 2 ++ .../correctness/no_switch_declarations.rs | 2 ++ .../correctness/no_unnecessary_continue.rs | 2 ++ .../src/lint/correctness/no_unreachable.rs | 5 ++-- .../lint/correctness/no_unreachable_super.rs | 2 ++ .../src/lint/correctness/no_unsafe_finally.rs | 2 ++ .../no_unsafe_optional_chaining.rs | 2 ++ .../src/lint/correctness/no_unused_labels.rs | 2 ++ .../no_void_elements_with_children.rs | 26 +++++-------------- .../lint/correctness/no_void_type_return.rs | 2 ++ .../src/lint/correctness/use_is_nan.rs | 2 ++ .../correctness/use_jsx_key_in_iterable.rs | 2 ++ .../correctness/use_valid_for_direction.rs | 2 ++ .../src/lint/correctness/use_yield.rs | 2 ++ .../src/lint/nursery/no_duplicate_else_if.rs | 2 ++ .../nursery/no_useless_escape_in_regex.rs | 2 ++ .../use_aria_props_supported_by_role.rs | 2 ++ .../use_consistent_member_accessibility.rs | 2 ++ .../src/lint/nursery/use_strict_mode.rs | 2 ++ .../performance/no_accumulating_spread.rs | 2 ++ .../src/lint/performance/no_delete.rs | 2 ++ .../security/no_dangerously_set_inner_html.rs | 2 ++ ...angerously_set_inner_html_with_children.rs | 2 ++ .../src/lint/security/no_global_eval.rs | 2 ++ .../src/lint/style/no_arguments.rs | 2 ++ .../src/lint/style/no_comma_operator.rs | 2 ++ .../src/lint/style/no_inferrable_types.rs | 2 ++ .../src/lint/style/no_non_null_assertion.rs | 2 ++ .../src/lint/style/no_parameter_assign.rs | 2 ++ .../lint/style/no_unused_template_literal.rs | 2 ++ .../src/lint/style/no_useless_else.rs | 2 ++ .../biome_js_analyze/src/lint/style/no_var.rs | 2 ++ .../src/lint/style/use_as_const_assertion.rs | 2 ++ .../src/lint/style/use_const.rs | 2 ++ .../lint/style/use_default_parameter_last.rs | 2 ++ .../src/lint/style/use_enum_initializers.rs | 2 ++ .../lint/style/use_exponentiation_operator.rs | 2 ++ .../src/lint/style/use_export_type.rs | 2 ++ .../src/lint/style/use_import_type.rs | 2 ++ .../lint/style/use_literal_enum_members.rs | 2 ++ .../lint/style/use_nodejs_import_protocol.rs | 2 ++ .../src/lint/style/use_number_namespace.rs | 2 ++ .../src/lint/style/use_numeric_literals.rs | 2 ++ .../lint/style/use_self_closing_elements.rs | 2 ++ .../lint/style/use_shorthand_function_type.rs | 2 ++ .../lint/style/use_single_var_declarator.rs | 2 ++ .../src/lint/style/use_template.rs | 2 ++ .../src/lint/style/use_while.rs | 2 ++ .../no_approximative_numeric_constant.rs | 2 ++ .../src/lint/suspicious/no_array_index_key.rs | 2 ++ .../suspicious/no_assign_in_expressions.rs | 2 ++ .../suspicious/no_async_promise_executor.rs | 2 ++ .../src/lint/suspicious/no_catch_assign.rs | 2 ++ .../src/lint/suspicious/no_class_assign.rs | 2 ++ .../src/lint/suspicious/no_comment_text.rs | 2 ++ .../lint/suspicious/no_compare_neg_zero.rs | 2 ++ .../lint/suspicious/no_confusing_labels.rs | 2 ++ .../lint/suspicious/no_confusing_void_type.rs | 2 ++ .../src/lint/suspicious/no_const_enum.rs | 2 ++ .../no_control_characters_in_regex.rs | 2 ++ .../src/lint/suspicious/no_debugger.rs | 2 ++ .../src/lint/suspicious/no_double_equals.rs | 2 ++ .../src/lint/suspicious/no_duplicate_case.rs | 2 ++ .../suspicious/no_duplicate_class_members.rs | 2 ++ .../lint/suspicious/no_duplicate_jsx_props.rs | 2 ++ .../suspicious/no_duplicate_object_keys.rs | 2 ++ .../suspicious/no_duplicate_parameters.rs | 2 ++ .../suspicious/no_duplicate_test_hooks.rs | 2 ++ .../src/lint/suspicious/no_empty_interface.rs | 2 ++ .../src/lint/suspicious/no_explicit_any.rs | 2 ++ .../src/lint/suspicious/no_exports_in_test.rs | 2 ++ .../suspicious/no_extra_non_null_assertion.rs | 2 ++ .../no_fallthrough_switch_clause.rs | 2 ++ .../src/lint/suspicious/no_focused_tests.rs | 2 ++ .../src/lint/suspicious/no_function_assign.rs | 2 ++ .../src/lint/suspicious/no_global_assign.rs | 2 ++ .../lint/suspicious/no_global_is_finite.rs | 2 ++ .../src/lint/suspicious/no_global_is_nan.rs | 2 ++ .../lint/suspicious/no_implicit_any_let.rs | 2 ++ .../src/lint/suspicious/no_import_assign.rs | 2 ++ .../src/lint/suspicious/no_label_var.rs | 2 ++ .../no_misleading_character_class.rs | 2 ++ .../suspicious/no_misleading_instantiator.rs | 2 ++ .../no_misrefactored_shorthand_assign.rs | 2 ++ .../lint/suspicious/no_prototype_builtins.rs | 2 ++ .../src/lint/suspicious/no_redeclare.rs | 2 ++ .../suspicious/no_redundant_use_strict.rs | 2 ++ .../src/lint/suspicious/no_self_compare.rs | 2 ++ .../suspicious/no_shadow_restricted_names.rs | 2 ++ .../src/lint/suspicious/no_sparse_array.rs | 2 ++ .../no_suspicious_semicolon_in_jsx.rs | 2 ++ .../src/lint/suspicious/no_then_property.rs | 2 ++ .../no_unsafe_declaration_merging.rs | 2 ++ .../src/lint/suspicious/no_unsafe_negation.rs | 2 ++ .../use_default_switch_clause_last.rs | 2 ++ .../src/lint/suspicious/use_getter_return.rs | 2 ++ .../src/lint/suspicious/use_is_array.rs | 2 ++ .../lint/suspicious/use_namespace_keyword.rs | 2 ++ .../src/lint/suspicious/use_valid_typeof.rs | 2 ++ .../suspicious/no_duplicate_object_keys.rs | 2 ++ 199 files changed, 411 insertions(+), 22 deletions(-) diff --git a/crates/biome_analyze/src/rule.rs b/crates/biome_analyze/src/rule.rs index 2c363f14d20c..e66ddf23eb38 100644 --- a/crates/biome_analyze/src/rule.rs +++ b/crates/biome_analyze/src/rule.rs @@ -8,11 +8,11 @@ use biome_console::fmt::Display; use biome_console::{markup, MarkupBuf}; use biome_diagnostics::advice::CodeSuggestionAdvice; use biome_diagnostics::location::AsSpan; -use biome_diagnostics::Applicability; use biome_diagnostics::{ Advices, Category, Diagnostic, DiagnosticTags, Location, LogCategory, MessageAndDescription, Visit, }; +use biome_diagnostics::{Applicability, Severity}; use biome_rowan::{AstNode, BatchMutation, BatchMutationExt, Language, TextRange}; use std::borrow::Cow; use std::cmp::Ordering; @@ -41,6 +41,8 @@ pub struct RuleMetadata { pub sources: &'static [RuleSource], /// The source kind of the rule pub source_kind: Option, + /// The default severity of the rule + pub severity: Severity, } #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] @@ -328,6 +330,7 @@ impl RuleMetadata { fix_kind: FixKind::None, sources: &[], source_kind: None, + severity: Severity::Information, } } @@ -364,6 +367,11 @@ impl RuleMetadata { self } + pub const fn severity(mut self, severity: Severity) -> Self { + self.severity = severity; + self + } + pub fn applicability(&self) -> Applicability { self.fix_kind .try_into() diff --git a/crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs b/crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs index 1b810896e1fe..6cb5fa6402bb 100644 --- a/crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs +++ b/crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs @@ -6,6 +6,7 @@ use biome_css_syntax::{ AnyCssAtRule, AnyCssGenericComponentValue, AnyCssValue, CssAtRule, CssGenericComponentValueList, CssGenericProperty, CssSyntaxKind, }; +use biome_diagnostics::Severity; use biome_rowan::{AstNode, SyntaxNodeCast, TextRange}; use biome_string_case::StrLikeExtension; @@ -65,6 +66,7 @@ declare_lint_rule! { name: "useGenericFontNames", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("font-family-no-missing-generic-family-keyword")], } } diff --git a/crates/biome_css_analyze/src/lint/correctness/no_invalid_direction_in_linear_gradient.rs b/crates/biome_css_analyze/src/lint/correctness/no_invalid_direction_in_linear_gradient.rs index 4656c0605a6e..73672767372e 100644 --- a/crates/biome_css_analyze/src/lint/correctness/no_invalid_direction_in_linear_gradient.rs +++ b/crates/biome_css_analyze/src/lint/correctness/no_invalid_direction_in_linear_gradient.rs @@ -3,6 +3,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_css_syntax::{CssFunction, CssParameter}; +use biome_diagnostics::Severity; use biome_rowan::AstNode; use biome_rowan::AstSeparatedList; use biome_string_case::StrLikeExtension; @@ -47,6 +48,7 @@ declare_lint_rule! { name: "noInvalidDirectionInLinearGradient", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("function-linear-gradient-no-nonstandard-direction")], } } diff --git a/crates/biome_css_analyze/src/lint/correctness/no_invalid_grid_areas.rs b/crates/biome_css_analyze/src/lint/correctness/no_invalid_grid_areas.rs index 8a9bbe2a8709..8cb746ffc40a 100644 --- a/crates/biome_css_analyze/src/lint/correctness/no_invalid_grid_areas.rs +++ b/crates/biome_css_analyze/src/lint/correctness/no_invalid_grid_areas.rs @@ -3,6 +3,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_css_syntax::CssDeclarationOrRuleList; +use biome_diagnostics::Severity; use biome_rowan::{TextRange, TokenText}; use rustc_hash::FxHashSet; @@ -53,6 +54,7 @@ declare_lint_rule! { name: "noInvalidGridAreas", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("named-grid-areas-no-invalid")], } } diff --git a/crates/biome_css_analyze/src/lint/correctness/no_invalid_position_at_import_rule.rs b/crates/biome_css_analyze/src/lint/correctness/no_invalid_position_at_import_rule.rs index 191d204e319a..ea8f47c704c2 100644 --- a/crates/biome_css_analyze/src/lint/correctness/no_invalid_position_at_import_rule.rs +++ b/crates/biome_css_analyze/src/lint/correctness/no_invalid_position_at_import_rule.rs @@ -3,6 +3,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_css_syntax::{AnyCssRule, CssRuleList}; +use biome_diagnostics::Severity; use biome_rowan::{AstNode, TextRange}; declare_lint_rule! { @@ -31,6 +32,7 @@ declare_lint_rule! { name: "noInvalidPositionAtImportRule", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("no-invalid-position-at-import-rule")], } } diff --git a/crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs b/crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs index 9eea61618a91..59963f276c76 100644 --- a/crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs +++ b/crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs @@ -3,6 +3,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_css_syntax::CssFunction; +use biome_diagnostics::Severity; use biome_rowan::{AstNode, TextRange}; use crate::utils::{is_custom_function, is_function_keyword}; @@ -36,6 +37,7 @@ declare_lint_rule! { name: "noUnknownFunction", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("function-no-unknown")], } } diff --git a/crates/biome_css_analyze/src/lint/correctness/no_unknown_media_feature_name.rs b/crates/biome_css_analyze/src/lint/correctness/no_unknown_media_feature_name.rs index 841afdf5d8a3..c3dd88548095 100644 --- a/crates/biome_css_analyze/src/lint/correctness/no_unknown_media_feature_name.rs +++ b/crates/biome_css_analyze/src/lint/correctness/no_unknown_media_feature_name.rs @@ -8,6 +8,7 @@ use biome_css_syntax::{ AnyCssMediaTypeQuery, AnyCssQueryFeature, CssMediaAndCondition, CssMediaConditionQuery, CssMediaOrCondition, CssMediaQueryList, }; +use biome_diagnostics::Severity; use biome_rowan::AstNode; use crate::utils::is_media_feature_name; @@ -71,6 +72,7 @@ declare_lint_rule! { name: "noUnknownMediaFeatureName", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("media-feature-name-no-unknown")], } } diff --git a/crates/biome_css_analyze/src/lint/correctness/no_unknown_property.rs b/crates/biome_css_analyze/src/lint/correctness/no_unknown_property.rs index abf806609969..bb4847442430 100644 --- a/crates/biome_css_analyze/src/lint/correctness/no_unknown_property.rs +++ b/crates/biome_css_analyze/src/lint/correctness/no_unknown_property.rs @@ -3,6 +3,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_css_syntax::CssGenericProperty; +use biome_diagnostics::Severity; use biome_rowan::{AstNode, TextRange}; use biome_string_case::StrLikeExtension; @@ -61,6 +62,7 @@ declare_lint_rule! { name: "noUnknownProperty", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("property-no-unknown")], } } diff --git a/crates/biome_css_analyze/src/lint/correctness/no_unknown_unit.rs b/crates/biome_css_analyze/src/lint/correctness/no_unknown_unit.rs index 6213b4fdfe4b..a02fedc9e276 100644 --- a/crates/biome_css_analyze/src/lint/correctness/no_unknown_unit.rs +++ b/crates/biome_css_analyze/src/lint/correctness/no_unknown_unit.rs @@ -5,6 +5,7 @@ use biome_console::markup; use biome_css_syntax::{ AnyCssDimension, CssFunction, CssGenericProperty, CssQueryFeaturePlain, CssSyntaxKind, }; +use biome_diagnostics::Severity; use biome_rowan::{SyntaxNodeCast, TextRange}; use biome_string_case::StrLikeExtension; @@ -64,6 +65,7 @@ declare_lint_rule! { name: "noUnknownUnit", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("unit-no-unknown")], } } diff --git a/crates/biome_css_analyze/src/lint/correctness/no_unmatchable_anb_selector.rs b/crates/biome_css_analyze/src/lint/correctness/no_unmatchable_anb_selector.rs index b8d19e7abc4e..d0dac522fb8b 100644 --- a/crates/biome_css_analyze/src/lint/correctness/no_unmatchable_anb_selector.rs +++ b/crates/biome_css_analyze/src/lint/correctness/no_unmatchable_anb_selector.rs @@ -5,6 +5,7 @@ use biome_console::markup; use biome_css_syntax::{ AnyCssPseudoClassNth, CssPseudoClassFunctionSelectorList, CssPseudoClassNthSelector, }; +use biome_diagnostics::Severity; use biome_rowan::{AstNode, SyntaxNodeCast}; declare_lint_rule! { @@ -57,6 +58,7 @@ declare_lint_rule! { name: "noUnmatchableAnbSelector", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("selector-anb-no-unmatchable")], } } diff --git a/crates/biome_css_analyze/src/lint/nursery/no_descending_specificity.rs b/crates/biome_css_analyze/src/lint/nursery/no_descending_specificity.rs index 24f637375124..620938a9542b 100644 --- a/crates/biome_css_analyze/src/lint/nursery/no_descending_specificity.rs +++ b/crates/biome_css_analyze/src/lint/nursery/no_descending_specificity.rs @@ -4,6 +4,7 @@ use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnosti use biome_console::markup; use biome_css_semantic::model::{Rule as CssSemanticRule, RuleId, SemanticModel, Specificity}; use biome_css_syntax::{AnyCssSelector, CssRoot}; +use biome_diagnostics::Severity; use biome_rowan::TextRange; use biome_rowan::AstNode; @@ -76,6 +77,7 @@ declare_lint_rule! { name: "noDescendingSpecificity", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("no-descending-specificity")], } } diff --git a/crates/biome_css_analyze/src/lint/nursery/no_duplicate_custom_properties.rs b/crates/biome_css_analyze/src/lint/nursery/no_duplicate_custom_properties.rs index 9f11cc872b36..0b03b6523f6f 100644 --- a/crates/biome_css_analyze/src/lint/nursery/no_duplicate_custom_properties.rs +++ b/crates/biome_css_analyze/src/lint/nursery/no_duplicate_custom_properties.rs @@ -3,6 +3,7 @@ use std::collections::hash_map::Entry; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; use biome_css_syntax::CssDeclarationOrRuleList; +use biome_diagnostics::Severity; use biome_rowan::{AstNode, TextRange}; use rustc_hash::FxHashMap; @@ -40,6 +41,7 @@ declare_lint_rule! { name: "noDuplicateCustomProperties", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("declaration-block-no-duplicate-custom-properties")], } } diff --git a/crates/biome_css_analyze/src/lint/nursery/no_duplicate_properties.rs b/crates/biome_css_analyze/src/lint/nursery/no_duplicate_properties.rs index 743e964a3d52..64c747053ffd 100644 --- a/crates/biome_css_analyze/src/lint/nursery/no_duplicate_properties.rs +++ b/crates/biome_css_analyze/src/lint/nursery/no_duplicate_properties.rs @@ -3,6 +3,7 @@ use std::{borrow::Cow, collections::hash_map::Entry}; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; use biome_css_syntax::CssDeclarationOrRuleList; +use biome_diagnostics::Severity; use biome_rowan::{AstNode, TextRange}; use biome_string_case::StrOnlyExtension; use rustc_hash::FxHashMap; @@ -39,6 +40,7 @@ declare_lint_rule! { name: "noDuplicateProperties", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("declaration-block-no-duplicate-properties")], } } diff --git a/crates/biome_css_analyze/src/lint/nursery/no_missing_var_function.rs b/crates/biome_css_analyze/src/lint/nursery/no_missing_var_function.rs index edaab6c51072..fdaf757a7cd8 100644 --- a/crates/biome_css_analyze/src/lint/nursery/no_missing_var_function.rs +++ b/crates/biome_css_analyze/src/lint/nursery/no_missing_var_function.rs @@ -1,6 +1,7 @@ use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; use biome_css_syntax::{AnyCssProperty, CssDashedIdentifier, CssDeclaration, CssSyntaxKind}; +use biome_diagnostics::Severity; use biome_rowan::AstNode; use crate::services::semantic::Semantic; @@ -117,6 +118,7 @@ declare_lint_rule! { name: "noMissingVarFunction", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("custom-property-no-missing-var-function")], } } diff --git a/crates/biome_css_analyze/src/lint/nursery/no_unknown_pseudo_class.rs b/crates/biome_css_analyze/src/lint/nursery/no_unknown_pseudo_class.rs index cfea199ad1b1..ddc7731b173d 100644 --- a/crates/biome_css_analyze/src/lint/nursery/no_unknown_pseudo_class.rs +++ b/crates/biome_css_analyze/src/lint/nursery/no_unknown_pseudo_class.rs @@ -13,6 +13,7 @@ use biome_css_syntax::{ CssPseudoClassFunctionSelector, CssPseudoClassFunctionSelectorList, CssPseudoClassFunctionValueList, CssPseudoClassIdentifier, CssPseudoElementSelector, }; +use biome_diagnostics::Severity; use biome_rowan::{declare_node_union, AstNode, TextRange}; use biome_string_case::StrLikeExtension; @@ -62,6 +63,7 @@ declare_lint_rule! { name: "noUnknownPseudoClass", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("selector-pseudo-class-no-unknown")], } } diff --git a/crates/biome_css_analyze/src/lint/nursery/no_unknown_pseudo_element.rs b/crates/biome_css_analyze/src/lint/nursery/no_unknown_pseudo_element.rs index 031268a4d303..5e9136c43e2a 100644 --- a/crates/biome_css_analyze/src/lint/nursery/no_unknown_pseudo_element.rs +++ b/crates/biome_css_analyze/src/lint/nursery/no_unknown_pseudo_element.rs @@ -3,6 +3,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_css_syntax::{AnyCssPseudoElement, CssPseudoElementSelector}; +use biome_diagnostics::Severity; use biome_rowan::AstNode; use biome_string_case::StrLikeExtension; @@ -54,6 +55,7 @@ declare_lint_rule! { name: "noUnknownPseudoElement", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("selector-pseudo-element-no-unknown")], } } diff --git a/crates/biome_css_analyze/src/lint/nursery/no_unknown_type_selector.rs b/crates/biome_css_analyze/src/lint/nursery/no_unknown_type_selector.rs index 17427c32929e..6226a580f19b 100644 --- a/crates/biome_css_analyze/src/lint/nursery/no_unknown_type_selector.rs +++ b/crates/biome_css_analyze/src/lint/nursery/no_unknown_type_selector.rs @@ -3,6 +3,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_css_syntax::CssTypeSelector; +use biome_diagnostics::Severity; use biome_rowan::AstNode; use crate::utils::is_known_type_selector; @@ -54,6 +55,7 @@ declare_lint_rule! { name: "noUnknownTypeSelector", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("selector-type-no-unknown")], } } diff --git a/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_at_import_rules.rs b/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_at_import_rules.rs index 5ea9f5b61238..886686e54743 100644 --- a/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_at_import_rules.rs +++ b/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_at_import_rules.rs @@ -5,6 +5,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_css_syntax::{AnyCssAtRule, AnyCssRule, CssImportAtRule, CssRuleList}; +use biome_diagnostics::Severity; use biome_rowan::AstNode; use biome_string_case::StrOnlyExtension; @@ -51,6 +52,7 @@ declare_lint_rule! { name: "noDuplicateAtImportRules", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("no-duplicate-at-import-rules")], } } diff --git a/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs b/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs index 443dc125171f..9f64f31701ef 100644 --- a/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs +++ b/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs @@ -5,6 +5,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_css_syntax::{AnyCssGenericComponentValue, AnyCssValue, CssGenericProperty}; +use biome_diagnostics::Severity; use biome_rowan::{AstNode, TextRange}; use biome_string_case::StrLikeExtension; @@ -48,6 +49,7 @@ declare_lint_rule! { name: "noDuplicateFontNames", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("font-family-no-duplicate-names")], } } diff --git a/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_selectors_keyframe_block.rs b/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_selectors_keyframe_block.rs index 3f793f44e5d5..2c03011f4051 100644 --- a/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_selectors_keyframe_block.rs +++ b/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_selectors_keyframe_block.rs @@ -5,6 +5,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_css_syntax::{AnyCssKeyframesItem, AnyCssKeyframesSelector, CssKeyframesBlock}; +use biome_diagnostics::Severity; use biome_rowan::AstNode; use biome_string_case::StrLikeExtension; @@ -42,6 +43,7 @@ declare_lint_rule! { name: "noDuplicateSelectorsKeyframeBlock", language: "css", recommended: true, + severity: Severity::Error, sources:&[RuleSource::Stylelint("keyframe-block-no-duplicate-selectors")], } } diff --git a/crates/biome_css_analyze/src/lint/suspicious/no_empty_block.rs b/crates/biome_css_analyze/src/lint/suspicious/no_empty_block.rs index e9d883511646..244d26bb266c 100644 --- a/crates/biome_css_analyze/src/lint/suspicious/no_empty_block.rs +++ b/crates/biome_css_analyze/src/lint/suspicious/no_empty_block.rs @@ -3,6 +3,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_css_syntax::stmt_ext::CssBlockLike; +use biome_diagnostics::Severity; use biome_rowan::AstNode; declare_lint_rule! { @@ -47,6 +48,7 @@ declare_lint_rule! { name: "noEmptyBlock", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("block-no-empty")], } } diff --git a/crates/biome_css_analyze/src/lint/suspicious/no_important_in_keyframe.rs b/crates/biome_css_analyze/src/lint/suspicious/no_important_in_keyframe.rs index 3afd63572032..e0a8fa79ca84 100644 --- a/crates/biome_css_analyze/src/lint/suspicious/no_important_in_keyframe.rs +++ b/crates/biome_css_analyze/src/lint/suspicious/no_important_in_keyframe.rs @@ -5,6 +5,7 @@ use biome_console::markup; use biome_css_syntax::{ AnyCssDeclarationBlock, AnyCssKeyframesItem, CssDeclarationImportant, CssKeyframesBlock, }; +use biome_diagnostics::Severity; use biome_rowan::AstNode; declare_lint_rule! { @@ -45,6 +46,7 @@ declare_lint_rule! { name: "noImportantInKeyframe", language: "css", recommended: true, + severity: Severity::Error, sources:&[RuleSource::Stylelint("keyframe-declaration-no-important")], } } diff --git a/crates/biome_css_analyze/src/lint/suspicious/no_shorthand_property_overrides.rs b/crates/biome_css_analyze/src/lint/suspicious/no_shorthand_property_overrides.rs index 7cfc2b7da87d..edf3ae960698 100644 --- a/crates/biome_css_analyze/src/lint/suspicious/no_shorthand_property_overrides.rs +++ b/crates/biome_css_analyze/src/lint/suspicious/no_shorthand_property_overrides.rs @@ -5,6 +5,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_css_syntax::{AnyCssDeclarationName, CssGenericProperty, CssLanguage, CssSyntaxKind}; +use biome_diagnostics::Severity; use biome_rowan::{AstNode, Language, SyntaxNode, TextRange, WalkEvent}; fn remove_vendor_prefix<'a>(prop: &'a str, prefix: &'a str) -> &'a str { @@ -72,6 +73,7 @@ declare_lint_rule! { name: "noShorthandPropertyOverrides", language: "css", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Stylelint("declaration-block-no-shorthand-property-overrides")], } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_access_key.rs b/crates/biome_js_analyze/src/lint/a11y/no_access_key.rs index dbc739c28b37..7070f2da6578 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_access_key.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_access_key.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{jsx_ext::AnyJsxElement, JsxAttribute, JsxAttributeList}; use biome_rowan::{AstNode, BatchMutationExt}; @@ -41,6 +42,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("no-access-key")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_aria_hidden_on_focusable.rs b/crates/biome_js_analyze/src/lint/a11y/no_aria_hidden_on_focusable.rs index ca562b4ab2e9..718ba3e0c96d 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_aria_hidden_on_focusable.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_aria_hidden_on_focusable.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{jsx_ext::AnyJsxElement, AnyJsxAttributeValue, AnyNumberLikeExpression}; use biome_rowan::{AstNode, BatchMutationExt}; @@ -51,6 +52,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("no-aria-hidden-on-focusable")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_aria_unsupported_elements.rs b/crates/biome_js_analyze/src/lint/a11y/no_aria_unsupported_elements.rs index 392d0b481e07..436084b752c6 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_aria_unsupported_elements.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_aria_unsupported_elements.rs @@ -6,6 +6,7 @@ use biome_analyze::{ }; use biome_aria_metadata::AriaAttribute; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_rowan::{AstNode, AstNodeList, BatchMutationExt}; @@ -41,6 +42,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("aria-unsupported-elements")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_autofocus.rs b/crates/biome_js_analyze/src/lint/a11y/no_autofocus.rs index 9b52a095cfa6..b84a6202d19f 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_autofocus.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_autofocus.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{jsx_ext::AnyJsxElement, JsxAttribute}; use biome_rowan::{AstNode, BatchMutationExt}; @@ -61,6 +62,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("no-autofocus")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_blank_target.rs b/crates/biome_js_analyze/src/lint/a11y/no_blank_target.rs index 56eaf57ed2d9..4a02100e6ce5 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_blank_target.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_blank_target.rs @@ -3,6 +3,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; use biome_deserialize_macros::Deserializable; +use biome_diagnostics::Severity; use biome_js_factory::make::{ jsx_attribute, jsx_attribute_initializer_clause, jsx_attribute_list, jsx_ident, jsx_name, jsx_string, jsx_string_literal, token, @@ -78,6 +79,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintReact("jsx-no-target-blank")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_distracting_elements.rs b/crates/biome_js_analyze/src/lint/a11y/no_distracting_elements.rs index 9fcddffc1840..a5b5e748c88b 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_distracting_elements.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_distracting_elements.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_js_syntax::*; use biome_rowan::{AstNode, BatchMutationExt}; @@ -42,6 +43,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("no-distracting-elements")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_header_scope.rs b/crates/biome_js_analyze/src/lint/a11y/no_header_scope.rs index 731c56fa526b..2fe27e966cb0 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_header_scope.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_header_scope.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_rowan::{AstNode, BatchMutationExt}; @@ -42,6 +43,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("scope")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_interactive_element_to_noninteractive_role.rs b/crates/biome_js_analyze/src/lint/a11y/no_interactive_element_to_noninteractive_role.rs index 3098a67c70de..ee52d54060d5 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_interactive_element_to_noninteractive_role.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_interactive_element_to_noninteractive_role.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_rowan::{AstNode, BatchMutationExt}; @@ -41,6 +42,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("no-interactive-element-to-noninteractive-role")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_label_without_control.rs b/crates/biome_js_analyze/src/lint/a11y/no_label_without_control.rs index 76470398ec3d..d53a01314f0d 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_label_without_control.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_label_without_control.rs @@ -3,6 +3,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_deserialize_macros::Deserializable; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsxAttribute, AnyJsxAttributeName, AnyJsxAttributeValue, AnyJsxElementName, AnyJsxTag, JsSyntaxKind, JsxAttribute, @@ -90,6 +91,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("label-has-associated-control")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_noninteractive_element_to_interactive_role.rs b/crates/biome_js_analyze/src/lint/a11y/no_noninteractive_element_to_interactive_role.rs index e37e5ff3cbc3..d680da3a1166 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_noninteractive_element_to_interactive_role.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_noninteractive_element_to_interactive_role.rs @@ -3,6 +3,7 @@ use crate::JsRuleAction; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_rowan::{AstNode, BatchMutationExt, TextRange}; @@ -50,6 +51,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("no-noninteractive-element-to-interactive-role")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_noninteractive_tabindex.rs b/crates/biome_js_analyze/src/lint/a11y/no_noninteractive_tabindex.rs index aea24613963c..001858607d8d 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_noninteractive_tabindex.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_noninteractive_tabindex.rs @@ -4,6 +4,7 @@ use biome_analyze::{ }; use biome_aria::AriaRoles; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ jsx_ext::AnyJsxElement, AnyJsxAttributeValue, AnyNumberLikeExpression, TextRange, }; @@ -52,6 +53,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("no-noninteractive-tabindex")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_positive_tabindex.rs b/crates/biome_js_analyze/src/lint/a11y/no_positive_tabindex.rs index 937dd47c4464..61c1b0b973b9 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_positive_tabindex.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_positive_tabindex.rs @@ -4,6 +4,7 @@ use crate::JsRuleAction; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_factory::make::{jsx_string, jsx_string_literal}; use biome_js_semantic::SemanticModel; @@ -53,6 +54,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("tabindex-no-positive")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_redundant_alt.rs b/crates/biome_js_analyze/src/lint/a11y/no_redundant_alt.rs index e378cd21d513..c7e61812b4c7 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_redundant_alt.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_redundant_alt.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_js_syntax::{ AnyJsExpression, AnyJsLiteralExpression, AnyJsTemplateElement, AnyJsxAttributeValue, @@ -46,6 +47,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("img-redundant-alt")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_redundant_roles.rs b/crates/biome_js_analyze/src/lint/a11y/no_redundant_roles.rs index e873569b6dd6..628ab6311618 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_redundant_roles.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_redundant_roles.rs @@ -4,6 +4,7 @@ use biome_analyze::{ }; use biome_aria::{roles::AriaRoleDefinition, AriaRoles}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ jsx_ext::AnyJsxElement, AnyJsxAttributeValue, JsxAttribute, JsxAttributeList, }; @@ -48,6 +49,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("no-redundant-roles")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/no_svg_without_title.rs b/crates/biome_js_analyze/src/lint/a11y/no_svg_without_title.rs index 55d4486b55a7..febdb8846168 100644 --- a/crates/biome_js_analyze/src/lint/a11y/no_svg_without_title.rs +++ b/crates/biome_js_analyze/src/lint/a11y/no_svg_without_title.rs @@ -1,5 +1,6 @@ use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{jsx_ext::AnyJsxElement, JsxAttribute, JsxChildList, JsxElement}; use biome_rowan::{AstNode, AstNodeList}; use biome_string_case::StrLikeExtension; @@ -102,6 +103,7 @@ declare_lint_rule! { name: "noSvgWithoutTitle", language: "jsx", recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_alt_text.rs b/crates/biome_js_analyze/src/lint/a11y/use_alt_text.rs index 475a455bc209..43e5e131fdcb 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_alt_text.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_alt_text.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::{fmt::Display, fmt::Formatter, markup}; +use biome_diagnostics::Severity; use biome_js_syntax::{jsx_ext::AnyJsxElement, static_value::StaticValue, TextRange}; use biome_rowan::AstNode; @@ -51,6 +52,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("alt-text")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_anchor_content.rs b/crates/biome_js_analyze/src/lint/a11y/use_anchor_content.rs index 8677edc709fb..2003dc1cc320 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_anchor_content.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_anchor_content.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_js_syntax::JsxElement; use biome_rowan::{AstNode, BatchMutationExt}; @@ -69,6 +70,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("anchor-has-content")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_aria_activedescendant_with_tabindex.rs b/crates/biome_js_analyze/src/lint/a11y/use_aria_activedescendant_with_tabindex.rs index 09622a3c276e..599e0ea00c20 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_aria_activedescendant_with_tabindex.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_aria_activedescendant_with_tabindex.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make::{ jsx_attribute, jsx_attribute_initializer_clause, jsx_attribute_list, jsx_ident, jsx_name, jsx_string, jsx_string_literal, token, @@ -53,6 +54,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("aria-activedescendant-has-tabindex")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_aria_props_for_role.rs b/crates/biome_js_analyze/src/lint/a11y/use_aria_props_for_role.rs index 779f6bd3463d..0a21bda25ee9 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_aria_props_for_role.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_aria_props_for_role.rs @@ -2,6 +2,7 @@ use crate::services::aria::Aria; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_js_syntax::JsxAttribute; use biome_rowan::AstNode; @@ -44,6 +45,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("role-has-required-aria-props")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_button_type.rs b/crates/biome_js_analyze/src/lint/a11y/use_button_type.rs index 8ed0e5b415b2..896f1763040a 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_button_type.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_button_type.rs @@ -3,6 +3,7 @@ use crate::services::semantic::Semantic; use biome_analyze::RuleSource; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsxElementName, JsCallExpression, JsxAttribute, JsxOpeningElement, JsxSelfClosingElement, TextRange, @@ -42,6 +43,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintReact("button-has-type")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_focusable_interactive.rs b/crates/biome_js_analyze/src/lint/a11y/use_focusable_interactive.rs index 3f577299ac85..3b7151c82c0a 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_focusable_interactive.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_focusable_interactive.rs @@ -1,6 +1,7 @@ use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_aria::AriaRoles; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{jsx_ext::AnyJsxElement, AnyJsxAttributeValue}; use biome_rowan::AstNode; @@ -43,6 +44,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("interactive-supports-focus")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_heading_content.rs b/crates/biome_js_analyze/src/lint/a11y/use_heading_content.rs index 40e605ca00b2..9fdaed57111d 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_heading_content.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_heading_content.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{jsx_ext::AnyJsxElement, JsxElement}; use biome_rowan::AstNode; @@ -61,6 +62,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("heading-has-content")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_html_lang.rs b/crates/biome_js_analyze/src/lint/a11y/use_html_lang.rs index 7ca8f1403398..7e3de4af03b6 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_html_lang.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_html_lang.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{jsx_ext::AnyJsxElement, TextRange}; use biome_rowan::AstNode; @@ -60,6 +61,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("html-has-lang")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_iframe_title.rs b/crates/biome_js_analyze/src/lint/a11y/use_iframe_title.rs index ae92a070923e..0d8ab3bd449e 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_iframe_title.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_iframe_title.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_rowan::AstNode; @@ -66,6 +67,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("iframe-has-title")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_key_with_click_events.rs b/crates/biome_js_analyze/src/lint/a11y/use_key_with_click_events.rs index 53da1f1412a2..5cb303054d68 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_key_with_click_events.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_key_with_click_events.rs @@ -4,6 +4,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{jsx_ext::AnyJsxElement, AnyJsxAttribute, AnyJsxElementName}; use biome_rowan::AstNode; use biome_string_case::StrLikeExtension; @@ -63,6 +64,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("click-events-have-key-events")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_key_with_mouse_events.rs b/crates/biome_js_analyze/src/lint/a11y/use_key_with_mouse_events.rs index 559f52e11097..d955a64cccad 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_key_with_mouse_events.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_key_with_mouse_events.rs @@ -2,6 +2,7 @@ use crate::services::semantic::Semantic; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::{markup, MarkupBuf}; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_rowan::AstNode; @@ -45,6 +46,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("mouse-events-have-key-events")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_media_caption.rs b/crates/biome_js_analyze/src/lint/a11y/use_media_caption.rs index f70c39444cbd..e7c59bd94a74 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_media_caption.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_media_caption.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_js_syntax::{AnyJsxChild, JsxElement, TextRange}; use biome_rowan::AstNode; @@ -37,6 +38,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("media-has-caption")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_semantic_elements.rs b/crates/biome_js_analyze/src/lint/a11y/use_semantic_elements.rs index 8d2f02717448..4273f7cf8b25 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_semantic_elements.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_semantic_elements.rs @@ -1,6 +1,7 @@ use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_aria::AriaRoles; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsxAttribute, JsxOpeningElement}; use biome_rowan::TextRange; @@ -46,6 +47,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("prefer-tag-over-role")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs b/crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs index d615ef49f9df..845d0f071f02 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; use biome_console::{markup, MarkupBuf}; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_rowan::{AstNode, TextRange}; @@ -77,6 +78,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("anchor-is-valid")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_valid_aria_props.rs b/crates/biome_js_analyze/src/lint/a11y/use_valid_aria_props.rs index d8322cbecf83..3629df982de3 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_valid_aria_props.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_valid_aria_props.rs @@ -5,6 +5,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_aria_metadata::AriaAttribute; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_js_syntax::JsxAttribute; use biome_rowan::{AstNode, AstNodeList, BatchMutationExt}; @@ -32,6 +33,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("aria-props")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_valid_aria_role.rs b/crates/biome_js_analyze/src/lint/a11y/use_valid_aria_role.rs index 227d32ed972a..b0b7e58b49ac 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_valid_aria_role.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_valid_aria_role.rs @@ -4,6 +4,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_deserialize_macros::Deserializable; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_rowan::{AstNode, BatchMutationExt}; use serde::{Deserialize, Serialize}; @@ -69,6 +70,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("aria-role")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_valid_aria_values.rs b/crates/biome_js_analyze/src/lint/a11y/use_valid_aria_values.rs index f936db5f4509..031b230b3a3e 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_valid_aria_values.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_valid_aria_values.rs @@ -4,6 +4,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; use biome_aria_metadata::{AriaAttribute, AriaValueType}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsSyntaxToken, JsxAttribute, TextRange}; use biome_rowan::AstNode; @@ -53,6 +54,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("aria-proptypes")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/a11y/use_valid_lang.rs b/crates/biome_js_analyze/src/lint/a11y/use_valid_lang.rs index 5da78b1f8c2e..921e3f9783ed 100644 --- a/crates/biome_js_analyze/src/lint/a11y/use_valid_lang.rs +++ b/crates/biome_js_analyze/src/lint/a11y/use_valid_lang.rs @@ -2,6 +2,7 @@ use crate::services::aria::Aria; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_rowan::{AstNode, TextRange}; declare_lint_rule! { @@ -34,6 +35,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintJsxA11y("lang")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_banned_types.rs b/crates/biome_js_analyze/src/lint/complexity/no_banned_types.rs index 1e92856a6508..f9bac6b1580b 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_banned_types.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_banned_types.rs @@ -3,6 +3,7 @@ use std::fmt::Display; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ JsReferenceIdentifier, JsSyntaxKind, TextRange, TsIntersectionTypeElementList, TsObjectType, @@ -93,6 +94,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("ban-types")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_empty_type_parameters.rs b/crates/biome_js_analyze/src/lint/complexity/no_empty_type_parameters.rs index c9157cffc961..218d151789ae 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_empty_type_parameters.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_empty_type_parameters.rs @@ -1,6 +1,7 @@ use biome_analyze::Ast; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsSyntaxKind, TsTypeParameters}; use biome_rowan::{AstNode, AstSeparatedList, SyntaxNodeOptionExt}; @@ -39,6 +40,7 @@ declare_lint_rule! { name: "noEmptyTypeParameters", language: "ts", recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_excessive_nested_test_suites.rs b/crates/biome_js_analyze/src/lint/complexity/no_excessive_nested_test_suites.rs index adfebd34ca68..bac319562aad 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_excessive_nested_test_suites.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_excessive_nested_test_suites.rs @@ -3,6 +3,7 @@ use biome_analyze::{ RuleDiagnostic, RuleSource, RuleSourceKind, ServiceBag, Visitor, VisitorContext, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsCallExpression, JsLanguage, JsStaticMemberExpression}; use biome_rowan::{AstNode, Language, SyntaxNode, SyntaxNodeOptionExt, TextRange, WalkEvent}; @@ -56,6 +57,7 @@ declare_lint_rule! { name: "noExcessiveNestedTestSuites", language: "js", recommended: true, + severity: Severity::Error, sources: &[RuleSource::EslintJest("max-nested-describe")], source_kind: RuleSourceKind::SameLogic, } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_extra_boolean_cast.rs b/crates/biome_js_analyze/src/lint/complexity/no_extra_boolean_cast.rs index c3d43fd1e6f8..6d28b2f1ea24 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_extra_boolean_cast.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_extra_boolean_cast.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ is_in_boolean_context, is_negation, AnyJsExpression, JsCallArgumentList, JsCallArguments, JsCallExpression, JsNewExpression, JsSyntaxNode, JsUnaryOperator, @@ -59,6 +60,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-extra-boolean-cast")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_for_each.rs b/crates/biome_js_analyze/src/lint/complexity/no_for_each.rs index 5a68f872ce93..139268c6233d 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_for_each.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_for_each.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{AnyJsExpression, AnyJsMemberExpression, JsCallExpression}; use biome_rowan::{AstNode, AstSeparatedList}; @@ -69,6 +70,7 @@ declare_lint_rule! { RuleSource::Clippy("needless_for_each"), ], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_multiple_spaces_in_regular_expression_literals.rs b/crates/biome_js_analyze/src/lint/complexity/no_multiple_spaces_in_regular_expression_literals.rs index c77c145887a0..79d1153409c1 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_multiple_spaces_in_regular_expression_literals.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_multiple_spaces_in_regular_expression_literals.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsRegexLiteralExpression, JsSyntaxKind, JsSyntaxToken, TextRange, TextSize}; use biome_rowan::BatchMutationExt; use std::{fmt::Write, ops::Range}; @@ -50,6 +51,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-regex-spaces")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_static_only_class.rs b/crates/biome_js_analyze/src/lint/complexity/no_static_only_class.rs index e64740ec11b3..59b284e1c677 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_static_only_class.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_static_only_class.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsClass, AnyJsClassMember, JsGetterClassMember, JsMethodClassMember, JsPropertyClassMember, JsSetterClassMember, TsGetterSignatureClassMember, TsIndexSignatureClassMember, @@ -99,6 +100,7 @@ declare_lint_rule! { RuleSource::EslintUnicorn("no-static-only-class"), ], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_this_in_static.rs b/crates/biome_js_analyze/src/lint/complexity/no_this_in_static.rs index 767d4dffd0ee..0f1ae1da17c1 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_this_in_static.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_this_in_static.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsClass, AnyJsClassMember, AnyJsExpression, JsArrowFunctionExpression, JsSuperExpression, @@ -82,6 +83,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::EslintMysticatea("no-this-in-static")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_useless_catch.rs b/crates/biome_js_analyze/src/lint/complexity/no_useless_catch.rs index 02b67e794990..3d0be8e5c226 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_useless_catch.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_useless_catch.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{AnyJsTryStatement, JsStatementList, TextRange}; use biome_rowan::{AstNode, AstNodeList, BatchMutationExt}; @@ -69,6 +70,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-useless-catch")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_useless_constructor.rs b/crates/biome_js_analyze/src/lint/complexity/no_useless_constructor.rs index 1c1bc0be579f..1b302e17ac1d 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_useless_constructor.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_useless_constructor.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsCallArgument, AnyJsClass, AnyJsConstructorParameter, AnyJsFormalParameter, JsCallExpression, JsConstructorClassMember, @@ -122,6 +123,7 @@ declare_lint_rule! { RuleSource::EslintTypeScript("no-useless-constructor"), ], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_useless_empty_export.rs b/crates/biome_js_analyze/src/lint/complexity/no_useless_empty_export.rs index 9b0591e76666..b88ed330cc1f 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_useless_empty_export.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_useless_empty_export.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{AnyJsModuleItem, JsExport, JsModuleItemList, JsSyntaxToken}; use biome_rowan::{AstNode, AstSeparatedList, BatchMutationExt}; @@ -46,6 +47,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("no-useless-empty-export")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_useless_fragments.rs b/crates/biome_js_analyze/src/lint/complexity/no_useless_fragments.rs index 113f3d0d5f3a..a0ca193ee44c 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_useless_fragments.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_useless_fragments.rs @@ -4,6 +4,7 @@ use crate::JsRuleAction; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make::{ js_string_literal_expression, jsx_expression_child, jsx_string, jsx_string_literal, jsx_tag_expression, token, JsxExpressionChildBuilder, @@ -64,6 +65,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintReact("jsx-no-useless-fragment")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_useless_label.rs b/crates/biome_js_analyze/src/lint/complexity/no_useless_label.rs index e57020687cbc..31173c63494c 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_useless_label.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_useless_label.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{AnyJsStatement, JsLabeledStatement, JsSyntaxKind}; use crate::JsRuleAction; @@ -37,6 +38,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-extra-label")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_useless_lone_block_statements.rs b/crates/biome_js_analyze/src/lint/complexity/no_useless_lone_block_statements.rs index 05cf42d5d849..e66f2e370eff 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_useless_lone_block_statements.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_useless_lone_block_statements.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsStatement, AnyJsSwitchClause, JsBlockStatement, JsFileSource, JsLabeledStatement, @@ -47,6 +48,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-lone-blocks")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_useless_rename.rs b/crates/biome_js_analyze/src/lint/complexity/no_useless_rename.rs index 20f300fd530a..7984536a1b90 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_useless_rename.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_useless_rename.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsExportNamedSpecifier, AnyJsNamedImportSpecifier, AnyJsObjectBindingPatternMember, @@ -62,6 +63,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-useless-rename")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_useless_switch_case.rs b/crates/biome_js_analyze/src/lint/complexity/no_useless_switch_case.rs index a357b5323351..e6979800e838 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_useless_switch_case.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_useless_switch_case.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{AnyJsSwitchClause, JsCaseClause, JsDefaultClause}; use biome_rowan::{AstNode, AstNodeList, BatchMutationExt, Direction}; @@ -62,6 +63,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::EslintUnicorn("no-useless-switch-case")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_useless_ternary.rs b/crates/biome_js_analyze/src/lint/complexity/no_useless_ternary.rs index 64934d58d2dc..ed1dd7cdfc7e 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_useless_ternary.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_useless_ternary.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsExpression, AnyJsLiteralExpression, JsConditionalExpression, JsSyntaxKind, @@ -57,6 +58,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-unneeded-ternary")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_useless_this_alias.rs b/crates/biome_js_analyze/src/lint/complexity/no_useless_this_alias.rs index 71422314538f..b33ae1743a15 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_useless_this_alias.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_useless_this_alias.rs @@ -6,6 +6,7 @@ use biome_analyze::{ RuleSourceKind, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_semantic::ReferencesExtensions; use biome_js_syntax::{ @@ -57,6 +58,7 @@ declare_lint_rule! { sources: &[RuleSource::EslintTypeScript("no-this-alias")], source_kind: RuleSourceKind::Inspired, recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_useless_type_constraint.rs b/crates/biome_js_analyze/src/lint/complexity/no_useless_type_constraint.rs index 211a35047220..9885f41c074b 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_useless_type_constraint.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_useless_type_constraint.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ @@ -81,6 +82,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("no-unnecessary-type-constraint")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/no_with.rs b/crates/biome_js_analyze/src/lint/complexity/no_with.rs index 7fc07b32b91b..8c667b8ff6ae 100644 --- a/crates/biome_js_analyze/src/lint/complexity/no_with.rs +++ b/crates/biome_js_analyze/src/lint/complexity/no_with.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::JsWithStatement; use biome_rowan::AstNode; @@ -28,6 +29,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-with")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/use_arrow_function.rs b/crates/biome_js_analyze/src/lint/complexity/use_arrow_function.rs index 7f2aee7e662f..54058ef88db0 100644 --- a/crates/biome_js_analyze/src/lint/complexity/use_arrow_function.rs +++ b/crates/biome_js_analyze/src/lint/complexity/use_arrow_function.rs @@ -4,6 +4,7 @@ use biome_analyze::{ Rule, RuleDiagnostic, RuleSource, RuleSourceKind, ServiceBag, Visitor, VisitorContext, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsExpression, AnyJsFunctionBody, AnyJsStatement, JsConstructorClassMember, JsFileSource, @@ -72,6 +73,7 @@ declare_lint_rule! { sources: &[RuleSource::Eslint("prefer-arrow-callback")], source_kind: RuleSourceKind::Inspired, recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/use_flat_map.rs b/crates/biome_js_analyze/src/lint/complexity/use_flat_map.rs index 39aac2d1f351..3bdec8b1c3d1 100644 --- a/crates/biome_js_analyze/src/lint/complexity/use_flat_map.rs +++ b/crates/biome_js_analyze/src/lint/complexity/use_flat_map.rs @@ -2,6 +2,7 @@ use crate::JsRuleAction; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make::{ident, js_name}; use biome_js_syntax::{AnyJsExpression, AnyJsMemberExpression, AnyJsName, JsCallExpression}; use biome_rowan::{AstNode, AstSeparatedList, BatchMutationExt}; @@ -39,6 +40,7 @@ declare_lint_rule! { RuleSource::Clippy("map_flatten"), ], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/use_literal_keys.rs b/crates/biome_js_analyze/src/lint/complexity/use_literal_keys.rs index 83735f02bad9..087f4f49d715 100644 --- a/crates/biome_js_analyze/src/lint/complexity/use_literal_keys.rs +++ b/crates/biome_js_analyze/src/lint/complexity/use_literal_keys.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsAssignment, AnyJsComputedMember, AnyJsMemberExpression, AnyJsName, AnyJsObjectMemberName, @@ -52,6 +53,7 @@ declare_lint_rule! { RuleSource::EslintTypeScript("dot-notation") ], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/use_optional_chain.rs b/crates/biome_js_analyze/src/lint/complexity/use_optional_chain.rs index feb628887608..12b67b6bb04b 100644 --- a/crates/biome_js_analyze/src/lint/complexity/use_optional_chain.rs +++ b/crates/biome_js_analyze/src/lint/complexity/use_optional_chain.rs @@ -1,6 +1,7 @@ use biome_analyze::RuleSource; use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsExpression, AnyJsMemberExpression, AnyJsName, JsLogicalExpression, JsLogicalOperator, @@ -76,6 +77,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::EslintTypeScript("prefer-optional-chain")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/use_regex_literals.rs b/crates/biome_js_analyze/src/lint/complexity/use_regex_literals.rs index 99f456b5fa71..9a7d3a292646 100644 --- a/crates/biome_js_analyze/src/lint/complexity/use_regex_literals.rs +++ b/crates/biome_js_analyze/src/lint/complexity/use_regex_literals.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make::js_regex_literal_expression; use biome_js_semantic::SemanticModel; use biome_js_syntax::{ @@ -48,6 +49,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("prefer-regex-literals")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/complexity/use_simple_number_keys.rs b/crates/biome_js_analyze/src/lint/complexity/use_simple_number_keys.rs index 1799f677ddcc..084390c445f1 100644 --- a/crates/biome_js_analyze/src/lint/complexity/use_simple_number_keys.rs +++ b/crates/biome_js_analyze/src/lint/complexity/use_simple_number_keys.rs @@ -2,6 +2,7 @@ use crate::JsRuleAction; use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsObjectMember, JsLiteralMemberName, JsObjectExpression, JsSyntaxKind, JsSyntaxToken, @@ -47,6 +48,7 @@ declare_lint_rule! { name: "useSimpleNumberKeys", language: "js", recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs b/crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs index 1408ec243157..28f9fd241eac 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs @@ -3,6 +3,7 @@ use crate::services::semantic::Semantic; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsCallExpression, JsxAttribute}; use biome_rowan::{declare_node_union, AstNode, TextRange}; declare_lint_rule! { @@ -28,6 +29,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintReact("no-children-prop")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_const_assign.rs b/crates/biome_js_analyze/src/lint/correctness/no_const_assign.rs index bf90297cd7f8..7d23cd0719ed 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_const_assign.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_const_assign.rs @@ -3,6 +3,7 @@ use crate::JsRuleAction; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make::{self}; use biome_js_syntax::binding_ext::AnyJsBindingDeclaration; use biome_js_syntax::{JsIdentifierAssignment, JsSyntaxKind}; @@ -52,6 +53,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-const-assign")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_constant_condition.rs b/crates/biome_js_analyze/src/lint/correctness/no_constant_condition.rs index 3a0eb139b7ec..a924e5cd4679 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_constant_condition.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_constant_condition.rs @@ -1,6 +1,7 @@ use crate::{services::semantic::Semantic, utils::rename::RenamableNode}; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_semantic::SemanticModel; use biome_js_syntax::{ AnyJsArrayElement, AnyJsExpression, AnyJsLiteralExpression, AnyJsStatement, @@ -85,6 +86,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-constant-condition")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_constructor_return.rs b/crates/biome_js_analyze/src/lint/correctness/no_constructor_return.rs index d7062e887270..e507e38a7589 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_constructor_return.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_constructor_return.rs @@ -2,6 +2,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::RuleSource; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsConstructorClassMember, JsReturnStatement}; use biome_rowan::AstNode; @@ -49,6 +50,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-constructor-return")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_empty_character_class_in_regex.rs b/crates/biome_js_analyze/src/lint/correctness/no_empty_character_class_in_regex.rs index 63317a26c4d0..483c4509c989 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_empty_character_class_in_regex.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_empty_character_class_in_regex.rs @@ -4,6 +4,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::JsRegexLiteralExpression; use biome_rowan::{TextRange, TextSize}; @@ -46,6 +47,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-empty-character-class")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_empty_pattern.rs b/crates/biome_js_analyze/src/lint/correctness/no_empty_pattern.rs index 29f0acfebda0..681eda4cc1b5 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_empty_pattern.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_empty_pattern.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsArrayBindingPattern, JsObjectBindingPattern}; use biome_rowan::{declare_node_union, AstNode, AstSeparatedList}; @@ -40,6 +41,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-empty-pattern")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_flat_map_identity.rs b/crates/biome_js_analyze/src/lint/correctness/no_flat_map_identity.rs index 5f4489e340dc..3fea7ee759a9 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_flat_map_identity.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_flat_map_identity.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make::{ident, js_call_argument_list, js_call_arguments, js_name, token}; use biome_js_syntax::{ AnyJsExpression, AnyJsFunctionBody, AnyJsMemberExpression, AnyJsName, AnyJsStatement, @@ -39,6 +40,7 @@ declare_lint_rule! { name: "noFlatMapIdentity", language: "js", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Clippy("flat_map_identity")], fix_kind: FixKind::Safe, } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_global_object_calls.rs b/crates/biome_js_analyze/src/lint/correctness/no_global_object_calls.rs index f239d57ab161..379a5187537d 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_global_object_calls.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_global_object_calls.rs @@ -1,6 +1,7 @@ use crate::services::semantic::Semantic; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{global_identifier, AnyJsExpression, JsCallExpression, JsNewExpression}; use biome_rowan::{declare_node_union, SyntaxResult, TextRange}; use std::{fmt::Display, str::FromStr}; @@ -89,6 +90,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-obj-calls")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_inner_declarations.rs b/crates/biome_js_analyze/src/lint/correctness/no_inner_declarations.rs index 228f5baf4df2..4205c3e25935 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_inner_declarations.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_inner_declarations.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{AnyJsDeclaration, JsFileSource, JsStatementList, JsSyntaxKind}; use biome_rowan::AstNode; @@ -93,6 +94,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-inner-declarations")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_invalid_builtin_instantiation.rs b/crates/biome_js_analyze/src/lint/correctness/no_invalid_builtin_instantiation.rs index f478a92b18d2..18f8149a5ea0 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_invalid_builtin_instantiation.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_invalid_builtin_instantiation.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ global_identifier, static_value::StaticValue, AnyJsExpression, JsCallExpression, @@ -79,6 +80,7 @@ declare_lint_rule! { RuleSource::Eslint("no-new-native-nonconstructor"), ], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_invalid_constructor_super.rs b/crates/biome_js_analyze/src/lint/correctness/no_invalid_constructor_super.rs index 8d824099200f..1eaa4a8f3681 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_invalid_constructor_super.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_invalid_constructor_super.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; use biome_console::{markup, MarkupBuf}; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsClass, AnyJsExpression, JsAssignmentOperator, JsConstructorClassMember, JsLogicalOperator, }; @@ -51,6 +52,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("constructor-super")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_invalid_use_before_declaration.rs b/crates/biome_js_analyze/src/lint/correctness/no_invalid_use_before_declaration.rs index b884ea27d0ab..a51691d1797f 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_invalid_use_before_declaration.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_invalid_use_before_declaration.rs @@ -1,6 +1,7 @@ use crate::{services::control_flow::AnyJsControlFlowRoot, services::semantic::SemanticServices}; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ binding_ext::{AnyJsBindingDeclaration, AnyJsIdentifierBinding}, AnyJsExportNamedSpecifier, AnyJsIdentifierUsage, @@ -66,6 +67,7 @@ declare_lint_rule! { RuleSource::EslintTypeScript("no-use-before-define"), ], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_nonoctal_decimal_escape.rs b/crates/biome_js_analyze/src/lint/correctness/no_nonoctal_decimal_escape.rs index 1a30d2843bbb..54b5e4cc1b73 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_nonoctal_decimal_escape.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_nonoctal_decimal_escape.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::JsStringLiteralExpression; use biome_rowan::{AstNode, BatchMutationExt, TextRange}; @@ -57,6 +58,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-nonoctal-decimal-escape")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_precision_loss.rs b/crates/biome_js_analyze/src/lint/correctness/no_precision_loss.rs index 1c654443cdf1..fbae5bf70f8d 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_precision_loss.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_precision_loss.rs @@ -4,6 +4,7 @@ use std::ops::RangeInclusive; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::numbers::split_into_radix_and_number; use biome_js_syntax::JsNumberLiteralExpression; @@ -55,6 +56,7 @@ declare_lint_rule! { RuleSource::Clippy("lossy_float_literal") ], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_render_return_value.rs b/crates/biome_js_analyze/src/lint/correctness/no_render_return_value.rs index c2f1924ce89e..9322517ebb52 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_render_return_value.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_render_return_value.rs @@ -3,6 +3,7 @@ use crate::services::semantic::Semantic; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsCallExpression, JsExpressionStatement}; use biome_rowan::AstNode; @@ -34,6 +35,7 @@ declare_lint_rule! { name: "noRenderReturnValue", language: "jsx", recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_self_assign.rs b/crates/biome_js_analyze/src/lint/correctness/no_self_assign.rs index c8e060e8f9d4..fd709abd8646 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_self_assign.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_self_assign.rs @@ -1,6 +1,7 @@ use biome_analyze::RuleSource; use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ inner_string_text, AnyJsArrayAssignmentPatternElement, AnyJsArrayElement, AnyJsAssignment, AnyJsAssignmentPattern, AnyJsExpression, AnyJsLiteralExpression, AnyJsName, @@ -72,6 +73,7 @@ declare_lint_rule! { RuleSource::Clippy("self_assignment"), ], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_setter_return.rs b/crates/biome_js_analyze/src/lint/correctness/no_setter_return.rs index ef38fa71d773..4f642bb0b09e 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_setter_return.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_setter_return.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsReturnStatement, JsSetterClassMember, JsSetterObjectMember}; use biome_rowan::{declare_node_union, AstNode}; @@ -70,6 +71,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-setter-return")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_string_case_mismatch.rs b/crates/biome_js_analyze/src/lint/correctness/no_string_case_mismatch.rs index 4cb4055db236..b928d2c6cebf 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_string_case_mismatch.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_string_case_mismatch.rs @@ -3,6 +3,7 @@ use std::borrow::Cow; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::*; use biome_rowan::{declare_node_union, AstNode, AstSeparatedList, BatchMutationExt}; @@ -39,6 +40,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Clippy("match_str_case_mismatch")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_switch_declarations.rs b/crates/biome_js_analyze/src/lint/correctness/no_switch_declarations.rs index 5e1df3247ba6..45251b54cc8d 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_switch_declarations.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_switch_declarations.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsDeclaration, AnyJsStatement, AnyJsSwitchClause, JsVariableStatement, TriviaPieceKind, T, @@ -74,6 +75,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-case-declarations")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_unnecessary_continue.rs b/crates/biome_js_analyze/src/lint/correctness/no_unnecessary_continue.rs index 57e855415911..8c1d4900f89f 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_unnecessary_continue.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_unnecessary_continue.rs @@ -1,5 +1,6 @@ use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsContinueStatement, JsLabeledStatement, JsSyntaxKind, JsSyntaxNode}; use biome_rowan::{AstNode, BatchMutationExt}; @@ -73,6 +74,7 @@ declare_lint_rule! { name: "noUnnecessaryContinue", language: "js", recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_unreachable.rs b/crates/biome_js_analyze/src/lint/correctness/no_unreachable.rs index 7432d9f608b8..26269fe19c03 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_unreachable.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_unreachable.rs @@ -1,10 +1,12 @@ use std::{cmp::Ordering, collections::VecDeque, num::NonZeroU32, vec::IntoIter}; +use crate::services::control_flow::{ControlFlowGraph, JsControlFlowGraph}; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_control_flow::{ builder::{BlockId, ROOT_BLOCK_ID}, ExceptionHandler, ExceptionHandlerKind, Instruction, InstructionKind, }; +use biome_diagnostics::Severity; use biome_js_syntax::{ JsBlockStatement, JsCaseClause, JsDefaultClause, JsDoWhileStatement, JsForInStatement, JsForOfStatement, JsForStatement, JsFunctionBody, JsIfStatement, JsLabeledStatement, @@ -15,8 +17,6 @@ use biome_rowan::{declare_node_union, AstNode, NodeOrToken}; use roaring::bitmap::RoaringBitmap; use rustc_hash::FxHashMap; -use crate::services::control_flow::{ControlFlowGraph, JsControlFlowGraph}; - declare_lint_rule! { /// Disallow unreachable code /// @@ -53,6 +53,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-unreachable")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_unreachable_super.rs b/crates/biome_js_analyze/src/lint/correctness/no_unreachable_super.rs index 567a1e996df9..f83499b8d06b 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_unreachable_super.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_unreachable_super.rs @@ -4,6 +4,7 @@ use biome_control_flow::{ builder::{BlockId, ROOT_BLOCK_ID}, ExceptionHandlerKind, InstructionKind, }; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsClass, AnyJsExpression, JsCallExpression, JsConstructorClassMember, JsSyntaxKind, JsThrowStatement, TextRange, WalkEvent, @@ -67,6 +68,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-this-before-super")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_unsafe_finally.rs b/crates/biome_js_analyze/src/lint/correctness/no_unsafe_finally.rs index ac2d030884b2..1f92af1d5a55 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_unsafe_finally.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_unsafe_finally.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::*; use biome_rowan::{declare_node_union, AstNode}; @@ -130,6 +131,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-unsafe-finally")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_unsafe_optional_chaining.rs b/crates/biome_js_analyze/src/lint/correctness/no_unsafe_optional_chaining.rs index a15637675d1a..8552ae38c6a2 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_unsafe_optional_chaining.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_unsafe_optional_chaining.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsAssignmentPattern, AnyJsBindingPattern, AnyJsOptionalChainExpression, JsArrayAssignmentPatternElement, JsAssignmentExpression, JsAwaitExpression, JsCallExpression, @@ -69,6 +70,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-unsafe-optional-chaining")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_unused_labels.rs b/crates/biome_js_analyze/src/lint/correctness/no_unused_labels.rs index 17fc12908fe2..173c3288cea2 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_unused_labels.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_unused_labels.rs @@ -4,6 +4,7 @@ use biome_analyze::{ RuleSource, ServiceBag, Visitor, VisitorContext, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsStatement, JsBreakStatement, JsContinueStatement, JsFileSource, JsLabeledStatement, JsLanguage, TextRange, WalkEvent, @@ -64,6 +65,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-unused-labels")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/no_void_elements_with_children.rs b/crates/biome_js_analyze/src/lint/correctness/no_void_elements_with_children.rs index f2af5d4ce506..f622630e61c9 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_void_elements_with_children.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_void_elements_with_children.rs @@ -4,6 +4,7 @@ use crate::JsRuleAction; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::{markup, MarkupBuf}; +use biome_diagnostics::Severity; use biome_js_factory::make::{jsx_attribute_list, jsx_self_closing_element}; use biome_js_syntax::{ AnyJsxAttribute, JsCallExpression, JsPropertyObjectMember, JsxAttribute, JsxElement, @@ -35,6 +36,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintReact("void-dom-elements-no-children")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } @@ -43,27 +45,13 @@ declare_node_union! { pub NoVoidElementsWithChildrenQuery = JsxElement | JsCallExpression | JsxSelfClosingElement } +const VOID_ELEMENTS: [&str; 16] = [ + "area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "menuitem", + "meta", "param", "source", "track", "wbr", +]; /// Returns true if the name of the element belong to a self-closing element fn is_void_dom_element(element_name: &str) -> bool { - matches!( - element_name, - "area" - | "base" - | "br" - | "col" - | "embed" - | "hr" - | "img" - | "input" - | "keygen" - | "link" - | "menuitem" - | "meta" - | "param" - | "source" - | "track" - | "wbr" - ) + VOID_ELEMENTS.contains(&element_name) } pub enum NoVoidElementsWithChildrenCause { diff --git a/crates/biome_js_analyze/src/lint/correctness/no_void_type_return.rs b/crates/biome_js_analyze/src/lint/correctness/no_void_type_return.rs index 1e32d40a6d89..884f5bbb365a 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_void_type_return.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_void_type_return.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsExpression, AnyTsReturnType, JsArrowFunctionExpression, JsFunctionDeclaration, JsFunctionExportDefaultDeclaration, JsFunctionExpression, JsGetterClassMember, @@ -90,6 +91,7 @@ declare_lint_rule! { name: "noVoidTypeReturn", language: "ts", recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/use_is_nan.rs b/crates/biome_js_analyze/src/lint/correctness/use_is_nan.rs index 99fbcdd50586..0c9ef334481d 100644 --- a/crates/biome_js_analyze/src/lint/correctness/use_is_nan.rs +++ b/crates/biome_js_analyze/src/lint/correctness/use_is_nan.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_semantic::SemanticModel; use biome_js_syntax::{ @@ -64,6 +65,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("use-isnan")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/use_jsx_key_in_iterable.rs b/crates/biome_js_analyze/src/lint/correctness/use_jsx_key_in_iterable.rs index fdd7302eefa3..d9833d660ba2 100644 --- a/crates/biome_js_analyze/src/lint/correctness/use_jsx_key_in_iterable.rs +++ b/crates/biome_js_analyze/src/lint/correctness/use_jsx_key_in_iterable.rs @@ -3,6 +3,7 @@ use crate::services::semantic::Semantic; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic}; use biome_analyze::{RuleSource, RuleSourceKind}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_semantic::SemanticModel; use biome_js_syntax::{ AnyJsExpression, AnyJsFunctionBody, AnyJsMemberExpression, AnyJsObjectMember, AnyJsxAttribute, @@ -42,6 +43,7 @@ declare_lint_rule! { sources: &[RuleSource::EslintReact("jsx-key")], source_kind: RuleSourceKind::SameLogic, recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/use_valid_for_direction.rs b/crates/biome_js_analyze/src/lint/correctness/use_valid_for_direction.rs index 92fadd3f2a34..c330afc0382e 100644 --- a/crates/biome_js_analyze/src/lint/correctness/use_valid_for_direction.rs +++ b/crates/biome_js_analyze/src/lint/correctness/use_valid_for_direction.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsExpression, JsAssignmentOperator, JsBinaryOperator, JsForStatement, JsIdentifierAssignment, JsIdentifierExpression, JsPostUpdateOperator, JsUnaryOperator, @@ -46,6 +47,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("for-direction")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/correctness/use_yield.rs b/crates/biome_js_analyze/src/lint/correctness/use_yield.rs index b7db065a26a5..23e8469feb3a 100644 --- a/crates/biome_js_analyze/src/lint/correctness/use_yield.rs +++ b/crates/biome_js_analyze/src/lint/correctness/use_yield.rs @@ -4,6 +4,7 @@ use biome_analyze::{ ServiceBag, Visitor, VisitorContext, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{AnyFunctionLike, JsLanguage, JsYieldExpression, TextRange, WalkEvent}; use biome_rowan::{AstNode, AstNodeList, Language, SyntaxNode, TextSize}; @@ -42,6 +43,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("require-yield")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/nursery/no_duplicate_else_if.rs b/crates/biome_js_analyze/src/lint/nursery/no_duplicate_else_if.rs index 6daf7421b23c..396f4b8794e4 100644 --- a/crates/biome_js_analyze/src/lint/nursery/no_duplicate_else_if.rs +++ b/crates/biome_js_analyze/src/lint/nursery/no_duplicate_else_if.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{AnyJsExpression, JsIfStatement, JsLogicalOperator}; use biome_rowan::{AstNode, SyntaxNodeCast, TextRange}; @@ -51,6 +52,7 @@ declare_lint_rule! { name: "noDuplicateElseIf", language: "js", recommended: true, + severity: Severity::Error, sources: &[RuleSource::Eslint("no-dupe-else-if")], } } diff --git a/crates/biome_js_analyze/src/lint/nursery/no_useless_escape_in_regex.rs b/crates/biome_js_analyze/src/lint/nursery/no_useless_escape_in_regex.rs index 283dac6a8426..dcacf9ebae06 100644 --- a/crates/biome_js_analyze/src/lint/nursery/no_useless_escape_in_regex.rs +++ b/crates/biome_js_analyze/src/lint/nursery/no_useless_escape_in_regex.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsRegexLiteralExpression, JsSyntaxKind, JsSyntaxToken}; use biome_rowan::{AstNode, BatchMutationExt, TextRange, TextSize}; @@ -44,6 +45,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-useless-escape")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/nursery/use_aria_props_supported_by_role.rs b/crates/biome_js_analyze/src/lint/nursery/use_aria_props_supported_by_role.rs index b7eb96cfe3fc..e4e37e87c9e7 100644 --- a/crates/biome_js_analyze/src/lint/nursery/use_aria_props_supported_by_role.rs +++ b/crates/biome_js_analyze/src/lint/nursery/use_aria_props_supported_by_role.rs @@ -1,6 +1,7 @@ use crate::services::aria::Aria; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_rowan::AstNode; @@ -37,6 +38,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::EslintJsxA11y("role-supports-aria-props")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/nursery/use_consistent_member_accessibility.rs b/crates/biome_js_analyze/src/lint/nursery/use_consistent_member_accessibility.rs index 8945dd5dcc1c..d9de2c41ed52 100644 --- a/crates/biome_js_analyze/src/lint/nursery/use_consistent_member_accessibility.rs +++ b/crates/biome_js_analyze/src/lint/nursery/use_consistent_member_accessibility.rs @@ -3,6 +3,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_deserialize_macros::Deserializable; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsClassMemberName, JsConstructorClassMember, JsGetterClassMember, JsMethodClassMember, JsPropertyClassMember, JsSetterClassMember, TsAccessibilityModifier, @@ -217,6 +218,7 @@ declare_lint_rule! { name: "useConsistentMemberAccessibility", language: "ts", recommended: true, + severity: Severity::Error, sources: &[RuleSource::EslintTypeScript("explicit-member-accessibility")], } } diff --git a/crates/biome_js_analyze/src/lint/nursery/use_strict_mode.rs b/crates/biome_js_analyze/src/lint/nursery/use_strict_mode.rs index 65881ad1f92a..9287f31c8e71 100644 --- a/crates/biome_js_analyze/src/lint/nursery/use_strict_mode.rs +++ b/crates/biome_js_analyze/src/lint/nursery/use_strict_mode.rs @@ -4,6 +4,7 @@ use biome_analyze::{ RuleDiagnostic, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{JsScript, JsSyntaxKind, JsSyntaxToken, T}; use biome_rowan::{AstNode, AstNodeList, BatchMutationExt}; @@ -39,6 +40,7 @@ declare_lint_rule! { name: "useStrictMode", language: "js", recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/performance/no_accumulating_spread.rs b/crates/biome_js_analyze/src/lint/performance/no_accumulating_spread.rs index 4005136b9abd..f3dd2e26eaa7 100644 --- a/crates/biome_js_analyze/src/lint/performance/no_accumulating_spread.rs +++ b/crates/biome_js_analyze/src/lint/performance/no_accumulating_spread.rs @@ -1,5 +1,6 @@ use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_semantic::SemanticModel; use biome_js_syntax::{ AnyJsFunction, AnyJsMemberExpression, JsCallArgumentList, JsCallArguments, JsCallExpression, @@ -50,6 +51,7 @@ declare_lint_rule! { name: "noAccumulatingSpread", language: "js", recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/performance/no_delete.rs b/crates/biome_js_analyze/src/lint/performance/no_delete.rs index 0d1bce481b3b..9e8c05a1a0c8 100644 --- a/crates/biome_js_analyze/src/lint/performance/no_delete.rs +++ b/crates/biome_js_analyze/src/lint/performance/no_delete.rs @@ -1,5 +1,6 @@ use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsAssignment, AnyJsAssignmentPattern, AnyJsExpression, JsComputedMemberExpressionFields, @@ -60,6 +61,7 @@ declare_lint_rule! { name: "noDelete", language: "js", recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs b/crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs index e2a7b4be54db..31cb7faf790c 100644 --- a/crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs +++ b/crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs @@ -3,6 +3,7 @@ use crate::services::semantic::Semantic; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{AnyJsxAttributeName, JsCallExpression, JsxAttribute}; use biome_rowan::{declare_node_union, AstNode, TextRange}; @@ -31,6 +32,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintReact("no-danger")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs b/crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs index 47fbb93ef6cb..caac2cc4b4b0 100644 --- a/crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs +++ b/crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs @@ -3,6 +3,7 @@ use crate::services::semantic::Semantic; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_semantic::SemanticModel; use biome_js_syntax::{ JsCallExpression, JsPropertyObjectMember, JsSyntaxNode, JsxAttribute, JsxElement, @@ -40,6 +41,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintReact("no-danger-with-children")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/security/no_global_eval.rs b/crates/biome_js_analyze/src/lint/security/no_global_eval.rs index 1c95d6615f0d..cccf8da43c84 100644 --- a/crates/biome_js_analyze/src/lint/security/no_global_eval.rs +++ b/crates/biome_js_analyze/src/lint/security/no_global_eval.rs @@ -1,6 +1,7 @@ use crate::services::semantic::Semantic; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{global_identifier, AnyJsExpression}; use biome_rowan::AstNode; @@ -55,6 +56,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-eval")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/style/no_arguments.rs b/crates/biome_js_analyze/src/lint/style/no_arguments.rs index e846722336e4..351723375856 100644 --- a/crates/biome_js_analyze/src/lint/style/no_arguments.rs +++ b/crates/biome_js_analyze/src/lint/style/no_arguments.rs @@ -1,6 +1,7 @@ use crate::services::semantic::SemanticServices; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::TextRange; declare_lint_rule! { @@ -30,6 +31,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("prefer-rest-params")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/style/no_comma_operator.rs b/crates/biome_js_analyze/src/lint/style/no_comma_operator.rs index c13e903b36cf..dd93ecf60f21 100644 --- a/crates/biome_js_analyze/src/lint/style/no_comma_operator.rs +++ b/crates/biome_js_analyze/src/lint/style/no_comma_operator.rs @@ -1,5 +1,6 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; +use biome_diagnostics::Severity; use biome_js_syntax::{JsForStatement, JsSequenceExpression}; use biome_rowan::AstNode; @@ -42,6 +43,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-sequences")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/style/no_inferrable_types.rs b/crates/biome_js_analyze/src/lint/style/no_inferrable_types.rs index ffc5f9dee711..1d5f5fa18b59 100644 --- a/crates/biome_js_analyze/src/lint/style/no_inferrable_types.rs +++ b/crates/biome_js_analyze/src/lint/style/no_inferrable_types.rs @@ -2,6 +2,7 @@ use crate::JsRuleAction; use biome_analyze::RuleSource; use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsExpression, AnyTsPropertyAnnotation, AnyTsVariableAnnotation, JsFormalParameter, JsInitializerClause, JsPropertyClassMember, JsSyntaxKind, JsVariableDeclaration, @@ -98,6 +99,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("no-inferrable-types")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/style/no_non_null_assertion.rs b/crates/biome_js_analyze/src/lint/style/no_non_null_assertion.rs index be796e627b67..a7ab4fdf387f 100644 --- a/crates/biome_js_analyze/src/lint/style/no_non_null_assertion.rs +++ b/crates/biome_js_analyze/src/lint/style/no_non_null_assertion.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsExpression, TsNonNullAssertionAssignment, TsNonNullAssertionExpression, T, @@ -49,6 +50,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("no-non-null-assertion")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/style/no_parameter_assign.rs b/crates/biome_js_analyze/src/lint/style/no_parameter_assign.rs index 2d57b606ab72..c39d02b5ce06 100644 --- a/crates/biome_js_analyze/src/lint/style/no_parameter_assign.rs +++ b/crates/biome_js_analyze/src/lint/style/no_parameter_assign.rs @@ -1,6 +1,7 @@ use crate::services::semantic::Semantic; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_semantic::{AllBindingWriteReferencesIter, Reference, ReferencesExtensions}; use biome_js_syntax::{AnyJsBinding, AnyJsBindingPattern, AnyJsFormalParameter, AnyJsParameter}; use biome_rowan::AstNode; @@ -59,6 +60,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-param-reassign")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/style/no_unused_template_literal.rs b/crates/biome_js_analyze/src/lint/style/no_unused_template_literal.rs index f98eaed3e620..c5ad6317c1b1 100644 --- a/crates/biome_js_analyze/src/lint/style/no_unused_template_literal.rs +++ b/crates/biome_js_analyze/src/lint/style/no_unused_template_literal.rs @@ -2,6 +2,7 @@ use crate::JsRuleAction; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsExpression, AnyJsLiteralExpression, AnyJsTemplateElement, JsTemplateExpression, @@ -42,6 +43,7 @@ declare_lint_rule! { name: "noUnusedTemplateLiteral", language: "ts", recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/style/no_useless_else.rs b/crates/biome_js_analyze/src/lint/style/no_useless_else.rs index ddac441d51f7..f2b53ccc613f 100644 --- a/crates/biome_js_analyze/src/lint/style/no_useless_else.rs +++ b/crates/biome_js_analyze/src/lint/style/no_useless_else.rs @@ -5,6 +5,7 @@ use biome_analyze::{ RuleSourceKind, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{AnyJsStatement, JsIfStatement, JsStatementList, JsSyntaxKind}; use biome_rowan::{ @@ -94,6 +95,7 @@ declare_lint_rule! { ], source_kind: RuleSourceKind::Inspired, recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/style/no_var.rs b/crates/biome_js_analyze/src/lint/style/no_var.rs index 1363bf20ca8a..6e703eb9d47f 100644 --- a/crates/biome_js_analyze/src/lint/style/no_var.rs +++ b/crates/biome_js_analyze/src/lint/style/no_var.rs @@ -5,6 +5,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsVariableDeclaration, JsModule, JsScript, JsSyntaxKind, TsGlobalDeclaration, @@ -41,6 +42,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-var")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_as_const_assertion.rs b/crates/biome_js_analyze/src/lint/style/use_as_const_assertion.rs index 1e7fd88b2b24..fab5680cc777 100644 --- a/crates/biome_js_analyze/src/lint/style/use_as_const_assertion.rs +++ b/crates/biome_js_analyze/src/lint/style/use_as_const_assertion.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsExpression, AnyJsLiteralExpression, AnyTsName, AnyTsType, JsInitializerClause, @@ -49,6 +50,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("prefer-as-const")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_const.rs b/crates/biome_js_analyze/src/lint/style/use_const.rs index 93b527200479..c2c17751f3c8 100644 --- a/crates/biome_js_analyze/src/lint/style/use_const.rs +++ b/crates/biome_js_analyze/src/lint/style/use_const.rs @@ -6,6 +6,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_semantic::{ReferencesExtensions, Scope, SemanticModel, SemanticScopeExtensions}; @@ -78,6 +79,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("prefer-const")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_default_parameter_last.rs b/crates/biome_js_analyze/src/lint/style/use_default_parameter_last.rs index 903fc341e067..d4ec58178246 100644 --- a/crates/biome_js_analyze/src/lint/style/use_default_parameter_last.rs +++ b/crates/biome_js_analyze/src/lint/style/use_default_parameter_last.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsFormalParameter, JsInitializerClause, JsSyntaxToken, TsPropertyParameter}; use biome_rowan::{declare_node_union, AstNode, BatchMutationExt, Direction}; @@ -56,6 +57,7 @@ declare_lint_rule! { RuleSource::EslintTypeScript("default-param-last") ], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_enum_initializers.rs b/crates/biome_js_analyze/src/lint/style/use_enum_initializers.rs index 82f118ae8897..aa681edc2f59 100644 --- a/crates/biome_js_analyze/src/lint/style/use_enum_initializers.rs +++ b/crates/biome_js_analyze/src/lint/style/use_enum_initializers.rs @@ -2,6 +2,7 @@ use crate::JsRuleAction; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{AnyJsExpression, AnyJsLiteralExpression, JsSyntaxKind, TsEnumDeclaration}; use biome_rowan::{AstNode, BatchMutationExt}; @@ -69,6 +70,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("prefer-enum-initializers")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_exponentiation_operator.rs b/crates/biome_js_analyze/src/lint/style/use_exponentiation_operator.rs index 8ae86bc2db67..ff9b77a5dd4a 100644 --- a/crates/biome_js_analyze/src/lint/style/use_exponentiation_operator.rs +++ b/crates/biome_js_analyze/src/lint/style/use_exponentiation_operator.rs @@ -3,6 +3,7 @@ use crate::JsRuleAction; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::{make, syntax::T}; use biome_js_syntax::{ global_identifier, AnyJsCallArgument, AnyJsExpression, AnyJsMemberExpression, JsBinaryOperator, @@ -58,6 +59,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("prefer-exponentiation-operator")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_export_type.rs b/crates/biome_js_analyze/src/lint/style/use_export_type.rs index cc60dd8a7fe6..9b83a5bbba59 100644 --- a/crates/biome_js_analyze/src/lint/style/use_export_type.rs +++ b/crates/biome_js_analyze/src/lint/style/use_export_type.rs @@ -4,6 +4,7 @@ use biome_analyze::{ RuleSourceKind, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsExportNamedSpecifier, JsExportNamedClause, JsExportNamedFromClause, JsFileSource, @@ -67,6 +68,7 @@ declare_lint_rule! { sources: &[RuleSource::EslintTypeScript("consistent-type-exports")], source_kind: RuleSourceKind::Inspired, recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_import_type.rs b/crates/biome_js_analyze/src/lint/style/use_import_type.rs index 0aec7d610557..7209011d8ebb 100644 --- a/crates/biome_js_analyze/src/lint/style/use_import_type.rs +++ b/crates/biome_js_analyze/src/lint/style/use_import_type.rs @@ -8,6 +8,7 @@ use biome_analyze::{ RuleSource, RuleSourceKind, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_semantic::{ReferencesExtensions, SemanticModel}; use biome_js_syntax::{ @@ -116,6 +117,7 @@ declare_lint_rule! { sources: &[RuleSource::EslintTypeScript("consistent-type-imports")], source_kind: RuleSourceKind::Inspired, recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_literal_enum_members.rs b/crates/biome_js_analyze/src/lint/style/use_literal_enum_members.rs index a5f068fb0e93..d1ee3143a442 100644 --- a/crates/biome_js_analyze/src/lint/style/use_literal_enum_members.rs +++ b/crates/biome_js_analyze/src/lint/style/use_literal_enum_members.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsExpression, AnyJsLiteralExpression, AnyJsMemberExpression, JsUnaryOperator, TsEnumDeclaration, @@ -69,6 +70,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("prefer-literal-enum-member")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_nodejs_import_protocol.rs b/crates/biome_js_analyze/src/lint/style/use_nodejs_import_protocol.rs index 7be7bcb5dd41..978b9754cfe4 100644 --- a/crates/biome_js_analyze/src/lint/style/use_nodejs_import_protocol.rs +++ b/crates/biome_js_analyze/src/lint/style/use_nodejs_import_protocol.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{inner_string_text, AnyJsImportLike, JsSyntaxKind, JsSyntaxToken}; use biome_rowan::BatchMutationExt; @@ -53,6 +54,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::EslintUnicorn("prefer-node-protocol")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_number_namespace.rs b/crates/biome_js_analyze/src/lint/style/use_number_namespace.rs index 8e35efe73f58..bb3ef5210e28 100644 --- a/crates/biome_js_analyze/src/lint/style/use_number_namespace.rs +++ b/crates/biome_js_analyze/src/lint/style/use_number_namespace.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ global_identifier, static_value::StaticValue, AnyJsExpression, JsUnaryExpression, @@ -70,6 +71,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::EslintUnicorn("prefer-number-properties")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_numeric_literals.rs b/crates/biome_js_analyze/src/lint/style/use_numeric_literals.rs index 1e00c26d7396..1f1fcd5e98e5 100644 --- a/crates/biome_js_analyze/src/lint/style/use_numeric_literals.rs +++ b/crates/biome_js_analyze/src/lint/style/use_numeric_literals.rs @@ -3,6 +3,7 @@ use crate::{ast_utils, JsRuleAction}; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_semantic::SemanticModel; use biome_js_syntax::{ @@ -59,6 +60,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("prefer-numeric-literals")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_self_closing_elements.rs b/crates/biome_js_analyze/src/lint/style/use_self_closing_elements.rs index a4d1ad50ef4c..9b55cc5f9e2e 100644 --- a/crates/biome_js_analyze/src/lint/style/use_self_closing_elements.rs +++ b/crates/biome_js_analyze/src/lint/style/use_self_closing_elements.rs @@ -3,6 +3,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_deserialize_macros::Deserializable; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{AnyJsxTag, JsSyntaxToken, JsxElement, JsxOpeningElementFields, T}; use biome_rowan::{AstNode, AstNodeList, BatchMutationExt, TriviaPiece}; @@ -89,6 +90,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::EslintStylistic("jsx-self-closing-comp")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_shorthand_function_type.rs b/crates/biome_js_analyze/src/lint/style/use_shorthand_function_type.rs index 3a804d2dde5b..93e0a306eca5 100644 --- a/crates/biome_js_analyze/src/lint/style/use_shorthand_function_type.rs +++ b/crates/biome_js_analyze/src/lint/style/use_shorthand_function_type.rs @@ -2,6 +2,7 @@ use crate::JsRuleAction; use biome_analyze::RuleSource; use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_factory::make::ts_type_alias_declaration; use biome_js_syntax::AnyTsType::TsThisType; @@ -81,6 +82,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("prefer-function-type")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_single_var_declarator.rs b/crates/biome_js_analyze/src/lint/style/use_single_var_declarator.rs index ccacc78d69bb..3f3142a3ad68 100644 --- a/crates/biome_js_analyze/src/lint/style/use_single_var_declarator.rs +++ b/crates/biome_js_analyze/src/lint/style/use_single_var_declarator.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ JsSyntaxKind, JsSyntaxToken, JsVariableDeclarationFields, JsVariableStatement, @@ -45,6 +46,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("one-var")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_template.rs b/crates/biome_js_analyze/src/lint/style/use_template.rs index 3f221a7a2aa9..866c5f2c26d9 100644 --- a/crates/biome_js_analyze/src/lint/style/use_template.rs +++ b/crates/biome_js_analyze/src/lint/style/use_template.rs @@ -1,6 +1,7 @@ use biome_analyze::RuleSource; use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::AnyJsTemplateElement; use biome_js_syntax::{ @@ -50,6 +51,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("prefer-template")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/style/use_while.rs b/crates/biome_js_analyze/src/lint/style/use_while.rs index 519169be2c8a..1be86922842e 100644 --- a/crates/biome_js_analyze/src/lint/style/use_while.rs +++ b/crates/biome_js_analyze/src/lint/style/use_while.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{AnyJsStatement, JsForStatement, T}; use biome_rowan::{trim_leading_trivia_pieces, AstNode, BatchMutationExt}; @@ -42,6 +43,7 @@ declare_lint_rule! { name: "useWhile", language: "js", recommended: true, + severity: Severity::Error, sources: &[RuleSource::EslintSonarJs("prefer-while")], fix_kind: FixKind::Safe, } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_approximative_numeric_constant.rs b/crates/biome_js_analyze/src/lint/suspicious/no_approximative_numeric_constant.rs index 4cee41a2ff76..e22d594a4f21 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_approximative_numeric_constant.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_approximative_numeric_constant.rs @@ -4,6 +4,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ numbers::split_into_radix_and_number, AnyJsExpression, AnyJsLiteralExpression, @@ -47,6 +48,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Clippy("approx_constant")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs b/crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs index 50ba7d130b82..c045d8efaf4e 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs @@ -3,6 +3,7 @@ use crate::services::semantic::Semantic; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsExpression, AnyJsFunction, AnyJsMemberExpression, AnyJsTemplateElement, JsBinaryExpression, JsCallArgumentList, JsCallArguments, JsCallExpression, JsFormalParameter, @@ -69,6 +70,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintReact("no-array-index-key")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_assign_in_expressions.rs b/crates/biome_js_analyze/src/lint/suspicious/no_assign_in_expressions.rs index 5dff73955c9f..93fe79ef16d4 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_assign_in_expressions.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_assign_in_expressions.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, RuleSourceKind}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ JsAssignmentExpression, JsExpressionStatement, JsForStatement, JsParenthesizedExpression, JsSequenceExpression, @@ -48,6 +49,7 @@ declare_lint_rule! { sources: &[RuleSource::Eslint("no-cond-assign")], source_kind: RuleSourceKind::Inspired, recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_async_promise_executor.rs b/crates/biome_js_analyze/src/lint/suspicious/no_async_promise_executor.rs index 11179b6fa531..37c9fa0424b9 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_async_promise_executor.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_async_promise_executor.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsCallArgument, AnyJsExpression, AnyJsFunction, JsNewExpression, JsNewExpressionFields, }; @@ -44,6 +45,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-async-promise-executor")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_catch_assign.rs b/crates/biome_js_analyze/src/lint/suspicious/no_catch_assign.rs index 86e78a395401..cd7171ca9bf0 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_catch_assign.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_catch_assign.rs @@ -1,6 +1,7 @@ use crate::services::semantic::Semantic; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_semantic::ReferencesExtensions; use biome_js_syntax::JsCatchClause; use biome_rowan::{AstNode, TextRange}; @@ -40,6 +41,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-ex-assign")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_class_assign.rs b/crates/biome_js_analyze/src/lint/suspicious/no_class_assign.rs index c0d50889bf1c..05a6449345c1 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_class_assign.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_class_assign.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_semantic::{Reference, ReferencesExtensions}; use biome_js_syntax::AnyJsClass; @@ -71,6 +72,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-class-assign")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_comment_text.rs b/crates/biome_js_analyze/src/lint/suspicious/no_comment_text.rs index c5dc1834e766..0e6d5c490784 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_comment_text.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_comment_text.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{AnyJsxChild, JsSyntaxKind, JsSyntaxToken, JsxText}; use biome_rowan::{AstNode, BatchMutationExt, TextRange, TextSize}; @@ -73,6 +74,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintReact("jsx-no-comment-textnodes")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_compare_neg_zero.rs b/crates/biome_js_analyze/src/lint/suspicious/no_compare_neg_zero.rs index 03c743fa1fe3..f217fb89fa89 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_compare_neg_zero.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_compare_neg_zero.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsExpression, AnyJsLiteralExpression, JsBinaryExpression, JsSyntaxKind, JsUnaryOperator, @@ -38,6 +39,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-compare-neg-zero")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_confusing_labels.rs b/crates/biome_js_analyze/src/lint/suspicious/no_confusing_labels.rs index b1f202a53d68..cf68a040a8c8 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_confusing_labels.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_confusing_labels.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, RuleSourceKind}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{AnyJsStatement, JsFileSource, JsLabeledStatement}; declare_lint_rule! { @@ -62,6 +63,7 @@ declare_lint_rule! { sources: &[RuleSource::Eslint("no-labels")], source_kind: RuleSourceKind::Inspired, recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_confusing_void_type.rs b/crates/biome_js_analyze/src/lint/suspicious/no_confusing_void_type.rs index 3e1acc31cf5e..b1dd237128f7 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_confusing_void_type.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_confusing_void_type.rs @@ -3,6 +3,7 @@ use biome_analyze::{ }; use biome_console::markup; use biome_diagnostics::Applicability; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{AnyTsType, JsSyntaxKind, JsSyntaxNode, TsConditionalType, TsVoidType, T}; use biome_rowan::{AstNode, BatchMutationExt}; @@ -63,6 +64,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("no-invalid-void-type")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_const_enum.rs b/crates/biome_js_analyze/src/lint/suspicious/no_const_enum.rs index cc1f27ce64d7..d16690014a3c 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_const_enum.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_const_enum.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::TsEnumDeclaration; use biome_rowan::{chain_trivia_pieces, trim_leading_trivia_pieces, AstNode, BatchMutationExt}; @@ -39,6 +40,7 @@ declare_lint_rule! { name: "noConstEnum", language: "ts", recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_control_characters_in_regex.rs b/crates/biome_js_analyze/src/lint/suspicious/no_control_characters_in_regex.rs index 11a64da69773..cfcfc50856c3 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_control_characters_in_regex.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_control_characters_in_regex.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ static_value::StaticValue, AnyJsExpression, JsCallArguments, JsCallExpression, JsNewExpression, JsRegexLiteralExpression, @@ -65,6 +66,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-control-regex")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_debugger.rs b/crates/biome_js_analyze/src/lint/suspicious/no_debugger.rs index 3b969112b601..de1edf84f33c 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_debugger.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_debugger.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::JsDebuggerStatement; use biome_rowan::{AstNode, BatchMutationExt}; @@ -30,6 +31,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-debugger")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_double_equals.rs b/crates/biome_js_analyze/src/lint/suspicious/no_double_equals.rs index 69083130c429..0d8eb9fcf0f6 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_double_equals.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_double_equals.rs @@ -2,6 +2,7 @@ use biome_analyze::RuleSource; use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic}; use biome_console::markup; use biome_deserialize_macros::Deserializable; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{AnyJsExpression, AnyJsLiteralExpression, JsBinaryExpression, T}; use biome_js_syntax::{JsSyntaxKind::*, JsSyntaxToken}; @@ -79,6 +80,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("eqeqeq")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_case.rs b/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_case.rs index 8e13a86c856c..95cc033ab489 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_case.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_case.rs @@ -1,6 +1,7 @@ use crate::utils::is_node_equal; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; +use biome_diagnostics::Severity; use biome_js_syntax::{AnyJsExpression, AnyJsSwitchClause, JsSwitchStatement}; use biome_rowan::{AstNode, TextRange}; @@ -86,6 +87,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-duplicate-case")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_class_members.rs b/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_class_members.rs index 471cd7afbad2..83b172d239ff 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_class_members.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_class_members.rs @@ -1,5 +1,6 @@ use biome_analyze::RuleSource; use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic}; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsClassMemberName, JsClassMemberList, JsGetterClassMember, JsMethodClassMember, JsPropertyClassMember, JsSetterClassMember, JsStaticModifier, JsSyntaxList, TextRange, @@ -93,6 +94,7 @@ declare_lint_rule! { RuleSource::EslintTypeScript("no-dupe-class-members") ], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_jsx_props.rs b/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_jsx_props.rs index 5ec44587723c..18fea4d67fe8 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_jsx_props.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_jsx_props.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::jsx_ext::AnyJsxElement; use biome_js_syntax::{AnyJsxAttribute, JsxAttribute}; use biome_rowan::AstNode; @@ -36,6 +37,7 @@ declare_lint_rule! { language: "jsx", sources: &[RuleSource::EslintReact("jsx-no-duplicate-props")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_object_keys.rs b/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_object_keys.rs index 071b846deaa5..c15862ebe945 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_object_keys.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_object_keys.rs @@ -2,6 +2,7 @@ use crate::utils::batch::JsBatchMutation; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsObjectMember, JsGetterObjectMember, JsObjectExpression, JsSetterObjectMember, }; @@ -60,6 +61,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-dupe-keys")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_parameters.rs b/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_parameters.rs index c833d83f4df9..798ee0ecb3ab 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_parameters.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_parameters.rs @@ -1,6 +1,7 @@ use biome_analyze::RuleSource; use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::parameter_ext::{AnyJsParameterList, AnyJsParameters, AnyParameter}; use biome_js_syntax::{ AnyJsArrayBindingPatternElement, AnyJsBinding, AnyJsBindingPattern, @@ -43,6 +44,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-dupe-args")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_test_hooks.rs b/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_test_hooks.rs index a9663c63f18f..3497fb05a6cd 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_test_hooks.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_duplicate_test_hooks.rs @@ -3,6 +3,7 @@ use biome_analyze::{ RuleDiagnostic, RuleSource, RuleSourceKind, ServiceBag, Visitor, VisitorContext, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{AnyJsExpression, JsCallExpression, JsLanguage, TextRange}; use biome_rowan::{AstNode, Language, SyntaxNode, WalkEvent}; @@ -61,6 +62,7 @@ declare_lint_rule! { name: "noDuplicateTestHooks", language: "js", recommended: true, + severity: Severity::Error, sources: &[RuleSource::EslintJest("no-duplicate-hooks")], source_kind: RuleSourceKind::Inspired, } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_empty_interface.rs b/crates/biome_js_analyze/src/lint/suspicious/no_empty_interface.rs index 5b0c8f195ba0..7bdd9792a316 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_empty_interface.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_empty_interface.rs @@ -4,6 +4,7 @@ use biome_analyze::{ declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, RuleSourceKind, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::{ make, syntax::{AnyTsType, T}, @@ -52,6 +53,7 @@ declare_lint_rule! { sources: &[RuleSource::EslintTypeScript("no-empty-interface")], source_kind: RuleSourceKind::Inspired, recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_explicit_any.rs b/crates/biome_js_analyze/src/lint/suspicious/no_explicit_any.rs index 4545c8cf9c0f..589c5ad5cf0f 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_explicit_any.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_explicit_any.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{TsAnyType, TsTypeConstraintClause}; use biome_rowan::AstNode; @@ -57,6 +58,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("no-explicit-any")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_exports_in_test.rs b/crates/biome_js_analyze/src/lint/suspicious/no_exports_in_test.rs index a15ec23a9421..0f0d43a9f260 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_exports_in_test.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_exports_in_test.rs @@ -3,6 +3,7 @@ use biome_analyze::{ RuleDiagnostic, RuleSource, RuleSourceKind, ServiceBag, Visitor, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ assign_ext::AnyJsMemberAssignment, AnyJsExpression, AnyJsRoot, JsAssignmentExpression, JsCallExpression, JsExport, JsLanguage, @@ -41,6 +42,7 @@ declare_lint_rule! { name: "noExportsInTest", language: "js", recommended: true, + severity: Severity::Error, sources: &[RuleSource::EslintJest("no-export")], source_kind: RuleSourceKind::Inspired, } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_extra_non_null_assertion.rs b/crates/biome_js_analyze/src/lint/suspicious/no_extra_non_null_assertion.rs index fa6586ed828a..932d8037f8fb 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_extra_non_null_assertion.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_extra_non_null_assertion.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsAssignment, AnyJsExpression, JsSyntaxKind, TsNonNullAssertionAssignment, TsNonNullAssertionExpression, @@ -51,6 +52,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("no-extra-non-null-assertion")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_fallthrough_switch_clause.rs b/crates/biome_js_analyze/src/lint/suspicious/no_fallthrough_switch_clause.rs index 68394b2696bb..eb7cd306390b 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_fallthrough_switch_clause.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_fallthrough_switch_clause.rs @@ -6,6 +6,7 @@ use biome_control_flow::{ builder::{BlockId, ROOT_BLOCK_ID}, ExceptionHandlerKind, InstructionKind, }; +use biome_diagnostics::Severity; use biome_js_syntax::{JsDefaultClause, JsLanguage, JsSwitchStatement, JsSyntaxNode}; use biome_rowan::{AstNode, AstNodeList, TextRange, WalkEvent}; use roaring::RoaringBitmap; @@ -60,6 +61,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-fallthrough")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_focused_tests.rs b/crates/biome_js_analyze/src/lint/suspicious/no_focused_tests.rs index a1eebf2cdaae..29834601ca5e 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_focused_tests.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_focused_tests.rs @@ -4,6 +4,7 @@ use biome_analyze::{ RuleSourceKind, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{JsCallExpression, TextRange}; use biome_rowan::{AstNode, BatchMutationExt, NodeOrToken}; @@ -36,6 +37,7 @@ declare_lint_rule! { name: "noFocusedTests", language: "js", recommended: true, + severity: Severity::Error, sources: &[RuleSource::EslintJest("no-focused-tests")], source_kind: RuleSourceKind::Inspired, fix_kind: FixKind::Unsafe, diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_function_assign.rs b/crates/biome_js_analyze/src/lint/suspicious/no_function_assign.rs index a9266e249ff4..4bfebbefe4b2 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_function_assign.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_function_assign.rs @@ -1,6 +1,7 @@ use crate::services::semantic::Semantic; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_semantic::{Reference, ReferencesExtensions}; use biome_js_syntax::{JsFunctionDeclaration, JsIdentifierBinding}; use biome_rowan::AstNode; @@ -99,6 +100,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-func-assign")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_global_assign.rs b/crates/biome_js_analyze/src/lint/suspicious/no_global_assign.rs index 5e4df7d806b0..ff6eb0ccb909 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_global_assign.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_global_assign.rs @@ -4,6 +4,7 @@ use crate::services::semantic::SemanticServices; use biome_analyze::RuleSource; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsSyntaxKind, TextRange}; declare_lint_rule! { @@ -44,6 +45,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-global-assign")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_global_is_finite.rs b/crates/biome_js_analyze/src/lint/suspicious/no_global_is_finite.rs index 6bf3dd5cbefc..d7a8944d1d98 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_global_is_finite.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_global_is_finite.rs @@ -1,6 +1,7 @@ use crate::{services::semantic::Semantic, JsRuleAction}; use biome_analyze::{context::RuleContext, declare_lint_rule, FixKind, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{global_identifier, AnyJsExpression, T}; use biome_rowan::{AstNode, BatchMutationExt}; @@ -31,6 +32,7 @@ declare_lint_rule! { name: "noGlobalIsFinite", language: "js", recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_global_is_nan.rs b/crates/biome_js_analyze/src/lint/suspicious/no_global_is_nan.rs index 47c244210413..364d33cd136e 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_global_is_nan.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_global_is_nan.rs @@ -1,6 +1,7 @@ use crate::{services::semantic::Semantic, JsRuleAction}; use biome_analyze::{context::RuleContext, declare_lint_rule, FixKind, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{global_identifier, AnyJsExpression, T}; use biome_rowan::{AstNode, BatchMutationExt}; @@ -32,6 +33,7 @@ declare_lint_rule! { name: "noGlobalIsNan", language: "js", recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_implicit_any_let.rs b/crates/biome_js_analyze/src/lint/suspicious/no_implicit_any_let.rs index e41f2befb986..4787495ef863 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_implicit_any_let.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_implicit_any_let.rs @@ -1,5 +1,6 @@ use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsFileSource, JsVariableDeclaration, JsVariableDeclarator}; declare_lint_rule! { @@ -38,6 +39,7 @@ declare_lint_rule! { name: "noImplicitAnyLet", language: "ts", recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_import_assign.rs b/crates/biome_js_analyze/src/lint/suspicious/no_import_assign.rs index 88ae2e5ccab1..3487e2408a63 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_import_assign.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_import_assign.rs @@ -1,6 +1,7 @@ use crate::services::semantic::Semantic; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_semantic::ReferencesExtensions; use biome_js_syntax::{AnyJsImportSpecifier, JsIdentifierAssignment, JsIdentifierBinding}; @@ -52,6 +53,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-import-assign")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_label_var.rs b/crates/biome_js_analyze/src/lint/suspicious/no_label_var.rs index f3d4b74987ce..734b466178fa 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_label_var.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_label_var.rs @@ -1,6 +1,7 @@ use crate::services::semantic::Semantic; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsLabeledStatement, JsSyntaxNode, JsSyntaxToken}; use biome_rowan::AstNode; @@ -28,6 +29,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-label-var")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_misleading_character_class.rs b/crates/biome_js_analyze/src/lint/suspicious/no_misleading_character_class.rs index a2790eab43a1..2a60a5ad59ba 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_misleading_character_class.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_misleading_character_class.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ global_identifier, static_value::StaticValue, AnyJsCallArgument, AnyJsExpression, @@ -64,6 +65,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-misleading-character-class")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_misleading_instantiator.rs b/crates/biome_js_analyze/src/lint/suspicious/no_misleading_instantiator.rs index ab4bc95296b0..0b1c20475191 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_misleading_instantiator.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_misleading_instantiator.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::{markup, MarkupBuf}; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsClassMember, AnyTsType, AnyTsTypeMember, ClassMemberName, JsClassDeclaration, JsSyntaxToken, TsDeclareStatement, TsInterfaceDeclaration, TsReferenceType, @@ -54,6 +55,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("no-misused-new")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_misrefactored_shorthand_assign.rs b/crates/biome_js_analyze/src/lint/suspicious/no_misrefactored_shorthand_assign.rs index 065f4823f1df..c8cb669f3a63 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_misrefactored_shorthand_assign.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_misrefactored_shorthand_assign.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsExpression, JsAssignmentExpression, JsAssignmentOperator, JsBinaryExpression, }; @@ -53,6 +54,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Clippy("misrefactored_assign_op")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_prototype_builtins.rs b/crates/biome_js_analyze/src/lint/suspicious/no_prototype_builtins.rs index 3468d012d50f..09b349370fb0 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_prototype_builtins.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_prototype_builtins.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make::{self}; use biome_js_semantic::SemanticModel; use biome_js_syntax::{ @@ -60,6 +61,7 @@ declare_lint_rule! { RuleSource::Eslint("prefer-object-has-own") ], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_redeclare.rs b/crates/biome_js_analyze/src/lint/suspicious/no_redeclare.rs index 13bd1dcbf153..04d3e489de83 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_redeclare.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_redeclare.rs @@ -2,6 +2,7 @@ use crate::services::semantic::SemanticServices; use biome_analyze::{context::RuleContext, Rule, RuleDiagnostic}; use biome_analyze::{declare_lint_rule, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_semantic::Scope; use biome_js_syntax::binding_ext::AnyJsBindingDeclaration; use biome_js_syntax::{JsSyntaxKind, TextRange}; @@ -67,6 +68,7 @@ declare_lint_rule! { RuleSource::EslintTypeScript("no-redeclare"), ], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_redundant_use_strict.rs b/crates/biome_js_analyze/src/lint/suspicious/no_redundant_use_strict.rs index 30f8db15c813..b1de39213afd 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_redundant_use_strict.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_redundant_use_strict.rs @@ -1,6 +1,7 @@ use crate::JsRuleAction; use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsClass, JsDirective, JsDirectiveList, JsFileSource, JsFunctionBody, JsModule, JsScript, }; @@ -84,6 +85,7 @@ declare_lint_rule! { name: "noRedundantUseStrict", language: "js", recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_self_compare.rs b/crates/biome_js_analyze/src/lint/suspicious/no_self_compare.rs index 44edc02221a1..2ded53bcac99 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_self_compare.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_self_compare.rs @@ -1,6 +1,7 @@ use crate::utils::is_node_equal; use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; +use biome_diagnostics::Severity; use biome_js_syntax::JsBinaryExpression; use biome_rowan::AstNode; @@ -33,6 +34,7 @@ declare_lint_rule! { RuleSource::Clippy("eq_op"), ], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_shadow_restricted_names.rs b/crates/biome_js_analyze/src/lint/suspicious/no_shadow_restricted_names.rs index 3d5a9296d279..3e00e5fb101e 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_shadow_restricted_names.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_shadow_restricted_names.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::JsIdentifierBinding; use biome_rowan::AstNode; @@ -38,6 +39,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-shadow-restricted-names")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_sparse_array.rs b/crates/biome_js_analyze/src/lint/suspicious/no_sparse_array.rs index 681b830a4f4e..e67efc139a13 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_sparse_array.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_sparse_array.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{AnyJsArrayElement, AnyJsExpression, JsArrayExpression, TriviaPieceKind}; use biome_rowan::{AstNode, AstNodeExt, AstSeparatedList, BatchMutationExt}; @@ -24,6 +25,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-sparse-arrays")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_suspicious_semicolon_in_jsx.rs b/crates/biome_js_analyze/src/lint/suspicious/no_suspicious_semicolon_in_jsx.rs index 17f8b36708cc..555b07baf1e0 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_suspicious_semicolon_in_jsx.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_suspicious_semicolon_in_jsx.rs @@ -1,5 +1,6 @@ use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{AnyJsxTag, JsxChildList}; use biome_rowan::{AstNodeList, TextRange}; @@ -47,6 +48,7 @@ declare_lint_rule! { name: "noSuspiciousSemicolonInJsx", language: "js", recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_then_property.rs b/crates/biome_js_analyze/src/lint/suspicious/no_then_property.rs index 89b09d6c5229..015924dd09fc 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_then_property.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_then_property.rs @@ -1,6 +1,7 @@ use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic}; use biome_analyze::{Ast, RuleSource}; use biome_console::{markup, MarkupBuf}; +use biome_diagnostics::Severity; use biome_js_syntax::{ AnyJsArrayElement, AnyJsAssignment, AnyJsAssignmentPattern, AnyJsCallArgument, AnyJsDeclarationClause, AnyJsExportClause, AnyJsExportNamedSpecifier, AnyJsExpression, @@ -88,6 +89,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::EslintUnicorn("no-thenable")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_unsafe_declaration_merging.rs b/crates/biome_js_analyze/src/lint/suspicious/no_unsafe_declaration_merging.rs index e76dba61e201..a70d58bd84f5 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_unsafe_declaration_merging.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_unsafe_declaration_merging.rs @@ -1,6 +1,7 @@ use crate::services::semantic::Semantic; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{binding_ext::AnyJsBindingDeclaration, TsInterfaceDeclaration}; use biome_rowan::{AstNode, TextRange}; @@ -46,6 +47,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("no-unsafe-declaration-merging")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_unsafe_negation.rs b/crates/biome_js_analyze/src/lint/suspicious/no_unsafe_negation.rs index c2e2ecf3c10c..5e6373440bec 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/no_unsafe_negation.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/no_unsafe_negation.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{is_negation, AnyJsExpression, JsInExpression, JsInstanceofExpression}; use biome_rowan::{declare_node_union, AstNode, AstNodeExt, BatchMutationExt}; @@ -37,6 +38,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("no-unsafe-negation")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/use_default_switch_clause_last.rs b/crates/biome_js_analyze/src/lint/suspicious/use_default_switch_clause_last.rs index 40df7714cc88..4c3d2aaa0bfa 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/use_default_switch_clause_last.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/use_default_switch_clause_last.rs @@ -1,6 +1,7 @@ use biome_analyze::context::RuleContext; use biome_analyze::{declare_lint_rule, Ast, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_syntax::{JsCaseClause, JsDefaultClause}; use biome_rowan::{AstNode, Direction}; @@ -75,6 +76,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("default-case-last")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/use_getter_return.rs b/crates/biome_js_analyze/src/lint/suspicious/use_getter_return.rs index 71f37d5d83e2..9e943d8f9fcf 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/use_getter_return.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/use_getter_return.rs @@ -2,6 +2,7 @@ use crate::ControlFlowGraph; use biome_analyze::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; use biome_control_flow::{builder::ROOT_BLOCK_ID, ExceptionHandlerKind, InstructionKind}; +use biome_diagnostics::Severity; use biome_js_syntax::{JsGetterClassMember, JsGetterObjectMember, JsReturnStatement}; use biome_rowan::{AstNode, NodeOrToken, TextRange}; use roaring::RoaringBitmap; @@ -63,6 +64,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("getter-return")], recommended: true, + severity: Severity::Error, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/use_is_array.rs b/crates/biome_js_analyze/src/lint/suspicious/use_is_array.rs index 6706530569b4..b892604eff94 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/use_is_array.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/use_is_array.rs @@ -3,6 +3,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ global_identifier, AnyJsCallArgument, AnyJsExpression, JsInstanceofExpression, T, @@ -41,6 +42,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::EslintUnicorn("no-instanceof-array")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/use_namespace_keyword.rs b/crates/biome_js_analyze/src/lint/suspicious/use_namespace_keyword.rs index 4123af20fed3..31b7552a1e3a 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/use_namespace_keyword.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/use_namespace_keyword.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{JsSyntaxToken, TsModuleDeclaration, T}; use biome_rowan::BatchMutationExt; @@ -45,6 +46,7 @@ declare_lint_rule! { language: "ts", sources: &[RuleSource::EslintTypeScript("prefer-namespace-keyword")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/lint/suspicious/use_valid_typeof.rs b/crates/biome_js_analyze/src/lint/suspicious/use_valid_typeof.rs index b8c8f77b3da2..245e08b0543b 100644 --- a/crates/biome_js_analyze/src/lint/suspicious/use_valid_typeof.rs +++ b/crates/biome_js_analyze/src/lint/suspicious/use_valid_typeof.rs @@ -2,6 +2,7 @@ use biome_analyze::{ context::RuleContext, declare_lint_rule, Ast, FixKind, Rule, RuleDiagnostic, RuleSource, }; use biome_console::markup; +use biome_diagnostics::Severity; use biome_js_factory::make; use biome_js_syntax::{ AnyJsExpression, AnyJsLiteralExpression, JsBinaryExpression, JsBinaryExpressionFields, @@ -74,6 +75,7 @@ declare_lint_rule! { language: "js", sources: &[RuleSource::Eslint("valid-typeof")], recommended: true, + severity: Severity::Error, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs b/crates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs index 0477ab7d4e0f..5e9e4b07e98d 100644 --- a/crates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs +++ b/crates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs @@ -1,5 +1,6 @@ use biome_analyze::{context::RuleContext, declare_lint_rule, Ast, Rule, RuleDiagnostic}; use biome_console::markup; +use biome_diagnostics::Severity; use biome_json_syntax::{JsonMemberName, JsonObjectValue, TextRange}; use biome_rowan::{AstNode, AstSeparatedList}; use rustc_hash::FxHashMap; @@ -31,6 +32,7 @@ declare_lint_rule! { name: "noDuplicateObjectKeys", language: "json", recommended: true, + severity: Severity::Error, } }