Skip to content

Commit a57a018

Browse files
authored
refactor(lint/noUselessContinue): move rule to complexity (#6068)
1 parent e491126 commit a57a018

File tree

21 files changed

+211
-210
lines changed

21 files changed

+211
-210
lines changed

.changeset/rule-promotion.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Change the group of some rules, promote nursery rules and update the recommended
77
The following rules have been moved to a new group:
88

99
- [complexity/noFlatMapIdentity](https://biomejs.dev/linter/rules/no-flat-map-identity)
10+
- [complexity/noUselessContinue](https://biomejs.dev/linter/rules/no-useless-continue)
1011
- [complexity/useNumericLiterals](https://biomejs.dev/linter/rules/use-numeric-literals)
1112
- [correctness/useValidTypeof](https://biomejs.dev/linter/rules/use-valid-typeof)
1213
- [performance/noNamespaceImport](https://biomejs.dev/linter/rules/no-namespace-import/)

.changeset/six-friends-lick.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"@biomejs/biome": patch
33
---
44

5-
Renamed the rule `noDuplicatedFields` to `noDuplicateFields`. This rules belongs to the `nursery` group, so no migration is provided.
5+
Renamed the rule `noDuplicatedFields` to `noDuplicateFields`. Run the command `biome migrate` to update your configuration.

.changeset/witty-plants-ring.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22
"@biomejs/biome": major
33
---
44

5-
Renamed the rule `noMultipleSpacesInRegularExpressionLiterals` to `noAdjacentSpacesInRegex`.
6-
7-
Use `biome migrate --write` to update the configuration.
5+
Renamed the rule `noMultipleSpacesInRegularExpressionLiterals` to `noAdjacentSpacesInRegex`. Run the command `biome migrate` to update your configuration.

crates/biome_cli/tests/snapshots/main_commands_rage/with_linter_configuration.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Linter:
7575
complexity/noThisInStatic
7676
complexity/noUselessCatch
7777
complexity/noUselessConstructor
78+
complexity/noUselessContinue
7879
complexity/noUselessEmptyExport
7980
complexity/noUselessEscapeInRegex
8081
complexity/noUselessFragments

crates/biome_cli/tests/snapshots/main_configuration/incorrect_rule_name.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ biome.json:6:13 deserialize ━━━━━━━━━━━━━━━━━
9292
- noUnusedLabels
9393
- noUnusedPrivateClassMembers
9494
- noUnusedVariables
95-
- noUselessContinue
9695
- noVoidElementsWithChildren
9796
- noVoidTypeReturn
9897
- useExhaustiveDependencies

crates/biome_configuration/src/analyzer/linter/rules.rs

Lines changed: 96 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/biome_diagnostics_categories/src/categories.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ define_categories! {
6161
"lint/complexity/noThisInStatic": "https://biomejs.dev/linter/rules/no-this-in-static",
6262
"lint/complexity/noUselessCatch": "https://biomejs.dev/linter/rules/no-useless-catch",
6363
"lint/complexity/noUselessConstructor": "https://biomejs.dev/linter/rules/no-useless-constructor",
64+
"lint/complexity/noUselessContinue": "https://biomejs.dev/linter/rules/no-useless-continue",
6465
"lint/complexity/noUselessEmptyExport": "https://biomejs.dev/linter/rules/no-useless-empty-export",
6566
"lint/complexity/noUselessEscapeInRegex": "https://biomejs.dev/linter/rules/no-useless-escape-in-regex",
6667
"lint/complexity/noUselessFragments": "https://biomejs.dev/linter/rules/no-useless-fragments",
@@ -132,7 +133,6 @@ define_categories! {
132133
"lint/correctness/noUnusedLabels": "https://biomejs.dev/linter/rules/no-unused-labels",
133134
"lint/correctness/noUnusedPrivateClassMembers": "https://biomejs.dev/linter/rules/no-unused-private-class-members",
134135
"lint/correctness/noUnusedVariables": "https://biomejs.dev/linter/rules/no-unused-variables",
135-
"lint/correctness/noUselessContinue": "https://biomejs.dev/linter/rules/no-useless-continue",
136136
"lint/correctness/noVoidElementsWithChildren": "https://biomejs.dev/linter/rules/no-void-elements-with-children",
137137
"lint/correctness/noVoidTypeReturn": "https://biomejs.dev/linter/rules/no-void-type-return",
138138
"lint/correctness/useExhaustiveDependencies": "https://biomejs.dev/linter/rules/use-exhaustive-dependencies",

crates/biome_js_analyze/src/lint/complexity.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pub mod no_static_only_class;
1515
pub mod no_this_in_static;
1616
pub mod no_useless_catch;
1717
pub mod no_useless_constructor;
18+
pub mod no_useless_continue;
1819
pub mod no_useless_empty_export;
1920
pub mod no_useless_escape_in_regex;
2021
pub mod no_useless_fragments;
@@ -39,4 +40,4 @@ pub mod use_regex_literals;
3940
pub mod use_simple_number_keys;
4041
pub mod use_simplified_logic_expression;
4142
pub mod use_while;
42-
declare_lint_group! { pub Complexity { name : "complexity" , rules : [self :: no_adjacent_spaces_in_regex :: NoAdjacentSpacesInRegex , self :: no_banned_types :: NoBannedTypes , self :: no_empty_type_parameters :: NoEmptyTypeParameters , self :: no_excessive_cognitive_complexity :: NoExcessiveCognitiveComplexity , self :: no_excessive_nested_test_suites :: NoExcessiveNestedTestSuites , self :: no_extra_boolean_cast :: NoExtraBooleanCast , self :: no_flat_map_identity :: NoFlatMapIdentity , self :: no_for_each :: NoForEach , self :: no_static_only_class :: NoStaticOnlyClass , self :: no_this_in_static :: NoThisInStatic , self :: no_useless_catch :: NoUselessCatch , self :: no_useless_constructor :: NoUselessConstructor , self :: no_useless_empty_export :: NoUselessEmptyExport , self :: no_useless_escape_in_regex :: NoUselessEscapeInRegex , self :: no_useless_fragments :: NoUselessFragments , self :: no_useless_label :: NoUselessLabel , self :: no_useless_lone_block_statements :: NoUselessLoneBlockStatements , self :: no_useless_rename :: NoUselessRename , self :: no_useless_string_concat :: NoUselessStringConcat , self :: no_useless_string_raw :: NoUselessStringRaw , self :: no_useless_switch_case :: NoUselessSwitchCase , self :: no_useless_ternary :: NoUselessTernary , self :: no_useless_this_alias :: NoUselessThisAlias , self :: no_useless_type_constraint :: NoUselessTypeConstraint , self :: no_useless_undefined_initialization :: NoUselessUndefinedInitialization , self :: no_void :: NoVoid , self :: use_arrow_function :: UseArrowFunction , self :: use_date_now :: UseDateNow , self :: use_flat_map :: UseFlatMap , self :: use_literal_keys :: UseLiteralKeys , self :: use_numeric_literals :: UseNumericLiterals , self :: use_optional_chain :: UseOptionalChain , self :: use_regex_literals :: UseRegexLiterals , self :: use_simple_number_keys :: UseSimpleNumberKeys , self :: use_simplified_logic_expression :: UseSimplifiedLogicExpression , self :: use_while :: UseWhile ,] } }
43+
declare_lint_group! { pub Complexity { name : "complexity" , rules : [self :: no_adjacent_spaces_in_regex :: NoAdjacentSpacesInRegex , self :: no_banned_types :: NoBannedTypes , self :: no_empty_type_parameters :: NoEmptyTypeParameters , self :: no_excessive_cognitive_complexity :: NoExcessiveCognitiveComplexity , self :: no_excessive_nested_test_suites :: NoExcessiveNestedTestSuites , self :: no_extra_boolean_cast :: NoExtraBooleanCast , self :: no_flat_map_identity :: NoFlatMapIdentity , self :: no_for_each :: NoForEach , self :: no_static_only_class :: NoStaticOnlyClass , self :: no_this_in_static :: NoThisInStatic , self :: no_useless_catch :: NoUselessCatch , self :: no_useless_constructor :: NoUselessConstructor , self :: no_useless_continue :: NoUselessContinue , self :: no_useless_empty_export :: NoUselessEmptyExport , self :: no_useless_escape_in_regex :: NoUselessEscapeInRegex , self :: no_useless_fragments :: NoUselessFragments , self :: no_useless_label :: NoUselessLabel , self :: no_useless_lone_block_statements :: NoUselessLoneBlockStatements , self :: no_useless_rename :: NoUselessRename , self :: no_useless_string_concat :: NoUselessStringConcat , self :: no_useless_string_raw :: NoUselessStringRaw , self :: no_useless_switch_case :: NoUselessSwitchCase , self :: no_useless_ternary :: NoUselessTernary , self :: no_useless_this_alias :: NoUselessThisAlias , self :: no_useless_type_constraint :: NoUselessTypeConstraint , self :: no_useless_undefined_initialization :: NoUselessUndefinedInitialization , self :: no_void :: NoVoid , self :: use_arrow_function :: UseArrowFunction , self :: use_date_now :: UseDateNow , self :: use_flat_map :: UseFlatMap , self :: use_literal_keys :: UseLiteralKeys , self :: use_numeric_literals :: UseNumericLiterals , self :: use_optional_chain :: UseOptionalChain , self :: use_regex_literals :: UseRegexLiterals , self :: use_simple_number_keys :: UseSimpleNumberKeys , self :: use_simplified_logic_expression :: UseSimplifiedLogicExpression , self :: use_while :: UseWhile ,] } }

crates/biome_js_analyze/src/lint/correctness/no_useless_continue.rs renamed to crates/biome_js_analyze/src/lint/complexity/no_useless_continue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ declare_lint_rule! {
7474
name: "noUselessContinue",
7575
language: "js",
7676
recommended: true,
77-
severity: Severity::Error,
77+
severity: Severity::Information,
7878
fix_kind: FixKind::Safe,
7979
}
8080
}

crates/biome_js_analyze/src/lint/correctness.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ pub mod no_unused_imports;
3535
pub mod no_unused_labels;
3636
pub mod no_unused_private_class_members;
3737
pub mod no_unused_variables;
38-
pub mod no_useless_continue;
3938
pub mod no_void_elements_with_children;
4039
pub mod no_void_type_return;
4140
pub mod use_exhaustive_dependencies;
@@ -46,4 +45,4 @@ pub mod use_jsx_key_in_iterable;
4645
pub mod use_valid_for_direction;
4746
pub mod use_valid_typeof;
4847
pub mod use_yield;
49-
declare_lint_group! { pub Correctness { name : "correctness" , rules : [self :: no_children_prop :: NoChildrenProp , self :: no_const_assign :: NoConstAssign , self :: no_constant_condition :: NoConstantCondition , self :: no_constant_math_min_max_clamp :: NoConstantMathMinMaxClamp , self :: no_constructor_return :: NoConstructorReturn , self :: no_empty_character_class_in_regex :: NoEmptyCharacterClassInRegex , self :: no_empty_pattern :: NoEmptyPattern , self :: no_global_object_calls :: NoGlobalObjectCalls , self :: no_inner_declarations :: NoInnerDeclarations , self :: no_invalid_builtin_instantiation :: NoInvalidBuiltinInstantiation , self :: no_invalid_constructor_super :: NoInvalidConstructorSuper , self :: no_invalid_use_before_declaration :: NoInvalidUseBeforeDeclaration , self :: no_nodejs_modules :: NoNodejsModules , self :: no_nonoctal_decimal_escape :: NoNonoctalDecimalEscape , self :: no_precision_loss :: NoPrecisionLoss , self :: no_private_imports :: NoPrivateImports , self :: no_render_return_value :: NoRenderReturnValue , self :: no_self_assign :: NoSelfAssign , self :: no_setter_return :: NoSetterReturn , self :: no_string_case_mismatch :: NoStringCaseMismatch , self :: no_switch_declarations :: NoSwitchDeclarations , self :: no_undeclared_dependencies :: NoUndeclaredDependencies , self :: no_undeclared_variables :: NoUndeclaredVariables , self :: no_unreachable :: NoUnreachable , self :: no_unreachable_super :: NoUnreachableSuper , self :: no_unsafe_finally :: NoUnsafeFinally , self :: no_unsafe_optional_chaining :: NoUnsafeOptionalChaining , self :: no_unused_function_parameters :: NoUnusedFunctionParameters , self :: no_unused_imports :: NoUnusedImports , self :: no_unused_labels :: NoUnusedLabels , self :: no_unused_private_class_members :: NoUnusedPrivateClassMembers , self :: no_unused_variables :: NoUnusedVariables , self :: no_useless_continue :: NoUselessContinue , self :: no_void_elements_with_children :: NoVoidElementsWithChildren , self :: no_void_type_return :: NoVoidTypeReturn , self :: use_exhaustive_dependencies :: UseExhaustiveDependencies , self :: use_hook_at_top_level :: UseHookAtTopLevel , self :: use_import_extensions :: UseImportExtensions , self :: use_is_nan :: UseIsNan , self :: use_jsx_key_in_iterable :: UseJsxKeyInIterable , self :: use_valid_for_direction :: UseValidForDirection , self :: use_valid_typeof :: UseValidTypeof , self :: use_yield :: UseYield ,] } }
48+
declare_lint_group! { pub Correctness { name : "correctness" , rules : [self :: no_children_prop :: NoChildrenProp , self :: no_const_assign :: NoConstAssign , self :: no_constant_condition :: NoConstantCondition , self :: no_constant_math_min_max_clamp :: NoConstantMathMinMaxClamp , self :: no_constructor_return :: NoConstructorReturn , self :: no_empty_character_class_in_regex :: NoEmptyCharacterClassInRegex , self :: no_empty_pattern :: NoEmptyPattern , self :: no_global_object_calls :: NoGlobalObjectCalls , self :: no_inner_declarations :: NoInnerDeclarations , self :: no_invalid_builtin_instantiation :: NoInvalidBuiltinInstantiation , self :: no_invalid_constructor_super :: NoInvalidConstructorSuper , self :: no_invalid_use_before_declaration :: NoInvalidUseBeforeDeclaration , self :: no_nodejs_modules :: NoNodejsModules , self :: no_nonoctal_decimal_escape :: NoNonoctalDecimalEscape , self :: no_precision_loss :: NoPrecisionLoss , self :: no_private_imports :: NoPrivateImports , self :: no_render_return_value :: NoRenderReturnValue , self :: no_self_assign :: NoSelfAssign , self :: no_setter_return :: NoSetterReturn , self :: no_string_case_mismatch :: NoStringCaseMismatch , self :: no_switch_declarations :: NoSwitchDeclarations , self :: no_undeclared_dependencies :: NoUndeclaredDependencies , self :: no_undeclared_variables :: NoUndeclaredVariables , self :: no_unreachable :: NoUnreachable , self :: no_unreachable_super :: NoUnreachableSuper , self :: no_unsafe_finally :: NoUnsafeFinally , self :: no_unsafe_optional_chaining :: NoUnsafeOptionalChaining , self :: no_unused_function_parameters :: NoUnusedFunctionParameters , self :: no_unused_imports :: NoUnusedImports , self :: no_unused_labels :: NoUnusedLabels , self :: no_unused_private_class_members :: NoUnusedPrivateClassMembers , self :: no_unused_variables :: NoUnusedVariables , self :: no_void_elements_with_children :: NoVoidElementsWithChildren , self :: no_void_type_return :: NoVoidTypeReturn , self :: use_exhaustive_dependencies :: UseExhaustiveDependencies , self :: use_hook_at_top_level :: UseHookAtTopLevel , self :: use_import_extensions :: UseImportExtensions , self :: use_is_nan :: UseIsNan , self :: use_jsx_key_in_iterable :: UseJsxKeyInIterable , self :: use_valid_for_direction :: UseValidForDirection , self :: use_valid_typeof :: UseValidTypeof , self :: use_yield :: UseYield ,] } }

0 commit comments

Comments
 (0)