diff --git a/.changeset/floppy-sloths-visit.md b/.changeset/floppy-sloths-visit.md new file mode 100644 index 0000000000..f5942e8439 --- /dev/null +++ b/.changeset/floppy-sloths-visit.md @@ -0,0 +1,21 @@ +--- +"@biomejs/biome": minor +--- + +Added the new rule `useBiomeIgnoreFolder`. Since v2.2, Biome correctly prevents the indexing and crawling of folders. + +However, the correct pattern has changed. This rule attempts to detect incorrect usage, and promote the new pattern: + +```diff +// biome.json +{ + "files": { + "includes": [ +- "!dist/**", +- "!**/fixtures/**", ++ "!dist", ++ "!**/fixtures", + ] + } +} +``` diff --git a/.changeset/proud-olives-exist.md b/.changeset/proud-olives-exist.md new file mode 100644 index 0000000000..babf8f5411 --- /dev/null +++ b/.changeset/proud-olives-exist.md @@ -0,0 +1,16 @@ +--- +"@biomejs/biome": minor +--- + +Added the new rule `noBiomeFirstException`. This rule prevents the incorrect usage of patterns inside `files.includes`. + +This rule catches if the first element of the array contains `!`. This mistake will cause Biome to analyze no files: + +```json5 +// biome.json +{ + "files": { + "includes": ["!dist/**"] // this is an error + } +} +``` diff --git a/biome.json b/biome.json index 578b21bd93..69bee24d0b 100644 --- a/biome.json +++ b/biome.json @@ -25,13 +25,13 @@ "**/packages/tailwindcss-config-analyzer/**", "**/benchmark/**", "scripts/**", - "!**/crates/**", - "!**/dist/**", + "!**/crates", + "!**/dist", "!**/packages/@biomejs/backend-jsonrpc/src/workspace.ts", "!**/__snapshots__", - "!**/undefined/**", - "!**/benchmark/target/**", - "!**/benches/**" + "!**/undefined", + "!**/benchmark/target", + "!**/benches" ], "experimentalScannerIgnores": [ ".cargo", diff --git a/crates/biome_configuration/src/analyzer/linter/rules.rs b/crates/biome_configuration/src/analyzer/linter/rules.rs index ef1f265af8..5aea44d581 100644 --- a/crates/biome_configuration/src/analyzer/linter/rules.rs +++ b/crates/biome_configuration/src/analyzer/linter/rules.rs @@ -104,6 +104,7 @@ pub enum RuleName { NoAwaitInLoops, NoBannedTypes, NoBarrelFile, + NoBiomeFirstException, NoBitwiseOperators, NoBlankTarget, NoCatchAssign, @@ -333,6 +334,7 @@ pub enum RuleName { UseAsConstAssertion, UseAtIndex, UseAwait, + UseBiomeIgnoreFolder, UseBlockStatements, UseButtonType, UseCollapsedElseIf, @@ -455,6 +457,7 @@ impl RuleName { Self::NoAwaitInLoops => "noAwaitInLoops", Self::NoBannedTypes => "noBannedTypes", Self::NoBarrelFile => "noBarrelFile", + Self::NoBiomeFirstException => "noBiomeFirstException", Self::NoBitwiseOperators => "noBitwiseOperators", Self::NoBlankTarget => "noBlankTarget", Self::NoCatchAssign => "noCatchAssign", @@ -688,6 +691,7 @@ impl RuleName { Self::UseAsConstAssertion => "useAsConstAssertion", Self::UseAtIndex => "useAtIndex", Self::UseAwait => "useAwait", + Self::UseBiomeIgnoreFolder => "useBiomeIgnoreFolder", Self::UseBlockStatements => "useBlockStatements", Self::UseButtonType => "useButtonType", Self::UseCollapsedElseIf => "useCollapsedElseIf", @@ -810,6 +814,7 @@ impl RuleName { Self::NoAwaitInLoops => RuleGroup::Performance, Self::NoBannedTypes => RuleGroup::Complexity, Self::NoBarrelFile => RuleGroup::Performance, + Self::NoBiomeFirstException => RuleGroup::Suspicious, Self::NoBitwiseOperators => RuleGroup::Suspicious, Self::NoBlankTarget => RuleGroup::Security, Self::NoCatchAssign => RuleGroup::Suspicious, @@ -1039,6 +1044,7 @@ impl RuleName { Self::UseAsConstAssertion => RuleGroup::Style, Self::UseAtIndex => RuleGroup::Style, Self::UseAwait => RuleGroup::Suspicious, + Self::UseBiomeIgnoreFolder => RuleGroup::Suspicious, Self::UseBlockStatements => RuleGroup::Style, Self::UseButtonType => RuleGroup::A11y, Self::UseCollapsedElseIf => RuleGroup::Style, @@ -1164,6 +1170,7 @@ impl std::str::FromStr for RuleName { "noAwaitInLoops" => Ok(Self::NoAwaitInLoops), "noBannedTypes" => Ok(Self::NoBannedTypes), "noBarrelFile" => Ok(Self::NoBarrelFile), + "noBiomeFirstException" => Ok(Self::NoBiomeFirstException), "noBitwiseOperators" => Ok(Self::NoBitwiseOperators), "noBlankTarget" => Ok(Self::NoBlankTarget), "noCatchAssign" => Ok(Self::NoCatchAssign), @@ -1399,6 +1406,7 @@ impl std::str::FromStr for RuleName { "useAsConstAssertion" => Ok(Self::UseAsConstAssertion), "useAtIndex" => Ok(Self::UseAtIndex), "useAwait" => Ok(Self::UseAwait), + "useBiomeIgnoreFolder" => Ok(Self::UseBiomeIgnoreFolder), "useBlockStatements" => Ok(Self::UseBlockStatements), "useButtonType" => Ok(Self::UseButtonType), "useCollapsedElseIf" => Ok(Self::UseCollapsedElseIf), @@ -6746,7 +6754,7 @@ impl From for Style { #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase", default, deny_unknown_fields)] #[doc = r" A list of rules that belong to this group"] -pub struct Suspicious { # [doc = r" It enables the recommended rules for this group"] # [serde (skip_serializing_if = "Option::is_none")] pub recommended : Option < bool > , # [doc = "Disallow the use of alert, confirm, and prompt."] # [serde (skip_serializing_if = "Option::is_none")] pub no_alert : Option < RuleConfiguration < biome_rule_options :: no_alert :: NoAlertOptions >> , # [doc = "Use standard constants instead of approximated literals."] # [serde (skip_serializing_if = "Option::is_none")] pub no_approximative_numeric_constant : Option < RuleFixConfiguration < biome_rule_options :: no_approximative_numeric_constant :: NoApproximativeNumericConstantOptions >> , # [doc = "Discourage the usage of Array index in keys."] # [serde (skip_serializing_if = "Option::is_none")] pub no_array_index_key : Option < RuleConfiguration < biome_rule_options :: no_array_index_key :: NoArrayIndexKeyOptions >> , # [doc = "Disallow assignments in expressions."] # [serde (skip_serializing_if = "Option::is_none")] pub no_assign_in_expressions : Option < RuleConfiguration < biome_rule_options :: no_assign_in_expressions :: NoAssignInExpressionsOptions >> , # [doc = "Disallows using an async function as a Promise executor."] # [serde (skip_serializing_if = "Option::is_none")] pub no_async_promise_executor : Option < RuleConfiguration < biome_rule_options :: no_async_promise_executor :: NoAsyncPromiseExecutorOptions >> , # [doc = "Disallow bitwise operators."] # [serde (skip_serializing_if = "Option::is_none")] pub no_bitwise_operators : Option < RuleConfiguration < biome_rule_options :: no_bitwise_operators :: NoBitwiseOperatorsOptions >> , # [doc = "Disallow reassigning exceptions in catch clauses."] # [serde (skip_serializing_if = "Option::is_none")] pub no_catch_assign : Option < RuleConfiguration < biome_rule_options :: no_catch_assign :: NoCatchAssignOptions >> , # [doc = "Disallow reassigning class members."] # [serde (skip_serializing_if = "Option::is_none")] pub no_class_assign : Option < RuleConfiguration < biome_rule_options :: no_class_assign :: NoClassAssignOptions >> , # [doc = "Prevent comments from being inserted as text nodes"] # [serde (skip_serializing_if = "Option::is_none")] pub no_comment_text : Option < RuleFixConfiguration < biome_rule_options :: no_comment_text :: NoCommentTextOptions >> , # [doc = "Disallow comparing against -0"] # [serde (skip_serializing_if = "Option::is_none")] pub no_compare_neg_zero : Option < RuleFixConfiguration < biome_rule_options :: no_compare_neg_zero :: NoCompareNegZeroOptions >> , # [doc = "Disallow labeled statements that are not loops."] # [serde (skip_serializing_if = "Option::is_none")] pub no_confusing_labels : Option < RuleConfiguration < biome_rule_options :: no_confusing_labels :: NoConfusingLabelsOptions >> , # [doc = "Disallow void type outside of generic or return types."] # [serde (skip_serializing_if = "Option::is_none")] pub no_confusing_void_type : Option < RuleFixConfiguration < biome_rule_options :: no_confusing_void_type :: NoConfusingVoidTypeOptions >> , # [doc = "Disallow the use of console."] # [serde (skip_serializing_if = "Option::is_none")] pub no_console : Option < RuleFixConfiguration < biome_rule_options :: no_console :: NoConsoleOptions >> , # [doc = "Disallow TypeScript const enum"] # [serde (skip_serializing_if = "Option::is_none")] pub no_const_enum : Option < RuleFixConfiguration < biome_rule_options :: no_const_enum :: NoConstEnumOptions >> , # [doc = "Disallow expressions where the operation doesn't affect the value"] # [serde (skip_serializing_if = "Option::is_none")] pub no_constant_binary_expressions : Option < RuleConfiguration < biome_rule_options :: no_constant_binary_expressions :: NoConstantBinaryExpressionsOptions >> , # [doc = "Prevents from having control characters and some escape sequences that match control characters in regular expression literals."] # [serde (skip_serializing_if = "Option::is_none")] pub no_control_characters_in_regex : Option < RuleConfiguration < biome_rule_options :: no_control_characters_in_regex :: NoControlCharactersInRegexOptions >> , # [doc = "Disallow the use of debugger"] # [serde (skip_serializing_if = "Option::is_none")] pub no_debugger : Option < RuleFixConfiguration < biome_rule_options :: no_debugger :: NoDebuggerOptions >> , # [doc = "Disallow direct assignments to document.cookie."] # [serde (skip_serializing_if = "Option::is_none")] pub no_document_cookie : Option < RuleConfiguration < biome_rule_options :: no_document_cookie :: NoDocumentCookieOptions >> , # [doc = "Prevents importing next/document outside of pages/_document.jsx in Next.js projects."] # [serde (skip_serializing_if = "Option::is_none")] pub no_document_import_in_page : Option < RuleConfiguration < biome_rule_options :: no_document_import_in_page :: NoDocumentImportInPageOptions >> , # [doc = "Require the use of === and !==."] # [serde (skip_serializing_if = "Option::is_none")] pub no_double_equals : Option < RuleFixConfiguration < biome_rule_options :: no_double_equals :: NoDoubleEqualsOptions >> , # [doc = "Disallow duplicate @import rules."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_at_import_rules : Option < RuleConfiguration < biome_rule_options :: no_duplicate_at_import_rules :: NoDuplicateAtImportRulesOptions >> , # [doc = "Disallow duplicate case labels."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_case : Option < RuleConfiguration < biome_rule_options :: no_duplicate_case :: NoDuplicateCaseOptions >> , # [doc = "Disallow duplicate class members."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_class_members : Option < RuleConfiguration < biome_rule_options :: no_duplicate_class_members :: NoDuplicateClassMembersOptions >> , # [doc = "Disallow duplicate custom properties within declaration blocks."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_custom_properties : Option < RuleConfiguration < biome_rule_options :: no_duplicate_custom_properties :: NoDuplicateCustomPropertiesOptions >> , # [doc = "Disallow duplicate conditions in if-else-if chains"] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_else_if : Option < RuleConfiguration < biome_rule_options :: no_duplicate_else_if :: NoDuplicateElseIfOptions >> , # [doc = "No duplicated fields in GraphQL operations."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_fields : Option < RuleConfiguration < biome_rule_options :: no_duplicate_fields :: NoDuplicateFieldsOptions >> , # [doc = "Disallow duplicate names within font families."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_font_names : Option < RuleConfiguration < biome_rule_options :: no_duplicate_font_names :: NoDuplicateFontNamesOptions >> , # [doc = "Prevents JSX properties to be assigned multiple times."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_jsx_props : Option < RuleConfiguration < biome_rule_options :: no_duplicate_jsx_props :: NoDuplicateJsxPropsOptions >> , # [doc = "Disallow two keys with the same name inside objects."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_object_keys : Option < RuleConfiguration < biome_rule_options :: no_duplicate_object_keys :: NoDuplicateObjectKeysOptions >> , # [doc = "Disallow duplicate function parameter name."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_parameters : Option < RuleConfiguration < biome_rule_options :: no_duplicate_parameters :: NoDuplicateParametersOptions >> , # [doc = "Disallow duplicate properties within declaration blocks."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_properties : Option < RuleConfiguration < biome_rule_options :: no_duplicate_properties :: NoDuplicatePropertiesOptions >> , # [doc = "Disallow duplicate selectors within keyframe blocks."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_selectors_keyframe_block : Option < RuleConfiguration < biome_rule_options :: no_duplicate_selectors_keyframe_block :: NoDuplicateSelectorsKeyframeBlockOptions >> , # [doc = "A describe block should not contain duplicate hooks."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_test_hooks : Option < RuleConfiguration < biome_rule_options :: no_duplicate_test_hooks :: NoDuplicateTestHooksOptions >> , # [doc = "Disallow CSS empty blocks."] # [serde (skip_serializing_if = "Option::is_none")] pub no_empty_block : Option < RuleConfiguration < biome_rule_options :: no_empty_block :: NoEmptyBlockOptions >> , # [doc = "Disallow empty block statements and static blocks."] # [serde (skip_serializing_if = "Option::is_none")] pub no_empty_block_statements : Option < RuleConfiguration < biome_rule_options :: no_empty_block_statements :: NoEmptyBlockStatementsOptions >> , # [doc = "Disallow the declaration of empty interfaces."] # [serde (skip_serializing_if = "Option::is_none")] pub no_empty_interface : Option < RuleFixConfiguration < biome_rule_options :: no_empty_interface :: NoEmptyInterfaceOptions >> , # [doc = "Disallow variables from evolving into any type through reassignments."] # [serde (skip_serializing_if = "Option::is_none")] pub no_evolving_types : Option < RuleConfiguration < biome_rule_options :: no_evolving_types :: NoEvolvingTypesOptions >> , # [doc = "Disallow the any type usage."] # [serde (skip_serializing_if = "Option::is_none")] pub no_explicit_any : Option < RuleConfiguration < biome_rule_options :: no_explicit_any :: NoExplicitAnyOptions >> , # [doc = "Disallow using export or module.exports in files containing tests"] # [serde (skip_serializing_if = "Option::is_none")] pub no_exports_in_test : Option < RuleConfiguration < biome_rule_options :: no_exports_in_test :: NoExportsInTestOptions >> , # [doc = "Prevents the wrong usage of the non-null assertion operator (!) in TypeScript files."] # [serde (skip_serializing_if = "Option::is_none")] pub no_extra_non_null_assertion : Option < RuleFixConfiguration < biome_rule_options :: no_extra_non_null_assertion :: NoExtraNonNullAssertionOptions >> , # [doc = "Disallow fallthrough of switch clauses."] # [serde (skip_serializing_if = "Option::is_none")] pub no_fallthrough_switch_clause : Option < RuleConfiguration < biome_rule_options :: no_fallthrough_switch_clause :: NoFallthroughSwitchClauseOptions >> , # [doc = "Disallow focused tests."] # [serde (skip_serializing_if = "Option::is_none")] pub no_focused_tests : Option < RuleFixConfiguration < biome_rule_options :: no_focused_tests :: NoFocusedTestsOptions >> , # [doc = "Disallow reassigning function declarations."] # [serde (skip_serializing_if = "Option::is_none")] pub no_function_assign : Option < RuleConfiguration < biome_rule_options :: no_function_assign :: NoFunctionAssignOptions >> , # [doc = "Disallow assignments to native objects and read-only global variables."] # [serde (skip_serializing_if = "Option::is_none")] pub no_global_assign : Option < RuleConfiguration < biome_rule_options :: no_global_assign :: NoGlobalAssignOptions >> , # [doc = "Use Number.isFinite instead of global isFinite."] # [serde (skip_serializing_if = "Option::is_none")] pub no_global_is_finite : Option < RuleFixConfiguration < biome_rule_options :: no_global_is_finite :: NoGlobalIsFiniteOptions >> , # [doc = "Use Number.isNaN instead of global isNaN."] # [serde (skip_serializing_if = "Option::is_none")] pub no_global_is_nan : Option < RuleFixConfiguration < biome_rule_options :: no_global_is_nan :: NoGlobalIsNanOptions >> , # [doc = "Prevent using the next/head module in pages/_document.js on Next.js projects."] # [serde (skip_serializing_if = "Option::is_none")] pub no_head_import_in_document : Option < RuleConfiguration < biome_rule_options :: no_head_import_in_document :: NoHeadImportInDocumentOptions >> , # [doc = "Disallow use of implicit any type on variable declarations."] # [serde (skip_serializing_if = "Option::is_none")] pub no_implicit_any_let : Option < RuleConfiguration < biome_rule_options :: no_implicit_any_let :: NoImplicitAnyLetOptions >> , # [doc = "Disallow assigning to imported bindings"] # [serde (skip_serializing_if = "Option::is_none")] pub no_import_assign : Option < RuleConfiguration < biome_rule_options :: no_import_assign :: NoImportAssignOptions >> , # [doc = "Disallow invalid !important within keyframe declarations"] # [serde (skip_serializing_if = "Option::is_none")] pub no_important_in_keyframe : Option < RuleConfiguration < biome_rule_options :: no_important_in_keyframe :: NoImportantInKeyframeOptions >> , # [doc = "Disallows the use of irregular whitespace characters."] # [serde (skip_serializing_if = "Option::is_none")] pub no_irregular_whitespace : Option < RuleConfiguration < biome_rule_options :: no_irregular_whitespace :: NoIrregularWhitespaceOptions >> , # [doc = "Disallow labels that share a name with a variable"] # [serde (skip_serializing_if = "Option::is_none")] pub no_label_var : Option < RuleConfiguration < biome_rule_options :: no_label_var :: NoLabelVarOptions >> , # [doc = "Disallow characters made with multiple code points in character class syntax."] # [serde (skip_serializing_if = "Option::is_none")] pub no_misleading_character_class : Option < RuleFixConfiguration < biome_rule_options :: no_misleading_character_class :: NoMisleadingCharacterClassOptions >> , # [doc = "Enforce proper usage of new and constructor."] # [serde (skip_serializing_if = "Option::is_none")] pub no_misleading_instantiator : Option < RuleConfiguration < biome_rule_options :: no_misleading_instantiator :: NoMisleadingInstantiatorOptions >> , # [doc = "Checks that the assertion function, for example expect, is placed inside an it() function call."] # [serde (skip_serializing_if = "Option::is_none")] pub no_misplaced_assertion : Option < RuleConfiguration < biome_rule_options :: no_misplaced_assertion :: NoMisplacedAssertionOptions >> , # [doc = "Disallow shorthand assign when variable appears on both sides."] # [serde (skip_serializing_if = "Option::is_none")] pub no_misrefactored_shorthand_assign : Option < RuleFixConfiguration < biome_rule_options :: no_misrefactored_shorthand_assign :: NoMisrefactoredShorthandAssignOptions >> , # [doc = "Disallow octal escape sequences in string literals"] # [serde (skip_serializing_if = "Option::is_none")] pub no_octal_escape : Option < RuleFixConfiguration < biome_rule_options :: no_octal_escape :: NoOctalEscapeOptions >> , # [doc = "Disallow direct use of Object.prototype builtins."] # [serde (skip_serializing_if = "Option::is_none")] pub no_prototype_builtins : Option < RuleFixConfiguration < biome_rule_options :: no_prototype_builtins :: NoPrototypeBuiltinsOptions >> , # [doc = "Disallow the use if quickfix.biome inside editor settings file."] # [serde (skip_serializing_if = "Option::is_none")] pub no_quickfix_biome : Option < RuleFixConfiguration < biome_rule_options :: no_quickfix_biome :: NoQuickfixBiomeOptions >> , # [doc = "Prevents React-specific JSX properties from being used."] # [serde (skip_serializing_if = "Option::is_none")] pub no_react_specific_props : Option < RuleFixConfiguration < biome_rule_options :: no_react_specific_props :: NoReactSpecificPropsOptions >> , # [doc = "Disallow variable, function, class, and type redeclarations in the same scope."] # [serde (skip_serializing_if = "Option::is_none")] pub no_redeclare : Option < RuleConfiguration < biome_rule_options :: no_redeclare :: NoRedeclareOptions >> , # [doc = "Prevents from having redundant \"use strict\"."] # [serde (skip_serializing_if = "Option::is_none")] pub no_redundant_use_strict : Option < RuleFixConfiguration < biome_rule_options :: no_redundant_use_strict :: NoRedundantUseStrictOptions >> , # [doc = "Disallow comparisons where both sides are exactly the same."] # [serde (skip_serializing_if = "Option::is_none")] pub no_self_compare : Option < RuleConfiguration < biome_rule_options :: no_self_compare :: NoSelfCompareOptions >> , # [doc = "Disallow identifiers from shadowing restricted names."] # [serde (skip_serializing_if = "Option::is_none")] pub no_shadow_restricted_names : Option < RuleConfiguration < biome_rule_options :: no_shadow_restricted_names :: NoShadowRestrictedNamesOptions >> , # [doc = "Disallow shorthand properties that override related longhand properties."] # [serde (skip_serializing_if = "Option::is_none")] pub no_shorthand_property_overrides : Option < RuleConfiguration < biome_rule_options :: no_shorthand_property_overrides :: NoShorthandPropertyOverridesOptions >> , # [doc = "Disallow disabled tests."] # [serde (skip_serializing_if = "Option::is_none")] pub no_skipped_tests : Option < RuleFixConfiguration < biome_rule_options :: no_skipped_tests :: NoSkippedTestsOptions >> , # [doc = "Prevents the use of sparse arrays (arrays with holes)."] # [serde (skip_serializing_if = "Option::is_none")] pub no_sparse_array : Option < RuleFixConfiguration < biome_rule_options :: no_sparse_array :: NoSparseArrayOptions >> , # [doc = "It detects possible \"wrong\" semicolons inside JSX elements."] # [serde (skip_serializing_if = "Option::is_none")] pub no_suspicious_semicolon_in_jsx : Option < RuleConfiguration < biome_rule_options :: no_suspicious_semicolon_in_jsx :: NoSuspiciousSemicolonInJsxOptions >> , # [doc = "Disallow template literal placeholder syntax in regular strings."] # [serde (skip_serializing_if = "Option::is_none")] pub no_template_curly_in_string : Option < RuleConfiguration < biome_rule_options :: no_template_curly_in_string :: NoTemplateCurlyInStringOptions >> , # [doc = "Disallow then property."] # [serde (skip_serializing_if = "Option::is_none")] pub no_then_property : Option < RuleConfiguration < biome_rule_options :: no_then_property :: NoThenPropertyOptions >> , # [doc = "Prevents the use of the TypeScript directive @ts-ignore."] # [serde (skip_serializing_if = "Option::is_none")] pub no_ts_ignore : Option < RuleFixConfiguration < biome_rule_options :: no_ts_ignore :: NoTsIgnoreOptions >> , # [doc = "Disallow let or var variables that are read but never assigned."] # [serde (skip_serializing_if = "Option::is_none")] pub no_unassigned_variables : Option < RuleConfiguration < biome_rule_options :: no_unassigned_variables :: NoUnassignedVariablesOptions >> , # [doc = "Disallow unknown at-rules."] # [serde (skip_serializing_if = "Option::is_none")] pub no_unknown_at_rules : Option < RuleConfiguration < biome_rule_options :: no_unknown_at_rules :: NoUnknownAtRulesOptions >> , # [doc = "Disallow unsafe declaration merging between interfaces and classes."] # [serde (skip_serializing_if = "Option::is_none")] pub no_unsafe_declaration_merging : Option < RuleConfiguration < biome_rule_options :: no_unsafe_declaration_merging :: NoUnsafeDeclarationMergingOptions >> , # [doc = "Disallow using unsafe negation."] # [serde (skip_serializing_if = "Option::is_none")] pub no_unsafe_negation : Option < RuleFixConfiguration < biome_rule_options :: no_unsafe_negation :: NoUnsafeNegationOptions >> , # [doc = "Disallow unnecessary escapes in string literals."] # [serde (skip_serializing_if = "Option::is_none")] pub no_useless_escape_in_string : Option < RuleFixConfiguration < biome_rule_options :: no_useless_escape_in_string :: NoUselessEscapeInStringOptions >> , # [doc = "Disallow useless backreferences in regular expression literals that always match an empty string."] # [serde (skip_serializing_if = "Option::is_none")] pub no_useless_regex_backrefs : Option < RuleConfiguration < biome_rule_options :: no_useless_regex_backrefs :: NoUselessRegexBackrefsOptions >> , # [doc = "Disallow the use of var"] # [serde (skip_serializing_if = "Option::is_none")] pub no_var : Option < RuleFixConfiguration < biome_rule_options :: no_var :: NoVarOptions >> , # [doc = "Disallow with statements in non-strict contexts."] # [serde (skip_serializing_if = "Option::is_none")] pub no_with : Option < RuleConfiguration < biome_rule_options :: no_with :: NoWithOptions >> , # [doc = "Disallow the use of overload signatures that are not next to each other."] # [serde (skip_serializing_if = "Option::is_none")] pub use_adjacent_overload_signatures : Option < RuleConfiguration < biome_rule_options :: use_adjacent_overload_signatures :: UseAdjacentOverloadSignaturesOptions >> , # [doc = "Ensure async functions utilize await."] # [serde (skip_serializing_if = "Option::is_none")] pub use_await : Option < RuleConfiguration < biome_rule_options :: use_await :: UseAwaitOptions >> , # [doc = "Enforce default clauses in switch statements to be last"] # [serde (skip_serializing_if = "Option::is_none")] pub use_default_switch_clause_last : Option < RuleConfiguration < biome_rule_options :: use_default_switch_clause_last :: UseDefaultSwitchClauseLastOptions >> , # [doc = "Enforce passing a message value when creating a built-in error."] # [serde (skip_serializing_if = "Option::is_none")] pub use_error_message : Option < RuleConfiguration < biome_rule_options :: use_error_message :: UseErrorMessageOptions >> , # [doc = "Enforce get methods to always return a value."] # [serde (skip_serializing_if = "Option::is_none")] pub use_getter_return : Option < RuleConfiguration < biome_rule_options :: use_getter_return :: UseGetterReturnOptions >> , # [doc = "Enforces the use of a recommended display strategy with Google Fonts."] # [serde (skip_serializing_if = "Option::is_none")] pub use_google_font_display : Option < RuleConfiguration < biome_rule_options :: use_google_font_display :: UseGoogleFontDisplayOptions >> , # [doc = "Require for-in loops to include an if statement."] # [serde (skip_serializing_if = "Option::is_none")] pub use_guard_for_in : Option < RuleConfiguration < biome_rule_options :: use_guard_for_in :: UseGuardForInOptions >> , # [doc = "Use Array.isArray() instead of instanceof Array."] # [serde (skip_serializing_if = "Option::is_none")] pub use_is_array : Option < RuleFixConfiguration < biome_rule_options :: use_is_array :: UseIsArrayOptions >> , # [doc = "Enforce consistent return values in iterable callbacks."] # [serde (skip_serializing_if = "Option::is_none")] pub use_iterable_callback_return : Option < RuleConfiguration < biome_rule_options :: use_iterable_callback_return :: UseIterableCallbackReturnOptions >> , # [doc = "Require using the namespace keyword over the module keyword to declare TypeScript namespaces."] # [serde (skip_serializing_if = "Option::is_none")] pub use_namespace_keyword : Option < RuleFixConfiguration < biome_rule_options :: use_namespace_keyword :: UseNamespaceKeywordOptions >> , # [doc = "Enforce using the digits argument with Number#toFixed()."] # [serde (skip_serializing_if = "Option::is_none")] pub use_number_to_fixed_digits_argument : Option < RuleFixConfiguration < biome_rule_options :: use_number_to_fixed_digits_argument :: UseNumberToFixedDigitsArgumentOptions >> , # [doc = "Use static Response methods instead of new Response() constructor when possible."] # [serde (skip_serializing_if = "Option::is_none")] pub use_static_response_methods : Option < RuleFixConfiguration < biome_rule_options :: use_static_response_methods :: UseStaticResponseMethodsOptions >> , # [doc = "Enforce the use of the directive \"use strict\" in script files."] # [serde (skip_serializing_if = "Option::is_none")] pub use_strict_mode : Option < RuleFixConfiguration < biome_rule_options :: use_strict_mode :: UseStrictModeOptions >> } +pub struct Suspicious { # [doc = r" It enables the recommended rules for this group"] # [serde (skip_serializing_if = "Option::is_none")] pub recommended : Option < bool > , # [doc = "Disallow the use of alert, confirm, and prompt."] # [serde (skip_serializing_if = "Option::is_none")] pub no_alert : Option < RuleConfiguration < biome_rule_options :: no_alert :: NoAlertOptions >> , # [doc = "Use standard constants instead of approximated literals."] # [serde (skip_serializing_if = "Option::is_none")] pub no_approximative_numeric_constant : Option < RuleFixConfiguration < biome_rule_options :: no_approximative_numeric_constant :: NoApproximativeNumericConstantOptions >> , # [doc = "Discourage the usage of Array index in keys."] # [serde (skip_serializing_if = "Option::is_none")] pub no_array_index_key : Option < RuleConfiguration < biome_rule_options :: no_array_index_key :: NoArrayIndexKeyOptions >> , # [doc = "Disallow assignments in expressions."] # [serde (skip_serializing_if = "Option::is_none")] pub no_assign_in_expressions : Option < RuleConfiguration < biome_rule_options :: no_assign_in_expressions :: NoAssignInExpressionsOptions >> , # [doc = "Disallows using an async function as a Promise executor."] # [serde (skip_serializing_if = "Option::is_none")] pub no_async_promise_executor : Option < RuleConfiguration < biome_rule_options :: no_async_promise_executor :: NoAsyncPromiseExecutorOptions >> , # [doc = "Prevents the use of the ! pattern in the first position of files.includes in the configuration file."] # [serde (skip_serializing_if = "Option::is_none")] pub no_biome_first_exception : Option < RuleFixConfiguration < biome_rule_options :: no_biome_first_exception :: NoBiomeFirstExceptionOptions >> , # [doc = "Disallow bitwise operators."] # [serde (skip_serializing_if = "Option::is_none")] pub no_bitwise_operators : Option < RuleConfiguration < biome_rule_options :: no_bitwise_operators :: NoBitwiseOperatorsOptions >> , # [doc = "Disallow reassigning exceptions in catch clauses."] # [serde (skip_serializing_if = "Option::is_none")] pub no_catch_assign : Option < RuleConfiguration < biome_rule_options :: no_catch_assign :: NoCatchAssignOptions >> , # [doc = "Disallow reassigning class members."] # [serde (skip_serializing_if = "Option::is_none")] pub no_class_assign : Option < RuleConfiguration < biome_rule_options :: no_class_assign :: NoClassAssignOptions >> , # [doc = "Prevent comments from being inserted as text nodes"] # [serde (skip_serializing_if = "Option::is_none")] pub no_comment_text : Option < RuleFixConfiguration < biome_rule_options :: no_comment_text :: NoCommentTextOptions >> , # [doc = "Disallow comparing against -0"] # [serde (skip_serializing_if = "Option::is_none")] pub no_compare_neg_zero : Option < RuleFixConfiguration < biome_rule_options :: no_compare_neg_zero :: NoCompareNegZeroOptions >> , # [doc = "Disallow labeled statements that are not loops."] # [serde (skip_serializing_if = "Option::is_none")] pub no_confusing_labels : Option < RuleConfiguration < biome_rule_options :: no_confusing_labels :: NoConfusingLabelsOptions >> , # [doc = "Disallow void type outside of generic or return types."] # [serde (skip_serializing_if = "Option::is_none")] pub no_confusing_void_type : Option < RuleFixConfiguration < biome_rule_options :: no_confusing_void_type :: NoConfusingVoidTypeOptions >> , # [doc = "Disallow the use of console."] # [serde (skip_serializing_if = "Option::is_none")] pub no_console : Option < RuleFixConfiguration < biome_rule_options :: no_console :: NoConsoleOptions >> , # [doc = "Disallow TypeScript const enum"] # [serde (skip_serializing_if = "Option::is_none")] pub no_const_enum : Option < RuleFixConfiguration < biome_rule_options :: no_const_enum :: NoConstEnumOptions >> , # [doc = "Disallow expressions where the operation doesn't affect the value"] # [serde (skip_serializing_if = "Option::is_none")] pub no_constant_binary_expressions : Option < RuleConfiguration < biome_rule_options :: no_constant_binary_expressions :: NoConstantBinaryExpressionsOptions >> , # [doc = "Prevents from having control characters and some escape sequences that match control characters in regular expression literals."] # [serde (skip_serializing_if = "Option::is_none")] pub no_control_characters_in_regex : Option < RuleConfiguration < biome_rule_options :: no_control_characters_in_regex :: NoControlCharactersInRegexOptions >> , # [doc = "Disallow the use of debugger"] # [serde (skip_serializing_if = "Option::is_none")] pub no_debugger : Option < RuleFixConfiguration < biome_rule_options :: no_debugger :: NoDebuggerOptions >> , # [doc = "Disallow direct assignments to document.cookie."] # [serde (skip_serializing_if = "Option::is_none")] pub no_document_cookie : Option < RuleConfiguration < biome_rule_options :: no_document_cookie :: NoDocumentCookieOptions >> , # [doc = "Prevents importing next/document outside of pages/_document.jsx in Next.js projects."] # [serde (skip_serializing_if = "Option::is_none")] pub no_document_import_in_page : Option < RuleConfiguration < biome_rule_options :: no_document_import_in_page :: NoDocumentImportInPageOptions >> , # [doc = "Require the use of === and !==."] # [serde (skip_serializing_if = "Option::is_none")] pub no_double_equals : Option < RuleFixConfiguration < biome_rule_options :: no_double_equals :: NoDoubleEqualsOptions >> , # [doc = "Disallow duplicate @import rules."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_at_import_rules : Option < RuleConfiguration < biome_rule_options :: no_duplicate_at_import_rules :: NoDuplicateAtImportRulesOptions >> , # [doc = "Disallow duplicate case labels."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_case : Option < RuleConfiguration < biome_rule_options :: no_duplicate_case :: NoDuplicateCaseOptions >> , # [doc = "Disallow duplicate class members."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_class_members : Option < RuleConfiguration < biome_rule_options :: no_duplicate_class_members :: NoDuplicateClassMembersOptions >> , # [doc = "Disallow duplicate custom properties within declaration blocks."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_custom_properties : Option < RuleConfiguration < biome_rule_options :: no_duplicate_custom_properties :: NoDuplicateCustomPropertiesOptions >> , # [doc = "Disallow duplicate conditions in if-else-if chains"] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_else_if : Option < RuleConfiguration < biome_rule_options :: no_duplicate_else_if :: NoDuplicateElseIfOptions >> , # [doc = "No duplicated fields in GraphQL operations."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_fields : Option < RuleConfiguration < biome_rule_options :: no_duplicate_fields :: NoDuplicateFieldsOptions >> , # [doc = "Disallow duplicate names within font families."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_font_names : Option < RuleConfiguration < biome_rule_options :: no_duplicate_font_names :: NoDuplicateFontNamesOptions >> , # [doc = "Prevents JSX properties to be assigned multiple times."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_jsx_props : Option < RuleConfiguration < biome_rule_options :: no_duplicate_jsx_props :: NoDuplicateJsxPropsOptions >> , # [doc = "Disallow two keys with the same name inside objects."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_object_keys : Option < RuleConfiguration < biome_rule_options :: no_duplicate_object_keys :: NoDuplicateObjectKeysOptions >> , # [doc = "Disallow duplicate function parameter name."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_parameters : Option < RuleConfiguration < biome_rule_options :: no_duplicate_parameters :: NoDuplicateParametersOptions >> , # [doc = "Disallow duplicate properties within declaration blocks."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_properties : Option < RuleConfiguration < biome_rule_options :: no_duplicate_properties :: NoDuplicatePropertiesOptions >> , # [doc = "Disallow duplicate selectors within keyframe blocks."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_selectors_keyframe_block : Option < RuleConfiguration < biome_rule_options :: no_duplicate_selectors_keyframe_block :: NoDuplicateSelectorsKeyframeBlockOptions >> , # [doc = "A describe block should not contain duplicate hooks."] # [serde (skip_serializing_if = "Option::is_none")] pub no_duplicate_test_hooks : Option < RuleConfiguration < biome_rule_options :: no_duplicate_test_hooks :: NoDuplicateTestHooksOptions >> , # [doc = "Disallow CSS empty blocks."] # [serde (skip_serializing_if = "Option::is_none")] pub no_empty_block : Option < RuleConfiguration < biome_rule_options :: no_empty_block :: NoEmptyBlockOptions >> , # [doc = "Disallow empty block statements and static blocks."] # [serde (skip_serializing_if = "Option::is_none")] pub no_empty_block_statements : Option < RuleConfiguration < biome_rule_options :: no_empty_block_statements :: NoEmptyBlockStatementsOptions >> , # [doc = "Disallow the declaration of empty interfaces."] # [serde (skip_serializing_if = "Option::is_none")] pub no_empty_interface : Option < RuleFixConfiguration < biome_rule_options :: no_empty_interface :: NoEmptyInterfaceOptions >> , # [doc = "Disallow variables from evolving into any type through reassignments."] # [serde (skip_serializing_if = "Option::is_none")] pub no_evolving_types : Option < RuleConfiguration < biome_rule_options :: no_evolving_types :: NoEvolvingTypesOptions >> , # [doc = "Disallow the any type usage."] # [serde (skip_serializing_if = "Option::is_none")] pub no_explicit_any : Option < RuleConfiguration < biome_rule_options :: no_explicit_any :: NoExplicitAnyOptions >> , # [doc = "Disallow using export or module.exports in files containing tests"] # [serde (skip_serializing_if = "Option::is_none")] pub no_exports_in_test : Option < RuleConfiguration < biome_rule_options :: no_exports_in_test :: NoExportsInTestOptions >> , # [doc = "Prevents the wrong usage of the non-null assertion operator (!) in TypeScript files."] # [serde (skip_serializing_if = "Option::is_none")] pub no_extra_non_null_assertion : Option < RuleFixConfiguration < biome_rule_options :: no_extra_non_null_assertion :: NoExtraNonNullAssertionOptions >> , # [doc = "Disallow fallthrough of switch clauses."] # [serde (skip_serializing_if = "Option::is_none")] pub no_fallthrough_switch_clause : Option < RuleConfiguration < biome_rule_options :: no_fallthrough_switch_clause :: NoFallthroughSwitchClauseOptions >> , # [doc = "Disallow focused tests."] # [serde (skip_serializing_if = "Option::is_none")] pub no_focused_tests : Option < RuleFixConfiguration < biome_rule_options :: no_focused_tests :: NoFocusedTestsOptions >> , # [doc = "Disallow reassigning function declarations."] # [serde (skip_serializing_if = "Option::is_none")] pub no_function_assign : Option < RuleConfiguration < biome_rule_options :: no_function_assign :: NoFunctionAssignOptions >> , # [doc = "Disallow assignments to native objects and read-only global variables."] # [serde (skip_serializing_if = "Option::is_none")] pub no_global_assign : Option < RuleConfiguration < biome_rule_options :: no_global_assign :: NoGlobalAssignOptions >> , # [doc = "Use Number.isFinite instead of global isFinite."] # [serde (skip_serializing_if = "Option::is_none")] pub no_global_is_finite : Option < RuleFixConfiguration < biome_rule_options :: no_global_is_finite :: NoGlobalIsFiniteOptions >> , # [doc = "Use Number.isNaN instead of global isNaN."] # [serde (skip_serializing_if = "Option::is_none")] pub no_global_is_nan : Option < RuleFixConfiguration < biome_rule_options :: no_global_is_nan :: NoGlobalIsNanOptions >> , # [doc = "Prevent using the next/head module in pages/_document.js on Next.js projects."] # [serde (skip_serializing_if = "Option::is_none")] pub no_head_import_in_document : Option < RuleConfiguration < biome_rule_options :: no_head_import_in_document :: NoHeadImportInDocumentOptions >> , # [doc = "Disallow use of implicit any type on variable declarations."] # [serde (skip_serializing_if = "Option::is_none")] pub no_implicit_any_let : Option < RuleConfiguration < biome_rule_options :: no_implicit_any_let :: NoImplicitAnyLetOptions >> , # [doc = "Disallow assigning to imported bindings"] # [serde (skip_serializing_if = "Option::is_none")] pub no_import_assign : Option < RuleConfiguration < biome_rule_options :: no_import_assign :: NoImportAssignOptions >> , # [doc = "Disallow invalid !important within keyframe declarations"] # [serde (skip_serializing_if = "Option::is_none")] pub no_important_in_keyframe : Option < RuleConfiguration < biome_rule_options :: no_important_in_keyframe :: NoImportantInKeyframeOptions >> , # [doc = "Disallows the use of irregular whitespace characters."] # [serde (skip_serializing_if = "Option::is_none")] pub no_irregular_whitespace : Option < RuleConfiguration < biome_rule_options :: no_irregular_whitespace :: NoIrregularWhitespaceOptions >> , # [doc = "Disallow labels that share a name with a variable"] # [serde (skip_serializing_if = "Option::is_none")] pub no_label_var : Option < RuleConfiguration < biome_rule_options :: no_label_var :: NoLabelVarOptions >> , # [doc = "Disallow characters made with multiple code points in character class syntax."] # [serde (skip_serializing_if = "Option::is_none")] pub no_misleading_character_class : Option < RuleFixConfiguration < biome_rule_options :: no_misleading_character_class :: NoMisleadingCharacterClassOptions >> , # [doc = "Enforce proper usage of new and constructor."] # [serde (skip_serializing_if = "Option::is_none")] pub no_misleading_instantiator : Option < RuleConfiguration < biome_rule_options :: no_misleading_instantiator :: NoMisleadingInstantiatorOptions >> , # [doc = "Checks that the assertion function, for example expect, is placed inside an it() function call."] # [serde (skip_serializing_if = "Option::is_none")] pub no_misplaced_assertion : Option < RuleConfiguration < biome_rule_options :: no_misplaced_assertion :: NoMisplacedAssertionOptions >> , # [doc = "Disallow shorthand assign when variable appears on both sides."] # [serde (skip_serializing_if = "Option::is_none")] pub no_misrefactored_shorthand_assign : Option < RuleFixConfiguration < biome_rule_options :: no_misrefactored_shorthand_assign :: NoMisrefactoredShorthandAssignOptions >> , # [doc = "Disallow octal escape sequences in string literals"] # [serde (skip_serializing_if = "Option::is_none")] pub no_octal_escape : Option < RuleFixConfiguration < biome_rule_options :: no_octal_escape :: NoOctalEscapeOptions >> , # [doc = "Disallow direct use of Object.prototype builtins."] # [serde (skip_serializing_if = "Option::is_none")] pub no_prototype_builtins : Option < RuleFixConfiguration < biome_rule_options :: no_prototype_builtins :: NoPrototypeBuiltinsOptions >> , # [doc = "Disallow the use if quickfix.biome inside editor settings file."] # [serde (skip_serializing_if = "Option::is_none")] pub no_quickfix_biome : Option < RuleFixConfiguration < biome_rule_options :: no_quickfix_biome :: NoQuickfixBiomeOptions >> , # [doc = "Prevents React-specific JSX properties from being used."] # [serde (skip_serializing_if = "Option::is_none")] pub no_react_specific_props : Option < RuleFixConfiguration < biome_rule_options :: no_react_specific_props :: NoReactSpecificPropsOptions >> , # [doc = "Disallow variable, function, class, and type redeclarations in the same scope."] # [serde (skip_serializing_if = "Option::is_none")] pub no_redeclare : Option < RuleConfiguration < biome_rule_options :: no_redeclare :: NoRedeclareOptions >> , # [doc = "Prevents from having redundant \"use strict\"."] # [serde (skip_serializing_if = "Option::is_none")] pub no_redundant_use_strict : Option < RuleFixConfiguration < biome_rule_options :: no_redundant_use_strict :: NoRedundantUseStrictOptions >> , # [doc = "Disallow comparisons where both sides are exactly the same."] # [serde (skip_serializing_if = "Option::is_none")] pub no_self_compare : Option < RuleConfiguration < biome_rule_options :: no_self_compare :: NoSelfCompareOptions >> , # [doc = "Disallow identifiers from shadowing restricted names."] # [serde (skip_serializing_if = "Option::is_none")] pub no_shadow_restricted_names : Option < RuleConfiguration < biome_rule_options :: no_shadow_restricted_names :: NoShadowRestrictedNamesOptions >> , # [doc = "Disallow shorthand properties that override related longhand properties."] # [serde (skip_serializing_if = "Option::is_none")] pub no_shorthand_property_overrides : Option < RuleConfiguration < biome_rule_options :: no_shorthand_property_overrides :: NoShorthandPropertyOverridesOptions >> , # [doc = "Disallow disabled tests."] # [serde (skip_serializing_if = "Option::is_none")] pub no_skipped_tests : Option < RuleFixConfiguration < biome_rule_options :: no_skipped_tests :: NoSkippedTestsOptions >> , # [doc = "Prevents the use of sparse arrays (arrays with holes)."] # [serde (skip_serializing_if = "Option::is_none")] pub no_sparse_array : Option < RuleFixConfiguration < biome_rule_options :: no_sparse_array :: NoSparseArrayOptions >> , # [doc = "It detects possible \"wrong\" semicolons inside JSX elements."] # [serde (skip_serializing_if = "Option::is_none")] pub no_suspicious_semicolon_in_jsx : Option < RuleConfiguration < biome_rule_options :: no_suspicious_semicolon_in_jsx :: NoSuspiciousSemicolonInJsxOptions >> , # [doc = "Disallow template literal placeholder syntax in regular strings."] # [serde (skip_serializing_if = "Option::is_none")] pub no_template_curly_in_string : Option < RuleConfiguration < biome_rule_options :: no_template_curly_in_string :: NoTemplateCurlyInStringOptions >> , # [doc = "Disallow then property."] # [serde (skip_serializing_if = "Option::is_none")] pub no_then_property : Option < RuleConfiguration < biome_rule_options :: no_then_property :: NoThenPropertyOptions >> , # [doc = "Prevents the use of the TypeScript directive @ts-ignore."] # [serde (skip_serializing_if = "Option::is_none")] pub no_ts_ignore : Option < RuleFixConfiguration < biome_rule_options :: no_ts_ignore :: NoTsIgnoreOptions >> , # [doc = "Disallow let or var variables that are read but never assigned."] # [serde (skip_serializing_if = "Option::is_none")] pub no_unassigned_variables : Option < RuleConfiguration < biome_rule_options :: no_unassigned_variables :: NoUnassignedVariablesOptions >> , # [doc = "Disallow unknown at-rules."] # [serde (skip_serializing_if = "Option::is_none")] pub no_unknown_at_rules : Option < RuleConfiguration < biome_rule_options :: no_unknown_at_rules :: NoUnknownAtRulesOptions >> , # [doc = "Disallow unsafe declaration merging between interfaces and classes."] # [serde (skip_serializing_if = "Option::is_none")] pub no_unsafe_declaration_merging : Option < RuleConfiguration < biome_rule_options :: no_unsafe_declaration_merging :: NoUnsafeDeclarationMergingOptions >> , # [doc = "Disallow using unsafe negation."] # [serde (skip_serializing_if = "Option::is_none")] pub no_unsafe_negation : Option < RuleFixConfiguration < biome_rule_options :: no_unsafe_negation :: NoUnsafeNegationOptions >> , # [doc = "Disallow unnecessary escapes in string literals."] # [serde (skip_serializing_if = "Option::is_none")] pub no_useless_escape_in_string : Option < RuleFixConfiguration < biome_rule_options :: no_useless_escape_in_string :: NoUselessEscapeInStringOptions >> , # [doc = "Disallow useless backreferences in regular expression literals that always match an empty string."] # [serde (skip_serializing_if = "Option::is_none")] pub no_useless_regex_backrefs : Option < RuleConfiguration < biome_rule_options :: no_useless_regex_backrefs :: NoUselessRegexBackrefsOptions >> , # [doc = "Disallow the use of var"] # [serde (skip_serializing_if = "Option::is_none")] pub no_var : Option < RuleFixConfiguration < biome_rule_options :: no_var :: NoVarOptions >> , # [doc = "Disallow with statements in non-strict contexts."] # [serde (skip_serializing_if = "Option::is_none")] pub no_with : Option < RuleConfiguration < biome_rule_options :: no_with :: NoWithOptions >> , # [doc = "Disallow the use of overload signatures that are not next to each other."] # [serde (skip_serializing_if = "Option::is_none")] pub use_adjacent_overload_signatures : Option < RuleConfiguration < biome_rule_options :: use_adjacent_overload_signatures :: UseAdjacentOverloadSignaturesOptions >> , # [doc = "Ensure async functions utilize await."] # [serde (skip_serializing_if = "Option::is_none")] pub use_await : Option < RuleConfiguration < biome_rule_options :: use_await :: UseAwaitOptions >> , # [doc = "Promotes the correct usage for ignoring folders in the configuration file."] # [serde (skip_serializing_if = "Option::is_none")] pub use_biome_ignore_folder : Option < RuleFixConfiguration < biome_rule_options :: use_biome_ignore_folder :: UseBiomeIgnoreFolderOptions >> , # [doc = "Enforce default clauses in switch statements to be last"] # [serde (skip_serializing_if = "Option::is_none")] pub use_default_switch_clause_last : Option < RuleConfiguration < biome_rule_options :: use_default_switch_clause_last :: UseDefaultSwitchClauseLastOptions >> , # [doc = "Enforce passing a message value when creating a built-in error."] # [serde (skip_serializing_if = "Option::is_none")] pub use_error_message : Option < RuleConfiguration < biome_rule_options :: use_error_message :: UseErrorMessageOptions >> , # [doc = "Enforce get methods to always return a value."] # [serde (skip_serializing_if = "Option::is_none")] pub use_getter_return : Option < RuleConfiguration < biome_rule_options :: use_getter_return :: UseGetterReturnOptions >> , # [doc = "Enforces the use of a recommended display strategy with Google Fonts."] # [serde (skip_serializing_if = "Option::is_none")] pub use_google_font_display : Option < RuleConfiguration < biome_rule_options :: use_google_font_display :: UseGoogleFontDisplayOptions >> , # [doc = "Require for-in loops to include an if statement."] # [serde (skip_serializing_if = "Option::is_none")] pub use_guard_for_in : Option < RuleConfiguration < biome_rule_options :: use_guard_for_in :: UseGuardForInOptions >> , # [doc = "Use Array.isArray() instead of instanceof Array."] # [serde (skip_serializing_if = "Option::is_none")] pub use_is_array : Option < RuleFixConfiguration < biome_rule_options :: use_is_array :: UseIsArrayOptions >> , # [doc = "Enforce consistent return values in iterable callbacks."] # [serde (skip_serializing_if = "Option::is_none")] pub use_iterable_callback_return : Option < RuleConfiguration < biome_rule_options :: use_iterable_callback_return :: UseIterableCallbackReturnOptions >> , # [doc = "Require using the namespace keyword over the module keyword to declare TypeScript namespaces."] # [serde (skip_serializing_if = "Option::is_none")] pub use_namespace_keyword : Option < RuleFixConfiguration < biome_rule_options :: use_namespace_keyword :: UseNamespaceKeywordOptions >> , # [doc = "Enforce using the digits argument with Number#toFixed()."] # [serde (skip_serializing_if = "Option::is_none")] pub use_number_to_fixed_digits_argument : Option < RuleFixConfiguration < biome_rule_options :: use_number_to_fixed_digits_argument :: UseNumberToFixedDigitsArgumentOptions >> , # [doc = "Use static Response methods instead of new Response() constructor when possible."] # [serde (skip_serializing_if = "Option::is_none")] pub use_static_response_methods : Option < RuleFixConfiguration < biome_rule_options :: use_static_response_methods :: UseStaticResponseMethodsOptions >> , # [doc = "Enforce the use of the directive \"use strict\" in script files."] # [serde (skip_serializing_if = "Option::is_none")] pub use_strict_mode : Option < RuleFixConfiguration < biome_rule_options :: use_strict_mode :: UseStrictModeOptions >> } impl Suspicious { const GROUP_NAME: &'static str = "suspicious"; pub(crate) const GROUP_RULES: &'static [&'static str] = &[ @@ -6755,6 +6763,7 @@ impl Suspicious { "noArrayIndexKey", "noAssignInExpressions", "noAsyncPromiseExecutor", + "noBiomeFirstException", "noBitwiseOperators", "noCatchAssign", "noClassAssign", @@ -6831,6 +6840,7 @@ impl Suspicious { "noWith", "useAdjacentOverloadSignatures", "useAwait", + "useBiomeIgnoreFolder", "useDefaultSwitchClauseLast", "useErrorMessage", "useGetterReturn", @@ -6848,17 +6858,17 @@ impl Suspicious { RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[2]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[3]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[4]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22]), @@ -6871,49 +6881,51 @@ impl Suspicious { RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[29]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[30]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[31]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[33]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[35]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[37]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[39]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[32]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[34]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[36]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[38]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[40]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[42]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[41]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[43]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[44]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[45]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[47]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[46]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[48]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[49]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[50]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[51]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[52]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[53]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[55]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[54]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[56]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[57]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[58]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[60]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[59]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[61]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[62]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[63]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[64]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[66]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[65]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[67]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[68]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[69]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[70]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[72]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[71]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[73]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[74]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[75]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[76]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[78]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[77]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[79]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[81]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[80]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[82]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[83]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[84]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[85]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[86]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[87]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[88]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[89]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[90]), ]; const ALL_RULES_AS_FILTERS: &'static [RuleFilter<'static>] = &[ RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0]), @@ -7008,6 +7020,8 @@ impl Suspicious { RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[89]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[90]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[91]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[92]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[93]), ]; } impl RuleGroupExt for Suspicious { @@ -7044,441 +7058,451 @@ impl RuleGroupExt for Suspicious { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[4])); } } - if let Some(rule) = self.no_bitwise_operators.as_ref() { + if let Some(rule) = self.no_biome_first_exception.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5])); } } - if let Some(rule) = self.no_catch_assign.as_ref() { + if let Some(rule) = self.no_bitwise_operators.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6])); } } - if let Some(rule) = self.no_class_assign.as_ref() { + if let Some(rule) = self.no_catch_assign.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7])); } } - if let Some(rule) = self.no_comment_text.as_ref() { + if let Some(rule) = self.no_class_assign.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8])); } } - if let Some(rule) = self.no_compare_neg_zero.as_ref() { + if let Some(rule) = self.no_comment_text.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9])); } } - if let Some(rule) = self.no_confusing_labels.as_ref() { + if let Some(rule) = self.no_compare_neg_zero.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10])); } } - if let Some(rule) = self.no_confusing_void_type.as_ref() { + if let Some(rule) = self.no_confusing_labels.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11])); } } - if let Some(rule) = self.no_console.as_ref() { + if let Some(rule) = self.no_confusing_void_type.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12])); } } - if let Some(rule) = self.no_const_enum.as_ref() { + if let Some(rule) = self.no_console.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13])); } } - if let Some(rule) = self.no_constant_binary_expressions.as_ref() { + if let Some(rule) = self.no_const_enum.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14])); } } - if let Some(rule) = self.no_control_characters_in_regex.as_ref() { + if let Some(rule) = self.no_constant_binary_expressions.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15])); } } - if let Some(rule) = self.no_debugger.as_ref() { + if let Some(rule) = self.no_control_characters_in_regex.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16])); } } - if let Some(rule) = self.no_document_cookie.as_ref() { + if let Some(rule) = self.no_debugger.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17])); } } - if let Some(rule) = self.no_document_import_in_page.as_ref() { + if let Some(rule) = self.no_document_cookie.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18])); } } - if let Some(rule) = self.no_double_equals.as_ref() { + if let Some(rule) = self.no_document_import_in_page.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19])); } } - if let Some(rule) = self.no_duplicate_at_import_rules.as_ref() { + if let Some(rule) = self.no_double_equals.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20])); } } - if let Some(rule) = self.no_duplicate_case.as_ref() { + if let Some(rule) = self.no_duplicate_at_import_rules.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21])); } } - if let Some(rule) = self.no_duplicate_class_members.as_ref() { + if let Some(rule) = self.no_duplicate_case.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22])); } } - if let Some(rule) = self.no_duplicate_custom_properties.as_ref() { + if let Some(rule) = self.no_duplicate_class_members.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23])); } } - if let Some(rule) = self.no_duplicate_else_if.as_ref() { + if let Some(rule) = self.no_duplicate_custom_properties.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24])); } } - if let Some(rule) = self.no_duplicate_fields.as_ref() { + if let Some(rule) = self.no_duplicate_else_if.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[25])); } } - if let Some(rule) = self.no_duplicate_font_names.as_ref() { + if let Some(rule) = self.no_duplicate_fields.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[26])); } } - if let Some(rule) = self.no_duplicate_jsx_props.as_ref() { + if let Some(rule) = self.no_duplicate_font_names.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[27])); } } - if let Some(rule) = self.no_duplicate_object_keys.as_ref() { + if let Some(rule) = self.no_duplicate_jsx_props.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[28])); } } - if let Some(rule) = self.no_duplicate_parameters.as_ref() { + if let Some(rule) = self.no_duplicate_object_keys.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[29])); } } - if let Some(rule) = self.no_duplicate_properties.as_ref() { + if let Some(rule) = self.no_duplicate_parameters.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[30])); } } - if let Some(rule) = self.no_duplicate_selectors_keyframe_block.as_ref() { + if let Some(rule) = self.no_duplicate_properties.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[31])); } } - if let Some(rule) = self.no_duplicate_test_hooks.as_ref() { + if let Some(rule) = self.no_duplicate_selectors_keyframe_block.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[32])); } } - if let Some(rule) = self.no_empty_block.as_ref() { + if let Some(rule) = self.no_duplicate_test_hooks.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[33])); } } - if let Some(rule) = self.no_empty_block_statements.as_ref() { + if let Some(rule) = self.no_empty_block.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[34])); } } - if let Some(rule) = self.no_empty_interface.as_ref() { + if let Some(rule) = self.no_empty_block_statements.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[35])); } } - if let Some(rule) = self.no_evolving_types.as_ref() { + if let Some(rule) = self.no_empty_interface.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[36])); } } - if let Some(rule) = self.no_explicit_any.as_ref() { + if let Some(rule) = self.no_evolving_types.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[37])); } } - if let Some(rule) = self.no_exports_in_test.as_ref() { + if let Some(rule) = self.no_explicit_any.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[38])); } } - if let Some(rule) = self.no_extra_non_null_assertion.as_ref() { + if let Some(rule) = self.no_exports_in_test.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[39])); } } - if let Some(rule) = self.no_fallthrough_switch_clause.as_ref() { + if let Some(rule) = self.no_extra_non_null_assertion.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[40])); } } - if let Some(rule) = self.no_focused_tests.as_ref() { + if let Some(rule) = self.no_fallthrough_switch_clause.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[41])); } } - if let Some(rule) = self.no_function_assign.as_ref() { + if let Some(rule) = self.no_focused_tests.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[42])); } } - if let Some(rule) = self.no_global_assign.as_ref() { + if let Some(rule) = self.no_function_assign.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[43])); } } - if let Some(rule) = self.no_global_is_finite.as_ref() { + if let Some(rule) = self.no_global_assign.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[44])); } } - if let Some(rule) = self.no_global_is_nan.as_ref() { + if let Some(rule) = self.no_global_is_finite.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[45])); } } - if let Some(rule) = self.no_head_import_in_document.as_ref() { + if let Some(rule) = self.no_global_is_nan.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[46])); } } - if let Some(rule) = self.no_implicit_any_let.as_ref() { + if let Some(rule) = self.no_head_import_in_document.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[47])); } } - if let Some(rule) = self.no_import_assign.as_ref() { + if let Some(rule) = self.no_implicit_any_let.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[48])); } } - if let Some(rule) = self.no_important_in_keyframe.as_ref() { + if let Some(rule) = self.no_import_assign.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[49])); } } - if let Some(rule) = self.no_irregular_whitespace.as_ref() { + if let Some(rule) = self.no_important_in_keyframe.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[50])); } } - if let Some(rule) = self.no_label_var.as_ref() { + if let Some(rule) = self.no_irregular_whitespace.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[51])); } } - if let Some(rule) = self.no_misleading_character_class.as_ref() { + if let Some(rule) = self.no_label_var.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[52])); } } - if let Some(rule) = self.no_misleading_instantiator.as_ref() { + if let Some(rule) = self.no_misleading_character_class.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[53])); } } - if let Some(rule) = self.no_misplaced_assertion.as_ref() { + if let Some(rule) = self.no_misleading_instantiator.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[54])); } } - if let Some(rule) = self.no_misrefactored_shorthand_assign.as_ref() { + if let Some(rule) = self.no_misplaced_assertion.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[55])); } } - if let Some(rule) = self.no_octal_escape.as_ref() { + if let Some(rule) = self.no_misrefactored_shorthand_assign.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[56])); } } - if let Some(rule) = self.no_prototype_builtins.as_ref() { + if let Some(rule) = self.no_octal_escape.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[57])); } } - if let Some(rule) = self.no_quickfix_biome.as_ref() { + if let Some(rule) = self.no_prototype_builtins.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[58])); } } - if let Some(rule) = self.no_react_specific_props.as_ref() { + if let Some(rule) = self.no_quickfix_biome.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[59])); } } - if let Some(rule) = self.no_redeclare.as_ref() { + if let Some(rule) = self.no_react_specific_props.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[60])); } } - if let Some(rule) = self.no_redundant_use_strict.as_ref() { + if let Some(rule) = self.no_redeclare.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[61])); } } - if let Some(rule) = self.no_self_compare.as_ref() { + if let Some(rule) = self.no_redundant_use_strict.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[62])); } } - if let Some(rule) = self.no_shadow_restricted_names.as_ref() { + if let Some(rule) = self.no_self_compare.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[63])); } } - if let Some(rule) = self.no_shorthand_property_overrides.as_ref() { + if let Some(rule) = self.no_shadow_restricted_names.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[64])); } } - if let Some(rule) = self.no_skipped_tests.as_ref() { + if let Some(rule) = self.no_shorthand_property_overrides.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[65])); } } - if let Some(rule) = self.no_sparse_array.as_ref() { + if let Some(rule) = self.no_skipped_tests.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[66])); } } - if let Some(rule) = self.no_suspicious_semicolon_in_jsx.as_ref() { + if let Some(rule) = self.no_sparse_array.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[67])); } } - if let Some(rule) = self.no_template_curly_in_string.as_ref() { + if let Some(rule) = self.no_suspicious_semicolon_in_jsx.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[68])); } } - if let Some(rule) = self.no_then_property.as_ref() { + if let Some(rule) = self.no_template_curly_in_string.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[69])); } } - if let Some(rule) = self.no_ts_ignore.as_ref() { + if let Some(rule) = self.no_then_property.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[70])); } } - if let Some(rule) = self.no_unassigned_variables.as_ref() { + if let Some(rule) = self.no_ts_ignore.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[71])); } } - if let Some(rule) = self.no_unknown_at_rules.as_ref() { + if let Some(rule) = self.no_unassigned_variables.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[72])); } } - if let Some(rule) = self.no_unsafe_declaration_merging.as_ref() { + if let Some(rule) = self.no_unknown_at_rules.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[73])); } } - if let Some(rule) = self.no_unsafe_negation.as_ref() { + if let Some(rule) = self.no_unsafe_declaration_merging.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[74])); } } - if let Some(rule) = self.no_useless_escape_in_string.as_ref() { + if let Some(rule) = self.no_unsafe_negation.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[75])); } } - if let Some(rule) = self.no_useless_regex_backrefs.as_ref() { + if let Some(rule) = self.no_useless_escape_in_string.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[76])); } } - if let Some(rule) = self.no_var.as_ref() { + if let Some(rule) = self.no_useless_regex_backrefs.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[77])); } } - if let Some(rule) = self.no_with.as_ref() { + if let Some(rule) = self.no_var.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[78])); } } - if let Some(rule) = self.use_adjacent_overload_signatures.as_ref() { + if let Some(rule) = self.no_with.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[79])); } } - if let Some(rule) = self.use_await.as_ref() { + if let Some(rule) = self.use_adjacent_overload_signatures.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[80])); } } - if let Some(rule) = self.use_default_switch_clause_last.as_ref() { + if let Some(rule) = self.use_await.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[81])); } } - if let Some(rule) = self.use_error_message.as_ref() { + if let Some(rule) = self.use_biome_ignore_folder.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[82])); } } - if let Some(rule) = self.use_getter_return.as_ref() { + if let Some(rule) = self.use_default_switch_clause_last.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[83])); } } - if let Some(rule) = self.use_google_font_display.as_ref() { + if let Some(rule) = self.use_error_message.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[84])); } } - if let Some(rule) = self.use_guard_for_in.as_ref() { + if let Some(rule) = self.use_getter_return.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[85])); } } - if let Some(rule) = self.use_is_array.as_ref() { + if let Some(rule) = self.use_google_font_display.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[86])); } } - if let Some(rule) = self.use_iterable_callback_return.as_ref() { + if let Some(rule) = self.use_guard_for_in.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[87])); } } - if let Some(rule) = self.use_namespace_keyword.as_ref() { + if let Some(rule) = self.use_is_array.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[88])); } } - if let Some(rule) = self.use_number_to_fixed_digits_argument.as_ref() { + if let Some(rule) = self.use_iterable_callback_return.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[89])); } } - if let Some(rule) = self.use_static_response_methods.as_ref() { + if let Some(rule) = self.use_namespace_keyword.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[90])); } } - if let Some(rule) = self.use_strict_mode.as_ref() { + if let Some(rule) = self.use_number_to_fixed_digits_argument.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[91])); } } + if let Some(rule) = self.use_static_response_methods.as_ref() { + if rule.is_enabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[92])); + } + } + if let Some(rule) = self.use_strict_mode.as_ref() { + if rule.is_enabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[93])); + } + } index_set } fn get_disabled_rules(&self) -> FxHashSet> { @@ -7508,441 +7532,451 @@ impl RuleGroupExt for Suspicious { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[4])); } } - if let Some(rule) = self.no_bitwise_operators.as_ref() { + if let Some(rule) = self.no_biome_first_exception.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5])); } } - if let Some(rule) = self.no_catch_assign.as_ref() { + if let Some(rule) = self.no_bitwise_operators.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6])); } } - if let Some(rule) = self.no_class_assign.as_ref() { + if let Some(rule) = self.no_catch_assign.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7])); } } - if let Some(rule) = self.no_comment_text.as_ref() { + if let Some(rule) = self.no_class_assign.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8])); } } - if let Some(rule) = self.no_compare_neg_zero.as_ref() { + if let Some(rule) = self.no_comment_text.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9])); } } - if let Some(rule) = self.no_confusing_labels.as_ref() { + if let Some(rule) = self.no_compare_neg_zero.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10])); } } - if let Some(rule) = self.no_confusing_void_type.as_ref() { + if let Some(rule) = self.no_confusing_labels.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11])); } } - if let Some(rule) = self.no_console.as_ref() { + if let Some(rule) = self.no_confusing_void_type.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12])); } } - if let Some(rule) = self.no_const_enum.as_ref() { + if let Some(rule) = self.no_console.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13])); } } - if let Some(rule) = self.no_constant_binary_expressions.as_ref() { + if let Some(rule) = self.no_const_enum.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14])); } } - if let Some(rule) = self.no_control_characters_in_regex.as_ref() { + if let Some(rule) = self.no_constant_binary_expressions.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15])); } } - if let Some(rule) = self.no_debugger.as_ref() { + if let Some(rule) = self.no_control_characters_in_regex.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16])); } } - if let Some(rule) = self.no_document_cookie.as_ref() { + if let Some(rule) = self.no_debugger.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17])); } } - if let Some(rule) = self.no_document_import_in_page.as_ref() { + if let Some(rule) = self.no_document_cookie.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18])); } } - if let Some(rule) = self.no_double_equals.as_ref() { + if let Some(rule) = self.no_document_import_in_page.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19])); } } - if let Some(rule) = self.no_duplicate_at_import_rules.as_ref() { + if let Some(rule) = self.no_double_equals.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20])); } } - if let Some(rule) = self.no_duplicate_case.as_ref() { + if let Some(rule) = self.no_duplicate_at_import_rules.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21])); } } - if let Some(rule) = self.no_duplicate_class_members.as_ref() { + if let Some(rule) = self.no_duplicate_case.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22])); } } - if let Some(rule) = self.no_duplicate_custom_properties.as_ref() { + if let Some(rule) = self.no_duplicate_class_members.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23])); } } - if let Some(rule) = self.no_duplicate_else_if.as_ref() { + if let Some(rule) = self.no_duplicate_custom_properties.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24])); } } - if let Some(rule) = self.no_duplicate_fields.as_ref() { + if let Some(rule) = self.no_duplicate_else_if.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[25])); } } - if let Some(rule) = self.no_duplicate_font_names.as_ref() { + if let Some(rule) = self.no_duplicate_fields.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[26])); } } - if let Some(rule) = self.no_duplicate_jsx_props.as_ref() { + if let Some(rule) = self.no_duplicate_font_names.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[27])); } } - if let Some(rule) = self.no_duplicate_object_keys.as_ref() { + if let Some(rule) = self.no_duplicate_jsx_props.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[28])); } } - if let Some(rule) = self.no_duplicate_parameters.as_ref() { + if let Some(rule) = self.no_duplicate_object_keys.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[29])); } } - if let Some(rule) = self.no_duplicate_properties.as_ref() { + if let Some(rule) = self.no_duplicate_parameters.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[30])); } } - if let Some(rule) = self.no_duplicate_selectors_keyframe_block.as_ref() { + if let Some(rule) = self.no_duplicate_properties.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[31])); } } - if let Some(rule) = self.no_duplicate_test_hooks.as_ref() { + if let Some(rule) = self.no_duplicate_selectors_keyframe_block.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[32])); } } - if let Some(rule) = self.no_empty_block.as_ref() { + if let Some(rule) = self.no_duplicate_test_hooks.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[33])); } } - if let Some(rule) = self.no_empty_block_statements.as_ref() { + if let Some(rule) = self.no_empty_block.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[34])); } } - if let Some(rule) = self.no_empty_interface.as_ref() { + if let Some(rule) = self.no_empty_block_statements.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[35])); } } - if let Some(rule) = self.no_evolving_types.as_ref() { + if let Some(rule) = self.no_empty_interface.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[36])); } } - if let Some(rule) = self.no_explicit_any.as_ref() { + if let Some(rule) = self.no_evolving_types.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[37])); } } - if let Some(rule) = self.no_exports_in_test.as_ref() { + if let Some(rule) = self.no_explicit_any.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[38])); } } - if let Some(rule) = self.no_extra_non_null_assertion.as_ref() { + if let Some(rule) = self.no_exports_in_test.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[39])); } } - if let Some(rule) = self.no_fallthrough_switch_clause.as_ref() { + if let Some(rule) = self.no_extra_non_null_assertion.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[40])); } } - if let Some(rule) = self.no_focused_tests.as_ref() { + if let Some(rule) = self.no_fallthrough_switch_clause.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[41])); } } - if let Some(rule) = self.no_function_assign.as_ref() { + if let Some(rule) = self.no_focused_tests.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[42])); } } - if let Some(rule) = self.no_global_assign.as_ref() { + if let Some(rule) = self.no_function_assign.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[43])); } } - if let Some(rule) = self.no_global_is_finite.as_ref() { + if let Some(rule) = self.no_global_assign.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[44])); } } - if let Some(rule) = self.no_global_is_nan.as_ref() { + if let Some(rule) = self.no_global_is_finite.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[45])); } } - if let Some(rule) = self.no_head_import_in_document.as_ref() { + if let Some(rule) = self.no_global_is_nan.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[46])); } } - if let Some(rule) = self.no_implicit_any_let.as_ref() { + if let Some(rule) = self.no_head_import_in_document.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[47])); } } - if let Some(rule) = self.no_import_assign.as_ref() { + if let Some(rule) = self.no_implicit_any_let.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[48])); } } - if let Some(rule) = self.no_important_in_keyframe.as_ref() { + if let Some(rule) = self.no_import_assign.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[49])); } } - if let Some(rule) = self.no_irregular_whitespace.as_ref() { + if let Some(rule) = self.no_important_in_keyframe.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[50])); } } - if let Some(rule) = self.no_label_var.as_ref() { + if let Some(rule) = self.no_irregular_whitespace.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[51])); } } - if let Some(rule) = self.no_misleading_character_class.as_ref() { + if let Some(rule) = self.no_label_var.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[52])); } } - if let Some(rule) = self.no_misleading_instantiator.as_ref() { + if let Some(rule) = self.no_misleading_character_class.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[53])); } } - if let Some(rule) = self.no_misplaced_assertion.as_ref() { + if let Some(rule) = self.no_misleading_instantiator.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[54])); } } - if let Some(rule) = self.no_misrefactored_shorthand_assign.as_ref() { + if let Some(rule) = self.no_misplaced_assertion.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[55])); } } - if let Some(rule) = self.no_octal_escape.as_ref() { + if let Some(rule) = self.no_misrefactored_shorthand_assign.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[56])); } } - if let Some(rule) = self.no_prototype_builtins.as_ref() { + if let Some(rule) = self.no_octal_escape.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[57])); } } - if let Some(rule) = self.no_quickfix_biome.as_ref() { + if let Some(rule) = self.no_prototype_builtins.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[58])); } } - if let Some(rule) = self.no_react_specific_props.as_ref() { + if let Some(rule) = self.no_quickfix_biome.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[59])); } } - if let Some(rule) = self.no_redeclare.as_ref() { + if let Some(rule) = self.no_react_specific_props.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[60])); } } - if let Some(rule) = self.no_redundant_use_strict.as_ref() { + if let Some(rule) = self.no_redeclare.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[61])); } } - if let Some(rule) = self.no_self_compare.as_ref() { + if let Some(rule) = self.no_redundant_use_strict.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[62])); } } - if let Some(rule) = self.no_shadow_restricted_names.as_ref() { + if let Some(rule) = self.no_self_compare.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[63])); } } - if let Some(rule) = self.no_shorthand_property_overrides.as_ref() { + if let Some(rule) = self.no_shadow_restricted_names.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[64])); } } - if let Some(rule) = self.no_skipped_tests.as_ref() { + if let Some(rule) = self.no_shorthand_property_overrides.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[65])); } } - if let Some(rule) = self.no_sparse_array.as_ref() { + if let Some(rule) = self.no_skipped_tests.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[66])); } } - if let Some(rule) = self.no_suspicious_semicolon_in_jsx.as_ref() { + if let Some(rule) = self.no_sparse_array.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[67])); } } - if let Some(rule) = self.no_template_curly_in_string.as_ref() { + if let Some(rule) = self.no_suspicious_semicolon_in_jsx.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[68])); } } - if let Some(rule) = self.no_then_property.as_ref() { + if let Some(rule) = self.no_template_curly_in_string.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[69])); } } - if let Some(rule) = self.no_ts_ignore.as_ref() { + if let Some(rule) = self.no_then_property.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[70])); } } - if let Some(rule) = self.no_unassigned_variables.as_ref() { + if let Some(rule) = self.no_ts_ignore.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[71])); } } - if let Some(rule) = self.no_unknown_at_rules.as_ref() { + if let Some(rule) = self.no_unassigned_variables.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[72])); } } - if let Some(rule) = self.no_unsafe_declaration_merging.as_ref() { + if let Some(rule) = self.no_unknown_at_rules.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[73])); } } - if let Some(rule) = self.no_unsafe_negation.as_ref() { + if let Some(rule) = self.no_unsafe_declaration_merging.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[74])); } } - if let Some(rule) = self.no_useless_escape_in_string.as_ref() { + if let Some(rule) = self.no_unsafe_negation.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[75])); } } - if let Some(rule) = self.no_useless_regex_backrefs.as_ref() { + if let Some(rule) = self.no_useless_escape_in_string.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[76])); } } - if let Some(rule) = self.no_var.as_ref() { + if let Some(rule) = self.no_useless_regex_backrefs.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[77])); } } - if let Some(rule) = self.no_with.as_ref() { + if let Some(rule) = self.no_var.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[78])); } } - if let Some(rule) = self.use_adjacent_overload_signatures.as_ref() { + if let Some(rule) = self.no_with.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[79])); } } - if let Some(rule) = self.use_await.as_ref() { + if let Some(rule) = self.use_adjacent_overload_signatures.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[80])); } } - if let Some(rule) = self.use_default_switch_clause_last.as_ref() { + if let Some(rule) = self.use_await.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[81])); } } - if let Some(rule) = self.use_error_message.as_ref() { + if let Some(rule) = self.use_biome_ignore_folder.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[82])); } } - if let Some(rule) = self.use_getter_return.as_ref() { + if let Some(rule) = self.use_default_switch_clause_last.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[83])); } } - if let Some(rule) = self.use_google_font_display.as_ref() { + if let Some(rule) = self.use_error_message.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[84])); } } - if let Some(rule) = self.use_guard_for_in.as_ref() { + if let Some(rule) = self.use_getter_return.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[85])); } } - if let Some(rule) = self.use_is_array.as_ref() { + if let Some(rule) = self.use_google_font_display.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[86])); } } - if let Some(rule) = self.use_iterable_callback_return.as_ref() { + if let Some(rule) = self.use_guard_for_in.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[87])); } } - if let Some(rule) = self.use_namespace_keyword.as_ref() { + if let Some(rule) = self.use_is_array.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[88])); } } - if let Some(rule) = self.use_number_to_fixed_digits_argument.as_ref() { + if let Some(rule) = self.use_iterable_callback_return.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[89])); } } - if let Some(rule) = self.use_static_response_methods.as_ref() { + if let Some(rule) = self.use_namespace_keyword.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[90])); } } - if let Some(rule) = self.use_strict_mode.as_ref() { + if let Some(rule) = self.use_number_to_fixed_digits_argument.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[91])); } } + if let Some(rule) = self.use_static_response_methods.as_ref() { + if rule.is_disabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[92])); + } + } + if let Some(rule) = self.use_strict_mode.as_ref() { + if rule.is_disabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[93])); + } + } index_set } #[doc = r" Checks if, given a rule name, matches one of the rules contained in this category"] @@ -7993,6 +8027,10 @@ impl RuleGroupExt for Suspicious { .no_async_promise_executor .as_ref() .map(|conf| (conf.level(), conf.get_options())), + "noBiomeFirstException" => self + .no_biome_first_exception + .as_ref() + .map(|conf| (conf.level(), conf.get_options())), "noBitwiseOperators" => self .no_bitwise_operators .as_ref() @@ -8297,6 +8335,10 @@ impl RuleGroupExt for Suspicious { .use_await .as_ref() .map(|conf| (conf.level(), conf.get_options())), + "useBiomeIgnoreFolder" => self + .use_biome_ignore_folder + .as_ref() + .map(|conf| (conf.level(), conf.get_options())), "useDefaultSwitchClauseLast" => self .use_default_switch_clause_last .as_ref() @@ -8354,6 +8396,7 @@ impl From for Suspicious { no_array_index_key: Some(value.into()), no_assign_in_expressions: Some(value.into()), no_async_promise_executor: Some(value.into()), + no_biome_first_exception: Some(value.into()), no_bitwise_operators: Some(value.into()), no_catch_assign: Some(value.into()), no_class_assign: Some(value.into()), @@ -8430,6 +8473,7 @@ impl From for Suspicious { no_with: Some(value.into()), use_adjacent_overload_signatures: Some(value.into()), use_await: Some(value.into()), + use_biome_ignore_folder: Some(value.into()), use_default_switch_clause_last: Some(value.into()), use_error_message: Some(value.into()), use_getter_return: Some(value.into()), diff --git a/crates/biome_diagnostics_categories/src/categories.rs b/crates/biome_diagnostics_categories/src/categories.rs index f0ee1f8986..f8745843c7 100644 --- a/crates/biome_diagnostics_categories/src/categories.rs +++ b/crates/biome_diagnostics_categories/src/categories.rs @@ -161,7 +161,6 @@ define_categories! { "lint/correctness/useValidForDirection": "https://biomejs.dev/linter/rules/use-valid-for-direction", "lint/correctness/useValidTypeof": "https://biomejs.dev/linter/rules/use-valid-typeof", "lint/correctness/useYield": "https://biomejs.dev/linter/rules/use-yield", - "lint/nursery/colorNoInvalidHex": "https://biomejs.dev/linter/rules/color-no-invalid-hex", "lint/nursery/noNextAsyncClientComponent": "https://biomejs.dev/linter/rules/no-next-async-client-component", "lint/nursery/noColorInvalidHex": "https://biomejs.dev/linter/rules/no-color-invalid-hex", "lint/nursery/noFloatingPromises": "https://biomejs.dev/linter/rules/no-floating-promises", @@ -178,9 +177,9 @@ define_categories! { "lint/nursery/noUnwantedPolyfillio": "https://biomejs.dev/linter/rules/no-unwanted-polyfillio", "lint/nursery/noUselessBackrefInRegex": "https://biomejs.dev/linter/rules/no-useless-backref-in-regex", "lint/nursery/noUselessUndefined": "https://biomejs.dev/linter/rules/no-useless-undefined", + "lint/nursery/noVueDataObjectDeclaration": "https://biomejs.dev/linter/rules/no-vue-data-object-declaration", "lint/nursery/noVueReservedKeys": "https://biomejs.dev/linter/rules/no-vue-reserved-keys", "lint/nursery/noVueReservedProps": "https://biomejs.dev/linter/rules/no-vue-reserved-props", - "lint/nursery/noVueDataObjectDeclaration": "https://biomejs.dev/linter/rules/no-vue-data-object-declaration", "lint/nursery/useAnchorHref": "https://biomejs.dev/linter/rules/use-anchor-href", "lint/nursery/useBiomeSuppressionComment": "https://biomejs.dev/linter/rules/use-biome-suppression-comment", "lint/nursery/useConsistentObjectDefinition": "https://biomejs.dev/linter/rules/use-consistent-object-definition", @@ -289,6 +288,7 @@ define_categories! { "lint/suspicious/noArrayIndexKey": "https://biomejs.dev/linter/rules/no-array-index-key", "lint/suspicious/noAssignInExpressions": "https://biomejs.dev/linter/rules/no-assign-in-expressions", "lint/suspicious/noAsyncPromiseExecutor": "https://biomejs.dev/linter/rules/no-async-promise-executor", + "lint/suspicious/noBiomeFirstException": "https://biomejs.dev/linter/rules/no-biome-first-exception", "lint/suspicious/noBitwiseOperators": "https://biomejs.dev/linter/rules/no-bitwise-operators", "lint/suspicious/noCatchAssign": "https://biomejs.dev/linter/rules/no-catch-assign", "lint/suspicious/noClassAssign": "https://biomejs.dev/linter/rules/no-class-assign", @@ -365,6 +365,7 @@ define_categories! { "lint/suspicious/noWith": "https://biomejs.dev/linter/rules/no-with", "lint/suspicious/useAdjacentOverloadSignatures": "https://biomejs.dev/linter/rules/use-adjacent-overload-signatures", "lint/suspicious/useAwait": "https://biomejs.dev/linter/rules/use-await", + "lint/suspicious/useBiomeIgnoreFolder": "https://biomejs.dev/linter/rules/use-biome-ignore-folder", "lint/suspicious/useIterableCallbackReturn": "https://biomejs.dev/linter/rules/use-iterable-callback-return", "lint/suspicious/useDefaultSwitchClauseLast": "https://biomejs.dev/linter/rules/use-default-switch-clause-last", "lint/suspicious/useErrorMessage": "https://biomejs.dev/linter/rules/use-error-message", diff --git a/crates/biome_json_analyze/src/lint/suspicious.rs b/crates/biome_json_analyze/src/lint/suspicious.rs index 054c5031ae..c711cbdd32 100644 --- a/crates/biome_json_analyze/src/lint/suspicious.rs +++ b/crates/biome_json_analyze/src/lint/suspicious.rs @@ -3,6 +3,8 @@ //! Generated file, do not edit by hand, see `xtask/codegen` use biome_analyze::declare_lint_group; +pub mod no_biome_first_exception; pub mod no_duplicate_object_keys; pub mod no_quickfix_biome; -declare_lint_group! { pub Suspicious { name : "suspicious" , rules : [self :: no_duplicate_object_keys :: NoDuplicateObjectKeys , self :: no_quickfix_biome :: NoQuickfixBiome ,] } } +pub mod use_biome_ignore_folder; +declare_lint_group! { pub Suspicious { name : "suspicious" , rules : [self :: no_biome_first_exception :: NoBiomeFirstException , self :: no_duplicate_object_keys :: NoDuplicateObjectKeys , self :: no_quickfix_biome :: NoQuickfixBiome , self :: use_biome_ignore_folder :: UseBiomeIgnoreFolder ,] } } diff --git a/crates/biome_json_analyze/src/lint/suspicious/no_biome_first_exception.rs b/crates/biome_json_analyze/src/lint/suspicious/no_biome_first_exception.rs new file mode 100644 index 0000000000..723d2964b2 --- /dev/null +++ b/crates/biome_json_analyze/src/lint/suspicious/no_biome_first_exception.rs @@ -0,0 +1,145 @@ +use crate::JsonRuleAction; +use crate::utils::matches_parent_object; +use biome_analyze::{Ast, FixKind, Rule, RuleDiagnostic, context::RuleContext, declare_lint_rule}; +use biome_console::markup; +use biome_diagnostics::Severity; +use biome_json_factory::make::{ + json_array_element_list, json_string_literal, json_string_value, token, +}; +use biome_json_syntax::{AnyJsonValue, JsonMember, JsonStringValue, T}; +use biome_rowan::{AstNode, AstSeparatedList, BatchMutationExt}; +use biome_rule_options::no_biome_first_exception::NoBiomeFirstExceptionOptions; + +declare_lint_rule! { + /// Prevents the use of the `!` pattern in the first position of `files.includes` in the configuration file. + /// + /// If the first pattern of `files.includes` starts with the leading `!`, Biome won't have any file to crawl. Generally, + /// it is a good practice to declare the files/folders to include first, and then the files/folder to ignore. + /// + /// Check the [official documentation](https://biomejs.dev/guides/configure-biome/#exclude-files-via-configuration) for more examples. + /// + /// ## Examples + /// + /// ### Invalid + /// + /// ```json,ignore + /// { + /// "files": { + /// "includes": ["!dist"] + /// } + /// } + /// ``` + /// + /// ### Valid + /// + /// ```json,ignore + /// { + /// "files": { + /// "includes": ["src/**", "!dist"] + /// } + /// } + /// ``` + /// + pub NoBiomeFirstException { + version: "next", + name: "noBiomeFirstException", + language: "json", + recommended: true, + severity: Severity::Error, + fix_kind: FixKind::Safe, + } +} + +impl Rule for NoBiomeFirstException { + type Query = Ast; + type State = JsonStringValue; + type Signals = Option; + type Options = NoBiomeFirstExceptionOptions; + + fn run(ctx: &RuleContext) -> Option { + let node = ctx.query(); + let file_path = ctx.file_path(); + // we use ends_with so it works only during testing + if !file_path + .file_name() + .is_some_and(|file_name| file_name.ends_with("biome.json")) + && !file_path + .file_name() + .is_some_and(|file_name| file_name.ends_with("biome.jsonc")) + { + return None; + } + + let name = node.name().ok()?; + + if name.inner_string_text().ok()?.text() != "includes" { + return None; + } + + if !matches_parent_object(node, "files") { + return None; + } + + let value = node.value().ok()?; + let value = value.as_json_array_value()?; + if let Some(element) = value.elements().first() { + let element = element.ok()?; + let string_value = element.as_json_string_value()?; + + if string_value + .inner_string_text() + .ok()? + .text() + .starts_with('!') + { + return Some(string_value.clone()); + } + } + + None + } + + fn diagnostic(_ctx: &RuleContext, state: &Self::State) -> Option { + Some( + RuleDiagnostic::new( + rule_category!(), + state.range(), + markup! { + "Incorrect usage of the exception detected." + }, + ) + .note(markup! { + "Having a pattern that starts with `!` as first item will cause Biome to match no files." + }), + ) + } + + fn action(ctx: &RuleContext, _state: &Self::State) -> Option { + let mut mutation = ctx.root().begin(); + let old_list = ctx.query().value().ok()?.as_json_array_value()?.elements(); + let list = old_list.iter().flatten().collect::>(); + let mut new_list = vec![AnyJsonValue::JsonStringValue(json_string_value( + json_string_literal("**"), + ))]; + + new_list.extend(list); + let mut separators = vec![]; + + for _ in 0..new_list.len() - 1 { + separators.push(token(T![,])) + } + + let new_list = json_array_element_list(new_list, separators); + + mutation.replace_node(old_list, new_list); + + Some(JsonRuleAction::new( + ctx.metadata().action_category(ctx.category(), ctx.group()), + ctx.metadata().applicability(), + markup! { + "Add the patter ""**"" at the beginning of the list." + }, + mutation, + )) + } +} diff --git a/crates/biome_json_analyze/src/lint/suspicious/use_biome_ignore_folder.rs b/crates/biome_json_analyze/src/lint/suspicious/use_biome_ignore_folder.rs new file mode 100644 index 0000000000..5df7729f43 --- /dev/null +++ b/crates/biome_json_analyze/src/lint/suspicious/use_biome_ignore_folder.rs @@ -0,0 +1,137 @@ +use crate::JsonRuleAction; +use crate::utils::matches_parent_object; +use biome_analyze::{Ast, FixKind, Rule, RuleDiagnostic, context::RuleContext, declare_lint_rule}; +use biome_console::markup; +use biome_diagnostics::Severity; +use biome_json_factory::make::{json_string_literal, json_string_value}; +use biome_json_syntax::{JsonMember, JsonStringValue}; +use biome_rowan::{AstNode, AstSeparatedList, BatchMutationExt}; +use biome_rule_options::use_biome_ignore_folder::UseBiomeIgnoreFolderOptions; + +declare_lint_rule! { + /// Promotes the correct usage for ignoring folders in the configuration file. + /// + /// Starting Biome v2.2, ignoring folders doesn't require the use of the trailing `/**`. + /// When using the pattern `/**`, you tell Biome to ignore **all files** inside a folder, but the folder is still crawled. This pattern + /// can lead to poor performance, especially if the folder contains many files. + /// + /// If the intention is to ignore specific files inside a folder, the trailing pattern `/**` shouldn't be used. + /// + /// ## Examples + /// + /// ### Invalid + /// + /// ```json,ignore + /// { + /// "files": { + /// "includes": ["**", "!dist/**", "!**/dist/**"] + /// } + /// } + /// ``` + /// + /// ### Valid + /// + /// ```json,ignore + /// { + /// "files": { + /// "includes": ["**", "!dist", "!**/dist"] + /// } + /// } + /// ``` + /// + pub UseBiomeIgnoreFolder { + version: "next", + name: "useBiomeIgnoreFolder", + language: "json", + recommended: true, + fix_kind: FixKind::Safe, + severity: Severity::Warning, + } +} + +impl Rule for UseBiomeIgnoreFolder { + type Query = Ast; + type State = JsonStringValue; + type Signals = Vec; + type Options = UseBiomeIgnoreFolderOptions; + + fn run(ctx: &RuleContext) -> Vec { + let node = ctx.query(); + let name = node.name().ok(); + let mut values = vec![]; + let file_path = ctx.file_path(); + // we use ends_with so it works only during testing + if !file_path + .file_name() + .is_some_and(|file_name| file_name.ends_with("biome.json")) + && !file_path + .file_name() + .is_some_and(|file_name| file_name.ends_with("biome.jsonc")) + { + return values; + } + + if name.is_some_and(|name| { + name.inner_string_text() + .ok() + .is_some_and(|text| text.text() != "includes") + }) { + return values; + } + + if !matches_parent_object(node, "files") { + return values; + } + + if let Ok(value) = node.value() + && let Some(value) = value.as_json_array_value() + { + for array_value in value.elements().iter().flatten() { + if let Some(string_value) = array_value.as_json_string_value() + && let Ok(inner_value) = string_value.inner_string_text() + && inner_value.text().starts_with('!') + && inner_value.text().ends_with("/**") + { + values.push(string_value.clone()) + } + } + } + + values + } + + fn diagnostic(_ctx: &RuleContext, state: &Self::State) -> Option { + Some( + RuleDiagnostic::new( + rule_category!(), + state.range(), + markup! { + "Incorrect usage of ignore a folder found." + }, + ) + .note(markup! { + "Since version 2.2.0, ignoring folders doesn't require the use the trailing ""/**"". This is a bug that affects version prior v2.2.0." + }), + ) + } + + fn action(ctx: &RuleContext, state: &Self::State) -> Option { + let mut mutation = ctx.root().begin(); + let former_pattern = state.inner_string_text().ok()?.text().to_string(); + let new_pattern = former_pattern + .strip_suffix("/**") + .unwrap_or(&former_pattern); + let new_value = json_string_value(json_string_literal(new_pattern)); + + mutation.replace_node(state.clone(), new_value); + + Some(JsonRuleAction::new( + ctx.metadata().action_category(ctx.category(), ctx.group()), + ctx.metadata().applicability(), + markup! { + "If you want to ignore a folder, use the following pattern instead: "{new_pattern}"." + }, + mutation, + )) + } +} diff --git a/crates/biome_json_analyze/src/utils.rs b/crates/biome_json_analyze/src/utils.rs index a41a4f9600..0cf244ac81 100644 --- a/crates/biome_json_analyze/src/utils.rs +++ b/crates/biome_json_analyze/src/utils.rs @@ -46,3 +46,14 @@ pub fn matches_path(optional_node: Option<&JsonMemberName>, path: &[&str]) -> bo matches_path(optional_parent_node.as_ref(), &path[..path.len() - 1]) } + +/// Finds the first ancestor [JsonMember], and returns [true] if it's name matches the given input +pub(crate) fn matches_parent_object(node: &JsonMember, name: &str) -> bool { + node.syntax() + .ancestors() + .skip(1) + .find_map(JsonMember::cast) + .and_then(|member| member.name().ok()) + .and_then(|member| member.inner_string_text().ok()) + .is_some_and(|text| text.text() == name) +} diff --git a/crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/invalid.biome.jsonc b/crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/invalid.biome.jsonc new file mode 100644 index 0000000000..bc16f24206 --- /dev/null +++ b/crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/invalid.biome.jsonc @@ -0,0 +1,8 @@ +// should generate diagnostics +{ + "files": { + "includes": [ + "!dist/**" + ] + } +} diff --git a/crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/invalid.biome.jsonc.snap b/crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/invalid.biome.jsonc.snap new file mode 100644 index 0000000000..236a58b660 --- /dev/null +++ b/crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/invalid.biome.jsonc.snap @@ -0,0 +1,44 @@ +--- +source: crates/biome_json_analyze/tests/spec_tests.rs +expression: invalid.biome.jsonc +--- +# Input +```jsonc +// should generate diagnostics +{ + "files": { + "includes": [ + "!dist/**" + ] + } +} + +``` + +# Diagnostics +``` +invalid.biome.jsonc:5:4 lint/suspicious/noBiomeFirstException FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Incorrect usage of the exception detected. + + 3 │ "files": { + 4 │ "includes": [ + > 5 │ "!dist/**" + │ ^^^^^^^^^^ + 6 │ ] + 7 │ } + + i Having a pattern that starts with `!` as first item will cause Biome to match no files. + + i Safe fix: Add the patter ** at the beginning of the list. + + 3 3 │ "files": { + 4 4 │ "includes": [ + 5 │ - → → → "!dist/**" + 5 │ + → → → "**", + 6 │ + → → → "!dist/**" + 6 7 │ ] + 7 8 │ } + + +``` diff --git a/crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/valid.biome.jsonc b/crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/valid.biome.jsonc new file mode 100644 index 0000000000..dd5f6f42b1 --- /dev/null +++ b/crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/valid.biome.jsonc @@ -0,0 +1,9 @@ +// should not generate diagnostics +{ + "files": { + "includes": [ + "**", + "!**/dist" + ] + } +} diff --git a/crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/valid.biome.jsonc.snap b/crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/valid.biome.jsonc.snap new file mode 100644 index 0000000000..dc621bc265 --- /dev/null +++ b/crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/valid.biome.jsonc.snap @@ -0,0 +1,17 @@ +--- +source: crates/biome_json_analyze/tests/spec_tests.rs +expression: valid.biome.jsonc +--- +# Input +```jsonc +// should not generate diagnostics +{ + "files": { + "includes": [ + "**", + "!**/dist" + ] + } +} + +``` diff --git a/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc b/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc new file mode 100644 index 0000000000..37acbf33b3 --- /dev/null +++ b/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc @@ -0,0 +1,10 @@ +// should generate diagnostics +{ + "files": { + "includes": [ + "**", + "!dist/**", + "!**/dist/**" + ] + } +} diff --git a/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc.snap b/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc.snap new file mode 100644 index 0000000000..903c92c9b8 --- /dev/null +++ b/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc.snap @@ -0,0 +1,61 @@ +--- +source: crates/biome_json_analyze/tests/spec_tests.rs +expression: invalid.biome.jsonc +--- +# Input +```jsonc +// should generate diagnostics +{ + "files": { + "includes": [ + "**", + "!dist/**", + "!**/dist/**" + ] + } +} + +``` + +# Diagnostics +``` +invalid.biome.jsonc:6:7 lint/suspicious/useBiomeIgnoreFolder FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + ! Incorrect usage of ignore a folder found. + + 4 │ "includes": [ + 5 │ "**", + > 6 │ "!dist/**", + │ ^^^^^^^^^^ + 7 │ "!**/dist/**" + 8 │ ] + + i Since version 2.2.0, ignoring folders doesn't require the use the trailing /**. This is a bug that affects version prior v2.2.0. + + i Safe fix: If you want to ignore a folder, use the following pattern instead: !dist. + + 6 │ ······"!dist/**", + │ --- + +``` + +``` +invalid.biome.jsonc:7:7 lint/suspicious/useBiomeIgnoreFolder FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + ! Incorrect usage of ignore a folder found. + + 5 │ "**", + 6 │ "!dist/**", + > 7 │ "!**/dist/**" + │ ^^^^^^^^^^^^^ + 8 │ ] + 9 │ } + + i Since version 2.2.0, ignoring folders doesn't require the use the trailing /**. This is a bug that affects version prior v2.2.0. + + i Safe fix: If you want to ignore a folder, use the following pattern instead: !**/dist. + + 7 │ ······"!**/dist/**" + │ --- + +``` diff --git a/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc b/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc new file mode 100644 index 0000000000..3450211fb5 --- /dev/null +++ b/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc @@ -0,0 +1,10 @@ +// should not generate diagnostics +{ + "files": { + "includes": [ + "**", + "!dist", + "!**/dist" + ] + } +} diff --git a/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc.snap b/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc.snap new file mode 100644 index 0000000000..27e823a087 --- /dev/null +++ b/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc.snap @@ -0,0 +1,18 @@ +--- +source: crates/biome_json_analyze/tests/spec_tests.rs +expression: valid.biome.jsonc +--- +# Input +```jsonc +// should not generate diagnostics +{ + "files": { + "includes": [ + "**", + "!dist", + "!**/dist" + ] + } +} + +``` diff --git a/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid_overrides.biome.jsonc b/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid_overrides.biome.jsonc new file mode 100644 index 0000000000..22a66b641a --- /dev/null +++ b/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid_overrides.biome.jsonc @@ -0,0 +1,10 @@ +// should not generate diagnostics +{ + "overrides": [ + { + "includes": [ + "!dist" + ] + } + ] +} diff --git a/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid_overrides.biome.jsonc.snap b/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid_overrides.biome.jsonc.snap new file mode 100644 index 0000000000..f91506d723 --- /dev/null +++ b/crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid_overrides.biome.jsonc.snap @@ -0,0 +1,18 @@ +--- +source: crates/biome_json_analyze/tests/spec_tests.rs +expression: valid_overrides.biome.jsonc +--- +# Input +```jsonc +// should not generate diagnostics +{ + "overrides": [ + { + "includes": [ + "!dist" + ] + } + ] +} + +``` diff --git a/crates/biome_rule_options/src/lib.rs b/crates/biome_rule_options/src/lib.rs index 4aedd70700..0a34aaf83e 100644 --- a/crates/biome_rule_options/src/lib.rs +++ b/crates/biome_rule_options/src/lib.rs @@ -17,6 +17,7 @@ pub mod no_autofocus; pub mod no_await_in_loops; pub mod no_banned_types; pub mod no_barrel_file; +pub mod no_biome_first_exception; pub mod no_bitwise_operators; pub mod no_blank_target; pub mod no_catch_assign; @@ -247,6 +248,7 @@ pub mod use_arrow_function; pub mod use_as_const_assertion; pub mod use_at_index; pub mod use_await; +pub mod use_biome_ignore_folder; pub mod use_block_statements; pub mod use_button_type; pub mod use_collapsed_else_if; diff --git a/crates/biome_rule_options/src/no_biome_first_exception.rs b/crates/biome_rule_options/src/no_biome_first_exception.rs new file mode 100644 index 0000000000..4c03e59ec2 --- /dev/null +++ b/crates/biome_rule_options/src/no_biome_first_exception.rs @@ -0,0 +1,6 @@ +use biome_deserialize_macros::Deserializable; +use serde::{Deserialize, Serialize}; +#[derive(Default, Clone, Debug, Deserialize, Deserializable, Eq, PartialEq, Serialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields, default)] +pub struct NoBiomeFirstExceptionOptions {} diff --git a/crates/biome_rule_options/src/use_biome_ignore_folder.rs b/crates/biome_rule_options/src/use_biome_ignore_folder.rs new file mode 100644 index 0000000000..678adf5fe2 --- /dev/null +++ b/crates/biome_rule_options/src/use_biome_ignore_folder.rs @@ -0,0 +1,6 @@ +use biome_deserialize_macros::Deserializable; +use serde::{Deserialize, Serialize}; +#[derive(Default, Clone, Debug, Deserialize, Deserializable, Eq, PartialEq, Serialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields, default)] +pub struct UseBiomeIgnoreFolderOptions {} diff --git a/packages/@biomejs/backend-jsonrpc/src/workspace.ts b/packages/@biomejs/backend-jsonrpc/src/workspace.ts index de44a4f4d8..e6cfbe58c0 100644 --- a/packages/@biomejs/backend-jsonrpc/src/workspace.ts +++ b/packages/@biomejs/backend-jsonrpc/src/workspace.ts @@ -2121,6 +2121,10 @@ export interface Suspicious { * Disallows using an async function as a Promise executor. */ noAsyncPromiseExecutor?: RuleConfiguration_for_NoAsyncPromiseExecutorOptions; + /** + * Prevents the use of the ! pattern in the first position of files.includes in the configuration file. + */ + noBiomeFirstException?: RuleFixConfiguration_for_NoBiomeFirstExceptionOptions; /** * Disallow bitwise operators. */ @@ -2429,6 +2433,10 @@ export interface Suspicious { * Ensure async functions utilize await. */ useAwait?: RuleConfiguration_for_UseAwaitOptions; + /** + * Promotes the correct usage for ignoring folders in the configuration file. + */ + useBiomeIgnoreFolder?: RuleFixConfiguration_for_UseBiomeIgnoreFolderOptions; /** * Enforce default clauses in switch statements to be last */ @@ -3295,6 +3303,9 @@ export type RuleConfiguration_for_NoAssignInExpressionsOptions = export type RuleConfiguration_for_NoAsyncPromiseExecutorOptions = | RulePlainConfiguration | RuleWithOptions_for_NoAsyncPromiseExecutorOptions; +export type RuleFixConfiguration_for_NoBiomeFirstExceptionOptions = + | RulePlainConfiguration + | RuleWithFixOptions_for_NoBiomeFirstExceptionOptions; export type RuleConfiguration_for_NoBitwiseOperatorsOptions = | RulePlainConfiguration | RuleWithOptions_for_NoBitwiseOperatorsOptions; @@ -3523,6 +3534,9 @@ export type RuleConfiguration_for_UseAdjacentOverloadSignaturesOptions = export type RuleConfiguration_for_UseAwaitOptions = | RulePlainConfiguration | RuleWithOptions_for_UseAwaitOptions; +export type RuleFixConfiguration_for_UseBiomeIgnoreFolderOptions = + | RulePlainConfiguration + | RuleWithFixOptions_for_UseBiomeIgnoreFolderOptions; export type RuleConfiguration_for_UseDefaultSwitchClauseLastOptions = | RulePlainConfiguration | RuleWithOptions_for_UseDefaultSwitchClauseLastOptions; @@ -6664,6 +6678,20 @@ export interface RuleWithOptions_for_NoAsyncPromiseExecutorOptions { */ options: NoAsyncPromiseExecutorOptions; } +export interface RuleWithFixOptions_for_NoBiomeFirstExceptionOptions { + /** + * The kind of the code actions emitted by the rule + */ + fix?: FixKind; + /** + * The severity of the emitted diagnostics by the rule + */ + level: RulePlainConfiguration; + /** + * Rule's options + */ + options: NoBiomeFirstExceptionOptions; +} export interface RuleWithOptions_for_NoBitwiseOperatorsOptions { /** * The severity of the emitted diagnostics by the rule @@ -7524,6 +7552,20 @@ export interface RuleWithOptions_for_UseAwaitOptions { */ options: UseAwaitOptions; } +export interface RuleWithFixOptions_for_UseBiomeIgnoreFolderOptions { + /** + * The kind of the code actions emitted by the rule + */ + fix?: FixKind; + /** + * The severity of the emitted diagnostics by the rule + */ + level: RulePlainConfiguration; + /** + * Rule's options + */ + options: UseBiomeIgnoreFolderOptions; +} export interface RuleWithOptions_for_UseDefaultSwitchClauseLastOptions { /** * The severity of the emitted diagnostics by the rule @@ -8160,6 +8202,7 @@ export interface NoApproximativeNumericConstantOptions {} export interface NoArrayIndexKeyOptions {} export interface NoAssignInExpressionsOptions {} export interface NoAsyncPromiseExecutorOptions {} +export interface NoBiomeFirstExceptionOptions {} export interface NoBitwiseOperatorsOptions { /** * Allows a list of bitwise operators to be used as exceptions. @@ -8263,6 +8306,7 @@ export interface NoVarOptions {} export interface NoWithOptions {} export interface UseAdjacentOverloadSignaturesOptions {} export interface UseAwaitOptions {} +export interface UseBiomeIgnoreFolderOptions {} export interface UseDefaultSwitchClauseLastOptions {} export interface UseErrorMessageOptions {} export interface UseGetterReturnOptions {} @@ -8649,7 +8693,6 @@ export type Category = | "lint/correctness/useValidForDirection" | "lint/correctness/useValidTypeof" | "lint/correctness/useYield" - | "lint/nursery/colorNoInvalidHex" | "lint/nursery/noNextAsyncClientComponent" | "lint/nursery/noColorInvalidHex" | "lint/nursery/noFloatingPromises" @@ -8666,9 +8709,9 @@ export type Category = | "lint/nursery/noUnwantedPolyfillio" | "lint/nursery/noUselessBackrefInRegex" | "lint/nursery/noUselessUndefined" + | "lint/nursery/noVueDataObjectDeclaration" | "lint/nursery/noVueReservedKeys" | "lint/nursery/noVueReservedProps" - | "lint/nursery/noVueDataObjectDeclaration" | "lint/nursery/useAnchorHref" | "lint/nursery/useBiomeSuppressionComment" | "lint/nursery/useConsistentObjectDefinition" @@ -8777,6 +8820,7 @@ export type Category = | "lint/suspicious/noArrayIndexKey" | "lint/suspicious/noAssignInExpressions" | "lint/suspicious/noAsyncPromiseExecutor" + | "lint/suspicious/noBiomeFirstException" | "lint/suspicious/noBitwiseOperators" | "lint/suspicious/noCatchAssign" | "lint/suspicious/noClassAssign" @@ -8853,6 +8897,7 @@ export type Category = | "lint/suspicious/noWith" | "lint/suspicious/useAdjacentOverloadSignatures" | "lint/suspicious/useAwait" + | "lint/suspicious/useBiomeIgnoreFolder" | "lint/suspicious/useIterableCallbackReturn" | "lint/suspicious/useDefaultSwitchClauseLast" | "lint/suspicious/useErrorMessage" diff --git a/packages/@biomejs/biome/configuration_schema.json b/packages/@biomejs/biome/configuration_schema.json index af4c4d8d27..9b73a1ab96 100644 --- a/packages/@biomejs/biome/configuration_schema.json +++ b/packages/@biomejs/biome/configuration_schema.json @@ -2590,6 +2590,16 @@ ] }, "NoBarrelFileOptions": { "type": "object", "additionalProperties": false }, + "NoBiomeFirstExceptionConfiguration": { + "anyOf": [ + { "$ref": "#/definitions/RulePlainConfiguration" }, + { "$ref": "#/definitions/RuleWithNoBiomeFirstExceptionOptions" } + ] + }, + "NoBiomeFirstExceptionOptions": { + "type": "object", + "additionalProperties": false + }, "NoBitwiseOperatorsConfiguration": { "anyOf": [ { "$ref": "#/definitions/RulePlainConfiguration" }, @@ -5905,6 +5915,25 @@ }, "additionalProperties": false }, + "RuleWithNoBiomeFirstExceptionOptions": { + "type": "object", + "required": ["level"], + "properties": { + "fix": { + "description": "The kind of the code actions emitted by the rule", + "anyOf": [{ "$ref": "#/definitions/FixKind" }, { "type": "null" }] + }, + "level": { + "description": "The severity of the emitted diagnostics by the rule", + "allOf": [{ "$ref": "#/definitions/RulePlainConfiguration" }] + }, + "options": { + "description": "Rule's options", + "allOf": [{ "$ref": "#/definitions/NoBiomeFirstExceptionOptions" }] + } + }, + "additionalProperties": false + }, "RuleWithNoBitwiseOperatorsOptions": { "type": "object", "required": ["level"], @@ -9784,6 +9813,25 @@ }, "additionalProperties": false }, + "RuleWithUseBiomeIgnoreFolderOptions": { + "type": "object", + "required": ["level"], + "properties": { + "fix": { + "description": "The kind of the code actions emitted by the rule", + "anyOf": [{ "$ref": "#/definitions/FixKind" }, { "type": "null" }] + }, + "level": { + "description": "The severity of the emitted diagnostics by the rule", + "allOf": [{ "$ref": "#/definitions/RulePlainConfiguration" }] + }, + "options": { + "description": "Rule's options", + "allOf": [{ "$ref": "#/definitions/UseBiomeIgnoreFolderOptions" }] + } + }, + "additionalProperties": false + }, "RuleWithUseBlockStatementsOptions": { "type": "object", "required": ["level"], @@ -12440,6 +12488,13 @@ { "type": "null" } ] }, + "noBiomeFirstException": { + "description": "Prevents the use of the ! pattern in the first position of files.includes in the configuration file.", + "anyOf": [ + { "$ref": "#/definitions/NoBiomeFirstExceptionConfiguration" }, + { "type": "null" } + ] + }, "noBitwiseOperators": { "description": "Disallow bitwise operators.", "anyOf": [ @@ -12988,6 +13043,13 @@ { "type": "null" } ] }, + "useBiomeIgnoreFolder": { + "description": "Promotes the correct usage for ignoring folders in the configuration file.", + "anyOf": [ + { "$ref": "#/definitions/UseBiomeIgnoreFolderConfiguration" }, + { "type": "null" } + ] + }, "useDefaultSwitchClauseLast": { "description": "Enforce default clauses in switch statements to be last", "anyOf": [ @@ -13214,6 +13276,16 @@ ] }, "UseAwaitOptions": { "type": "object", "additionalProperties": false }, + "UseBiomeIgnoreFolderConfiguration": { + "anyOf": [ + { "$ref": "#/definitions/RulePlainConfiguration" }, + { "$ref": "#/definitions/RuleWithUseBiomeIgnoreFolderOptions" } + ] + }, + "UseBiomeIgnoreFolderOptions": { + "type": "object", + "additionalProperties": false + }, "UseBlockStatementsConfiguration": { "anyOf": [ { "$ref": "#/definitions/RulePlainConfiguration" }, diff --git a/packages/@biomejs/js-api/src/wasm.ts b/packages/@biomejs/js-api/src/wasm.ts index 54e1d77d28..0c26b783fb 100644 --- a/packages/@biomejs/js-api/src/wasm.ts +++ b/packages/@biomejs/js-api/src/wasm.ts @@ -99,7 +99,9 @@ export interface Workspace { pullDiagnostics( params: PullDiagnosticsParams, ): PullDiagnosticsResult; + // biome-ignore lint: code generation is broken formatRange(params: FormatRangeParams): any; + // biome-ignore lint: code generation is broken formatFile(params: FormatFileParams): any; getFormatterIr(params: GetFormatterIRParams): string; fixFile(params: FixFileParams): FixFileResult;