Pre-Empt Recurring Code-Review Nits
Pre-empt the known recurring review nits while writing the code. When review checks a convention by eye, make tooling enforce it so it stops recurring.
Why
A human reviewer sees only what needs judgment.
How To Apply
- Enforce a convention with a lint rule, and run
lint --fixwhere the rule can fix it. - Before defending a review comment as mistaken, verify the claim against the code or the spec.
- The CSS
@propertycase below is a spec requirement worth defending. - An empty override defended on an assumed base throw or call is often harmless and deletable, and the reviewer was right.
- The CSS
Examples
- Any language: an empty override reads as dead code. Delete it unless it suppresses an observable base side effect (a throw, a network call, a real state change). Building an object that nothing then reads is not observable. Verify the side effect is real before keeping one, and leave a why-comment if it stays.
- GitHub Actions: pin every action to its full commit SHA, with the version in a comment (
actions/checkout@<sha> # v5.0.0), and let Dependabot keep the pins current. When one workflow is already ahead, align the rest in the same change. - Angular: the order of template attributes is a setting of
@angular-eslint/template/attributes-order, configured strictly in one shared fragment spread into every template-bearing project's config, so the lint fixes it. Which order is the project's choice. - CSS:
@propertywith a typed (non-*)syntaxrequiresinitial-value, or the registration is invalid and silently dropped. Never delete it to simplify. - SCSS: the suffix ampersand (
.modifier &) is correct but easily misread. Where it is a one-off in the file or codebase, prefer the explicit selector (.modifier .block__element).