mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(linter): prefer-string-starts-ends-with: ignore i and m modifiers. (#1688)
Fixes: #1687
This commit is contained in:
parent
9f990ce677
commit
d101acf833
1 changed files with 4 additions and 1 deletions
|
|
@ -90,7 +90,9 @@ enum ErrorKind {
|
|||
}
|
||||
|
||||
fn check_regex(regexp_lit: &RegExpLiteral) -> Option<ErrorKind> {
|
||||
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![
|
||||
|
|
|
|||
Loading…
Reference in a new issue