Skip to content

Conversation

@sasial-dev
Copy link

When using unicorn in roblox-ts, the no-array-for-each suggests that it should convert a for loop to for (const [index, value] of foo.entries()) {. Yet, array.entries() does not exist.

array.entries() also was introduced in ES6 I believe, so adding this paramater would support ES5 code (although very rare these days!) and other runtimes that do not support array.entries() yet still want to use unicorn (e.g. assemblyscript).

@sindresorhus
Copy link
Owner

Sorry to disappoint, but we only target the latest JavaScript version here and we will not include any option to support older JS versions. I recommend disabling the rule if you cannot use .entries().

@sasial-dev sasial-dev deleted the no-array-for-each/allowIndexParameter branch November 16, 2024 09:29
@sasial-dev
Copy link
Author

No stress - thank you for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants