diff --git a/Cargo.lock b/Cargo.lock index b4fea3c5cbb6..013bddb73731 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -125,7 +125,7 @@ dependencies = [ "biome_diagnostics", "biome_rowan", "enumflags2", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "schemars", "serde", "tracing", @@ -136,7 +136,7 @@ name = "biome_aria" version = "0.5.7" dependencies = [ "biome_aria_metadata", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", ] [[package]] @@ -189,7 +189,7 @@ dependencies = [ "quick-junit", "rayon", "regex", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "serde", "serde_json", "smallvec", @@ -229,7 +229,7 @@ dependencies = [ "indexmap 2.6.0", "insta", "oxc_resolver", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "schemars", "serde", "serde_ini", @@ -255,7 +255,7 @@ name = "biome_control_flow" version = "0.5.7" dependencies = [ "biome_rowan", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", ] [[package]] @@ -276,7 +276,7 @@ dependencies = [ "biome_test_utils", "insta", "regex", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "schemars", "serde", "tests_macros", @@ -342,7 +342,7 @@ dependencies = [ "biome_css_parser", "biome_css_syntax", "biome_rowan", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", ] [[package]] @@ -451,7 +451,7 @@ dependencies = [ "drop_bomb", "indexmap 2.6.0", "insta", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "schemars", "serde", "tracing", @@ -490,7 +490,7 @@ dependencies = [ "oxc_resolver", "parking_lot", "rayon", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "schemars", "serde", "serde_json", @@ -575,7 +575,7 @@ dependencies = [ "biome_graphql_parser", "biome_graphql_syntax", "biome_rowan", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", ] [[package]] @@ -658,7 +658,7 @@ dependencies = [ "path-absolutize", "rand 0.8.5", "regex", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "serde", "tests_macros", ] @@ -756,7 +756,7 @@ dependencies = [ "natord", "regex", "roaring", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "schemars", "serde", "smallvec", @@ -823,7 +823,7 @@ dependencies = [ "insta", "quickcheck", "quickcheck_macros", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "schemars", "serde", "serde_json", @@ -842,7 +842,7 @@ dependencies = [ "biome_js_syntax", "biome_rowan", "rust-lapper", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "smallvec", ] @@ -889,7 +889,7 @@ dependencies = [ "biome_test_utils", "insta", "natord", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "tests_macros", ] @@ -969,7 +969,7 @@ dependencies = [ "biome_service", "biome_text_edit", "futures", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "serde", "serde_json", "tokio", @@ -984,7 +984,7 @@ version = "0.1.0" dependencies = [ "anyhow", "biome_rowan", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "tower", "tower-lsp", ] @@ -1049,7 +1049,7 @@ dependencies = [ "biome_rowan", "biome_test_utils", "insta", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "tests_macros", ] @@ -1081,7 +1081,7 @@ dependencies = [ "biome_text_size", "insta", "node-semver", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "serde", "tests_macros", ] @@ -1097,7 +1097,7 @@ dependencies = [ "iai", "quickcheck", "quickcheck_macros", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "serde", "serde_json", "tracing", @@ -1155,7 +1155,7 @@ dependencies = [ "insta", "oxc_resolver", "regex", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "schemars", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 16e28d9a23d2..dcdfaee99328 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -191,7 +191,7 @@ quickcheck_macros = "1.0.0" quote = "1.0.37" rayon = "1.10.0" regex = "1.11.0" -rustc-hash = "1.1.0" +rustc-hash = "2.0.0" schemars = { version = "0.8.21", features = ["indexmap2", "smallvec"] } serde = { version = "1.0.210", features = ["derive"] } serde_ini = "0.2.0" diff --git a/crates/biome_cli/tests/snapshots/main_cases_diagnostics/max_diagnostics_verbose.snap b/crates/biome_cli/tests/snapshots/main_cases_diagnostics/max_diagnostics_verbose.snap index 1c9eac25d999..b39b0c2d4499 100644 --- a/crates/biome_cli/tests/snapshots/main_cases_diagnostics/max_diagnostics_verbose.snap +++ b/crates/biome_cli/tests/snapshots/main_cases_diagnostics/max_diagnostics_verbose.snap @@ -1,6 +1,7 @@ --- source: crates/biome_cli/tests/snap_test.rs expression: content +snapshot_kind: text --- ## `src/file.js` @@ -34,9 +35,9 @@ src/folder_1/package-lock.json project VERBOSE ━━━━━━━━━━ ``` ```block -src/folder_5/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +src/folder_2/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - i The file src/folder_5/package-lock.json is protected because is handled by another tool. Biome won't process it. + i The file src/folder_2/package-lock.json is protected because is handled by another tool. Biome won't process it. Verbose advice @@ -46,9 +47,9 @@ src/folder_5/package-lock.json project VERBOSE ━━━━━━━━━━ ``` ```block -src/folder_0/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +src/folder_4/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - i The file src/folder_0/package-lock.json is protected because is handled by another tool. Biome won't process it. + i The file src/folder_4/package-lock.json is protected because is handled by another tool. Biome won't process it. Verbose advice @@ -58,9 +59,9 @@ src/folder_0/package-lock.json project VERBOSE ━━━━━━━━━━ ``` ```block -src/folder_3/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +src/folder_0/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - i The file src/folder_3/package-lock.json is protected because is handled by another tool. Biome won't process it. + i The file src/folder_0/package-lock.json is protected because is handled by another tool. Biome won't process it. Verbose advice @@ -70,9 +71,9 @@ src/folder_3/package-lock.json project VERBOSE ━━━━━━━━━━ ``` ```block -src/folder_2/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +src/folder_6/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - i The file src/folder_2/package-lock.json is protected because is handled by another tool. Biome won't process it. + i The file src/folder_6/package-lock.json is protected because is handled by another tool. Biome won't process it. Verbose advice @@ -82,9 +83,9 @@ src/folder_2/package-lock.json project VERBOSE ━━━━━━━━━━ ``` ```block -src/folder_4/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +src/folder_5/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - i The file src/folder_4/package-lock.json is protected because is handled by another tool. Biome won't process it. + i The file src/folder_5/package-lock.json is protected because is handled by another tool. Biome won't process it. Verbose advice @@ -94,9 +95,9 @@ src/folder_4/package-lock.json project VERBOSE ━━━━━━━━━━ ``` ```block -src/folder_6/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +src/folder_7/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - i The file src/folder_6/package-lock.json is protected because is handled by another tool. Biome won't process it. + i The file src/folder_7/package-lock.json is protected because is handled by another tool. Biome won't process it. Verbose advice @@ -106,9 +107,9 @@ src/folder_6/package-lock.json project VERBOSE ━━━━━━━━━━ ``` ```block -src/folder_7/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +src/folder_3/package-lock.json project VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - i The file src/folder_7/package-lock.json is protected because is handled by another tool. Biome won't process it. + i The file src/folder_3/package-lock.json is protected because is handled by another tool. Biome won't process it. Verbose advice diff --git a/crates/biome_cli/tests/snapshots/main_commands_rage/with_linter_configuration.snap b/crates/biome_cli/tests/snapshots/main_commands_rage/with_linter_configuration.snap index 42deb46ad88f..dd997e614238 100644 --- a/crates/biome_cli/tests/snapshots/main_commands_rage/with_linter_configuration.snap +++ b/crates/biome_cli/tests/snapshots/main_commands_rage/with_linter_configuration.snap @@ -1,6 +1,7 @@ --- source: crates/biome_cli/tests/commands/rage.rs expression: content +snapshot_kind: text --- ## `biome.json` @@ -66,33 +67,33 @@ Linter: Recommended: false All: false Enabled rules: - complexity/noBannedTypes - complexity/noThisInStatic - complexity/noUselessConstructor - complexity/useLiteralKeys - complexity/useOptionalChain complexity/noMultipleSpacesInRegularExpressionLiterals - complexity/noUselessLoneBlockStatements + complexity/noExcessiveNestedTestSuites + complexity/noUselessRename + complexity/useArrowFunction complexity/noUselessEmptyExport - complexity/noUselessSwitchCase - complexity/noStaticOnlyClass - complexity/noUselessTypeConstraint complexity/noWith - complexity/useRegexLiterals - complexity/useArrowFunction + complexity/noUselessLoneBlockStatements + complexity/useFlatMap + complexity/noForEach + complexity/noUselessSwitchCase + complexity/useOptionalChain + complexity/noUselessCatch + complexity/noBannedTypes complexity/noExtraBooleanCast - complexity/noEmptyTypeParameters - complexity/useSimpleNumberKeys suspicious/noCommentText - complexity/noExcessiveNestedTestSuites - complexity/noUselessLabel - complexity/noUselessCatch + complexity/noUselessTypeConstraint + complexity/useSimpleNumberKeys complexity/noUselessFragments - complexity/noUselessTernary - complexity/noForEach - complexity/useFlatMap - complexity/noUselessRename + complexity/noUselessLabel + complexity/noThisInStatic + complexity/noUselessConstructor + complexity/noEmptyTypeParameters + complexity/noStaticOnlyClass complexity/noUselessThisAlias + complexity/noUselessTernary + complexity/useLiteralKeys + complexity/useRegexLiterals Server: Version: 0.0.0 diff --git a/crates/biome_configuration/src/analyzer/linter/mod.rs b/crates/biome_configuration/src/analyzer/linter/mod.rs index 9791cba5e156..3b3564381018 100644 --- a/crates/biome_configuration/src/analyzer/linter/mod.rs +++ b/crates/biome_configuration/src/analyzer/linter/mod.rs @@ -54,6 +54,6 @@ impl PartialLinterConfiguration { } pub fn get_rules(&self) -> Rules { - self.rules.as_ref().unwrap_or(&Rules::default()).clone() + self.rules.clone().unwrap_or_default() } } diff --git a/crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/+in+valid.js.snap b/crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/+in+valid.js.snap index bfee9bc66562..429e8f33e734 100644 --- a/crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/+in+valid.js.snap +++ b/crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/+in+valid.js.snap @@ -1,6 +1,7 @@ --- source: crates/biome_js_analyze/tests/spec_tests.rs expression: +in+valid.js +snapshot_kind: text --- # Input ```jsx @@ -14,8 +15,8 @@ expression: +in+valid.js ! The filename should be in camelCase or kebab-case or snake_case or equal to the name of an export. i The filename could be renamed to one of the following names: - +inValid.js +in-valid.js + +inValid.js +in_valid.js diff --git a/crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/InvalidPascalCase.js.snap b/crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/InvalidPascalCase.js.snap index 275d18455911..864ae9cf36f5 100644 --- a/crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/InvalidPascalCase.js.snap +++ b/crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/InvalidPascalCase.js.snap @@ -1,6 +1,7 @@ --- source: crates/biome_js_analyze/tests/spec_tests.rs expression: InvalidPascalCase.js +snapshot_kind: text --- # Input ```jsx @@ -15,10 +16,8 @@ InvalidPascalCase.js lint/style/useFilenamingConvention ━━━━━━━━ i The filename could be renamed to one of the following names: invalid-pascal-case.js - invalid_pascal_case.js invalidPascalCase.js + invalid_pascal_case.js ``` - -