Add let chains preference to development guidelines (#22497)

This commit is contained in:
Charlie Marsh
2026-01-10 12:29:07 -05:00
committed by GitHub
parent 880513a013
commit 8e29be9c1c

View File

@@ -68,3 +68,4 @@ When working on ty, PR titles should start with `[ty]` and be tagged with the `t
- Always run `uvx pre-commit run -a` at the end of a task.
- Avoid writing significant amounts of new code. This is often a sign that we're missing an existing method or mechanism that could help solve the problem. Look for existing utilities first.
- Avoid falling back to patterns that require `panic!`, `unreachable!`, or `.unwrap()`. Instead, try to encode those constraints in the type system.
- Prefer let chains (`if let` combined with `&&`) over nested `if let` statements to reduce indentation and improve readability.