Repository navigation
v3.4.0
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
reduceandreduceRightcallbacks that copy a growing accumulator with methods such asconcat,slice,Array.from, orObject.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 === 0or.length > 0; suggestions are not applied by--fixunlessallowAutofix: trueis configured (defaultfalse). 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 asfileNamein a nested build configuration no longer report - by @howmanysmall in #87
Full Changelog: v3.3.3...v3.4.0