Why this matters
Reduces unnecessary work and improves clarity.
Exit loops as soon as the goal is achieved using break/return or use any/find/count short-circuiting operations.
Reduces unnecessary work and improves clarity.
Side-by-side examples engineers can pattern-match during review.
var found = false
for (x in xs) { if (x == target) { found = true } }val found = xs.any { it == target }for (x in xs) { if (ok(x)) do(x) } // no breakxs.firstOrNull(::ok)?.let(::do)From the same buckets as this rule.
All static JS/CSS/font/image files MUST use content-hashed filenames (e.g., app.9c1a7b.js) and be served with "Cache-Control: public, max-age=31536000, immutable". HTML and other non-fingerprinted documents MUST be served with "Cache-Control: no-cache" (or equivalent) to enable conditional revalidation.