Coming from #67420
Problem
When Array.from(set).length is used, then a full array is created in memory just to count the number of elements in a set.
Solution
Enable eslint-plugin-unicorn’s prefer-set-size to use set.size, which returns the size directly in constant time without allocation.
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021968163507175173109
- Upwork Job ID: 1968163507175173109
- Last Price Increase: 2025-11-22
- Automatic offers:
- NJ-2020 | Contributor | 109179401
Issue Owner
Current Issue Owner: @
Issue Owner
Current Issue Owner: @
Issue Owner
Current Issue Owner: @zanyrenney
Coming from #67420
Problem
When
Array.from(set).lengthis used, then a full array is created in memory just to count the number of elements in a set.Solution
Enable eslint-plugin-unicorn’s prefer-set-size to use set.size, which returns the size directly in constant time without allocation.
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @zanyrenney