Skip to content

v3.4.0

Choose a tag to compare

@github-actions github-actions released this 15 Oct 22:22
· 161 commits to main since this release
v3.4.0
61a2409

v3.4.0: New reducer and empty-string checks

no-reduce-accumulator-copy and no-useless-empty-string-comparison add diagnostics for inefficient reducer copies and comparisons against empty strings. starts-with-verb now treats nested callback properties inside externally constrained objects as constrained, avoiding reports for API-defined names.

🚀 Added

  • no-reduce-accumulator-copy: When enabled, reports reduce and reduceRight callbacks that copy a growing accumulator with methods such as concat, slice, Array.from, or Object.assign({}, accumulator, ...). Mutating and returning a locally owned accumulator does not report - by @howmanysmall in #86
  • no-useless-empty-string-comparison: Reports strict comparisons with '' and suggests .length === 0 or .length > 0; suggestions are not applied by --fix unless allowAutofix: true is configured (default false). Loose == and != comparisons also report, but have no rewrite because their coercion behavior differs - by @howmanysmall in #88

🐞 Fixed

  • starts-with-verb: Callback property names nested in objects or arrays passed to a call or constructor, or in an object checked with satisfies, are now treated as externally constrained. Names such as fileName in a nested build configuration no longer report - by @howmanysmall in #87

Full Changelog: v3.3.3...v3.4.0