Repository navigation
v1.7.0
Minor Changes
-
#32
55bb692Thanks @stevensacks! - Flag renderingnullfrom a JSX ternary viano-restricted-syntax.cond ? <JSX/> : nullandcond ? null : <JSX/>are nowerror-level. Both
are the boolean-guarded&&render guard written the long way; use
cond && <JSX/>instead (coerce a numeric/falsy guard with!!condso the
0value can't leak into the output).The selectors are flag-only, with no autofix: a blind
? : null→&&rewrite
is unsafe because numeric-0guards need!!,??-fed values need
: undefined, and||-guards need per-operand coercion. A human applies the
fix the selector points to.Both selectors only match a
JSXElement/JSXFragmentbranch, so they are
inert outside.tsx/.jsx. Allno-restricted-syntaxselectors are
consolidated into onegaia/no-restricted-syntaxconfig object, because ESLint
flat config merges that rule key by replacement (last match wins), not
concatenation.A consumer with a
cond ? <JSX/> : nullternary will see a NEW lint failure on
upgrade. That is the intent: convert it to&&.