diff --git a/Cargo.lock b/Cargo.lock index 96278d3fb0138..8c24fb7cc609f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -324,6 +324,15 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "convert_case" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "cow-utils" version = "0.1.3" @@ -1323,7 +1332,7 @@ version = "3.0.0-alpha.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70412f9791322124132363db0eeb3ea0e7e7c29604840e228881c83d2b1b9a85" dependencies = [ - "convert_case", + "convert_case 0.6.0", "napi-derive-backend", "proc-macro2", "quote", @@ -1336,7 +1345,7 @@ version = "2.0.0-alpha.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f70fd2c8a3ea7a17b75eeae87653c286345a6e7eb3f5bdcf3f3d4a368cb09831" dependencies = [ - "convert_case", + "convert_case 0.6.0", "proc-macro2", "quote", "semver", @@ -1571,7 +1580,7 @@ name = "oxc_ast_tools" version = "0.0.0" dependencies = [ "bpaf", - "convert_case", + "convert_case 0.7.1", "cow-utils", "itertools", "lazy_static", @@ -1772,7 +1781,7 @@ name = "oxc_linter" version = "0.15.6" dependencies = [ "bitflags 2.7.0", - "convert_case", + "convert_case 0.7.1", "cow-utils", "dashmap 6.1.0", "fast-glob", @@ -1818,7 +1827,7 @@ dependencies = [ name = "oxc_macros" version = "0.0.0" dependencies = [ - "convert_case", + "convert_case 0.7.1", "itertools", "proc-macro2", "quote", @@ -2534,7 +2543,7 @@ dependencies = [ name = "rulegen" version = "0.0.0" dependencies = [ - "convert_case", + "convert_case 0.7.1", "handlebars", "lazy_static", "oxc_allocator", diff --git a/Cargo.toml b/Cargo.toml index 2a7efedbe002a..7dad256f2d801 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -142,7 +142,7 @@ bumpalo = "3.16.0" compact_str = "0.8.0" console = "0.15.8" console_error_panic_hook = "0.1.7" -convert_case = "0.6.0" +convert_case = "0.7.0" cow-utils = "0.1.3" criterion2 = { version = "2.0.0", default-features = false } encoding_rs = "0.8.35" diff --git a/crates/oxc_linter/src/rules/unicorn/filename_case.rs b/crates/oxc_linter/src/rules/unicorn/filename_case.rs index c40681f1a5041..a077633fcbeab 100644 --- a/crates/oxc_linter/src/rules/unicorn/filename_case.rs +++ b/crates/oxc_linter/src/rules/unicorn/filename_case.rs @@ -29,7 +29,7 @@ fn filename_case_diagnostic(filename: &str, valid_cases: &[(&str, Case)]) -> Oxc .iter() .map(|(_, case)| { let converter = - Converter::new().remove_boundaries(&[Boundary::LowerDigit, Boundary::DigitLower]); + Converter::new().remove_boundaries(&[Boundary::LOWER_DIGIT, Boundary::DIGIT_LOWER]); // get the leading characters that were trimmed, if any, else empty string let leading = filename.chars().take_while(|c| c == &'_').collect::(); let trailing = filename.chars().rev().take_while(|c| c == &'_').collect::(); @@ -160,7 +160,7 @@ impl Rule for FilenameCase { if !enabled_cases.any(|(_, case, _)| { let converter = - Converter::new().remove_boundaries(&[Boundary::LowerDigit, Boundary::DigitLower]); + Converter::new().remove_boundaries(&[Boundary::LOWER_DIGIT, Boundary::DIGIT_LOWER]); converter.to_case(*case).convert(filename) == filename }) { let valid_cases = cases diff --git a/crates/oxc_macros/src/declare_oxc_lint.rs b/crates/oxc_macros/src/declare_oxc_lint.rs index a24b54f60eece..1735ccb2795f2 100644 --- a/crates/oxc_macros/src/declare_oxc_lint.rs +++ b/crates/oxc_macros/src/declare_oxc_lint.rs @@ -56,7 +56,7 @@ impl Parse for LintRuleMeta { } pub(crate) fn rule_name_converter() -> Converter { - Converter::new().remove_boundary(Boundary::LowerDigit).to_case(Case::Kebab) + Converter::new().remove_boundary(Boundary::LOWER_DIGIT).to_case(Case::Kebab) } pub fn declare_oxc_lint(metadata: LintRuleMeta) -> TokenStream {