Skip to content

v1beta2

Choose a tag to compare

@Andrew-Jayne Andrew-Jayne released this 06 Aug 14:24
· 9 commits to main since this release

Fixes

  • Single-use checks no longer false-positive on closure-shared variables. The counter used to stop at scope boundaries, so a variable used repeatedly inside a callback (Promise executor, event handler) but once in its own scope was flagged as single-use. The analysis now resolves every reference to its nearest enclosing binding, with shadowing handled exactly. A definition is flagged only with exactly one same-scope read and zero closure reads.
  • ||= and &&= are now flagged by bool_op exactly like their expanded a = a || b forms, which previously slipped through.
  • The CLI errors on extra positional paths instead of silently dropping them.
  • Fixed the DELIBERTATE_CONSTANT typo in the single-use message.

New checks

  • nullish_coalesce (default-on): flags ?? and ??= — inline if statements in disguise, matching the ternary ban. Excludable via exclude-type.
  • optional_param (opt-in via include-extra): flags arg?: T in function implementations in favor of the explicit arg: T | null = null. Type-space signatures and overload declarations are exempt.

Dogfooding

ExplicitJS now lints itself: deno task lint runs the tool on its own source with optional_param enabled (see .explicitrc.json) and must exit clean. All ?? uses and optional parameters in our own code were rewritten accordingly.