Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
eryue0220 committed Mar 27, 2024
1 parent c01e70b commit a24917a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
6 changes: 2 additions & 4 deletions crates/oxc_linter/src/rules/jest/prefer_called_with.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ impl PreferCalledWith {
return;
};

let has_not_modifier = jest_fn_call
.modifiers()
.iter()
.any(|modifier| modifier.is_name_equal("not"));;
let has_not_modifier =
jest_fn_call.modifiers().iter().any(|modifier| modifier.is_name_equal("not"));

if has_not_modifier {
return;
Expand Down
6 changes: 2 additions & 4 deletions crates/oxc_linter/src/rules/jest/prefer_comparison_matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,8 @@ impl PreferComparisonMatcher {
return;
}

let has_not_modifier = parse_expect_jest_fn
.modifiers()
.iter()
.any(|modifier| modifier.is_name_equal("not"));
let has_not_modifier =
parse_expect_jest_fn.modifiers().iter().any(|modifier| modifier.is_name_equal("not"));
let Expression::BooleanLiteral(matcher_arg_value) =
first_matcher_arg.get_inner_expression()
else {
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/jest/prefer_spy_on.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl PreferSpyOn {
let has_mock_implementation = jest_fn_call
.members
.iter()
.any(|modifier| modifier.is_name_equal("not"));
.any(|modifier| modifier.is_name_equal("mockImplementation"));

(second.span.start - 1, has_mock_implementation)
} else {
Expand Down
6 changes: 2 additions & 4 deletions crates/oxc_linter/src/rules/jest/prefer_to_be.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,8 @@ impl PreferToBe {
return;
};

let has_not_modifier = jest_expect_fn_call
.modifiers()
.iter()
.any(|modifier| modifier.is_name_equal("not"));
let has_not_modifier =
jest_expect_fn_call.modifiers().iter().any(|modifier| modifier.is_name_equal("not"));

if has_not_modifier {
if matcher.is_name_equal("toBeUndefined") {
Expand Down

0 comments on commit a24917a

Please sign in to comment.