Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
style(no-unused-vars): fix clippy lints
  • Loading branch information
eventualbuddha committed Oct 14, 2024
commit 1b886b1eb1875f93895e291f59827afd270175a0
10 changes: 4 additions & 6 deletions crates/oxc_linter/src/rules/eslint/no_unused_vars/allowed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ impl<'s, 'a> Symbol<'s, 'a> {
| AstKind::ArrayExpressionElement(_)
| AstKind::ExpressionArrayElement(_)
| AstKind::ArrayExpression(_)
// a ? b : function foo() {}
// Only considered used if the function is the test or the selected branch,
// but we can't determine that here.
| AstKind::ConditionalExpression(_)
=> {
continue;
}
Expand Down Expand Up @@ -70,12 +74,6 @@ impl<'s, 'a> Symbol<'s, 'a> {
};
return body.span.contains_inclusive(self.span()) && body.statements.len() == 1 && !self.get_snippet(body.span).starts_with('{')
}
// a ? b : function foo() {}
// Only considered used if the function is the test or the selected branch,
// but we can't determine that here.
AstKind::ConditionalExpression(_) => {
continue;
}
_ => {
parent.kind().debug_name();
return false;
Expand Down