Skip to content

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jan 15, 2025
1 parent b5d4f80 commit b0745e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/unicorn/filename_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<String>();
let trailing = filename.chars().rev().take_while(|c| c == &'_').collect::<String>();
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_macros/src/declare_oxc_lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b0745e0

Please sign in to comment.