Repository navigation
v1.8.0
Minor Changes
-
#34
e66f668Thanks @stevensacks! - Add theno-null-renderguardrail rule: standardize the empty render onundefinedinstead ofnull.In
.tsx/.jsxfiles, areturn nullinside a function that provably renders JSX (it returns a JSX element elsewhere in the same scope) is now anerrorand is rewritten toreturn undefinedby--fix.nullandundefinedare identical to React's reconciler (both, withfalse/true, are the same empty slot), so this is a consistency convention that standardizes on one of two equivalent forms, not a correctness or performance change.The autofix is deliberately conservative: it rewrites
return nullonly when the enclosing function is provably a render function. Areturn nullin a loader, action, or plain utility is never touched, so unsupervised--fixcannot change non-render runtime behavior.: nullternary arms stay out of scope (covered report-only by the existingno-restricted-syntaxselectors).Wired into
guardrails, scoped to.tsx/.jsx. A consumer with areturn nullin a render function will see a NEW auto-fixable lint error on upgrade.Also flag the most common numeric-
0leak viano-restricted-syntax: a.length && <JSX/>conditional render. A.lengthleft operand is always numeric, so&&leaks the literal0into the DOM when the list is empty; the fix isitems.length > 0 && <JSX/>. This selector is report-only (no autofix) and has zero false positives. The generalcount && <JSX/>case is still not caught, because any expression could be numeric. -
#34
e66f668Thanks @stevensacks! - Refresh quarantined toolchain dependencies.eslint-plugin-sonarjs4.0.3 → 4.1.0. This is a runtime dependency whose recommended rules this config spreads, so consumers may see new SonarJS findings on upgrade. Most are auto-fixable; treat them as signal.typescript-eslint8.61.1 → 8.62.0. Held at 8.62.0 deliberately: 8.62.1 has not yet cleared the 7-day release-age quarantine, so 8.62.0 is the newest version that installs cleanly under a downstream release-age policy. A later release picks up 8.62.1 once it ages out.
Both bumps have cleared the 7-day release-age quarantine, so each installs cleanly with no new release-age exclusions required.