Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Oct 19, 2023
1 parent 4c665d2 commit 481bdb4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/control_flow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,7 @@ impl Visit for Analyzer<'_> {
throw: false,
infinite_loop: false,
},
|acc, cur| {
acc.merge_forced(cur)
},
|acc, cur| acc.merge_forced(cur),
);

match forced_end {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/ban_untagged_ignore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl LintRule for BanUntaggedIgnore {
.line_ignore_directives()
.values()
.filter(|d| d.ignore_all())
.map(|d| d.range())
.map(|d| d.range()),
);

for range in violated_ranges {
Expand Down
4 changes: 3 additions & 1 deletion src/rules/fresh_handler_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ impl Handler for Visitor {
let id = match export_decl.decl {
Decl::Var(var_decl) => {
if let Some(first) = var_decl.decls.first() {
let Pat::Ident(name_ident) = first.name else {return};
let Pat::Ident(name_ident) = first.name else {
return;
};
name_ident.id
} else {
return;
Expand Down
4 changes: 3 additions & 1 deletion src/rules/fresh_server_event_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ impl Handler for Visitor {
_ => return,
};

let JSXExpr::Expr(expr_value) = expr.expr else {return};
let JSXExpr::Expr(expr_value) = expr.expr else {
return;
};

// If we pass a function expression or an arrow function expression
// then we know for sure that we can't render that.
Expand Down
5 changes: 4 additions & 1 deletion src/rules/no_dupe_else_if.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ impl<'c, 'view> VisitAll for NoDupeElseIfVisitor<'c, 'view> {

fn mk_condition_to_check(cond: Expr) -> Vec<Expr> {
match cond {
Expr::Bin(BinExpr { op: BinaryOp::LogicalAnd, .. }) => {
Expr::Bin(BinExpr {
op: BinaryOp::LogicalAnd,
..
}) => {
let mut c = vec![cond.clone()];
c.append(&mut split_by_and(cond));
c
Expand Down

0 comments on commit 481bdb4

Please sign in to comment.