diff --git a/crates/oxc_linter/src/rules/unicorn/prefer_string_starts_ends_with.rs b/crates/oxc_linter/src/rules/unicorn/prefer_string_starts_ends_with.rs index e2bdc900d..cc10b1116 100644 --- a/crates/oxc_linter/src/rules/unicorn/prefer_string_starts_ends_with.rs +++ b/crates/oxc_linter/src/rules/unicorn/prefer_string_starts_ends_with.rs @@ -90,7 +90,9 @@ enum ErrorKind { } fn check_regex(regexp_lit: &RegExpLiteral) -> Option { - if regexp_lit.regex.flags.contains(RegExpFlags::I | RegExpFlags::M) { + if regexp_lit.regex.flags.contains(RegExpFlags::I) + || regexp_lit.regex.flags.contains(RegExpFlags::M) + { return None; } @@ -131,6 +133,7 @@ fn test() { r"foo()()", r"if (foo.match(/^foo/)) {}", r"if (/^foo/.exec(foo)) {}", + r"/^http/i.test(uri)", ]; let fail = vec![