Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion eslint rule fp/no-loops #426

Open
lukasholzer opened this issue Jan 21, 2022 · 4 comments
Open

Discussion eslint rule fp/no-loops #426

lukasholzer opened this issue Jan 21, 2022 · 4 comments

Comments

@lukasholzer
Copy link

lukasholzer commented Jan 21, 2022

I want to discuss this rule and why we are forbidding the use of for-of or for loops.

https://github.com/jfmengels/eslint-plugin-fp/blob/master/docs/rules/no-loops.md

In general if you need something performant a for loop is unbeatable on large scale

like

for (let i = 0, max = hugeSet.length(); i < max; i ++) {
...
}

a different example often you want to iterate over an iterate-able with entries in a sync manor where some async code is awaited:

for (const entry of entries) {
   await doSomeAsync(entry)
   console.log('done for entry')
}

IMO these are valid examples to use a for or forof and we should not forbid them.

cc @eduardoboucas @ehmicky @netlify-team-account-1 @ascorbic @erezrokah

@eduardoboucas
Copy link
Member

I'm okay with removing it.

@danez
Copy link
Contributor

danez commented Jul 28, 2022

It looks like we can move forward with this.

@eduardoboucas
Copy link
Member

Let's do it! 🚀

@ascorbic
Copy link
Member

Can I suggest we remove the fp plugin entirely. I think it's far too opinionated for a global config like this.

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

No branches or pull requests

4 participants