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

Discussing rule: max-lines-per-function #131

Open
eduardoboucas opened this issue Mar 12, 2021 · 3 comments
Open

Discussing rule: max-lines-per-function #131

eduardoboucas opened this issue Mar 12, 2021 · 3 comments

Comments

@eduardoboucas
Copy link
Member

While I agree with this rule in principle, I find myself fighting with it a lot. It's particularly problematic in files where we pass lots of parameters around (see https://github.com/netlify/build/blob/master/.eslintrc.js#L38-L46).

In this particular case, I like how explicit we are about the parameters we receive and pass to each function. By doing this, we can be conservative about what we expose to other functions downstream. But this makes the code more verbose, which conflicts with this rule.

Any thoughts?

@ehmicky
Copy link
Contributor

ehmicky commented Mar 12, 2021

I agree.

What about either:

  • Increasing the number of max-lines-per-function?
  • Disabling max-lines-per-function and only relying on max-statements (which we already do)?

@danez
Copy link
Contributor

danez commented Jul 28, 2022

I think especially that prettier has the hand over most of the styling, sometimes it is also out of our hands to "fix" this rule.
like

const {a,b,c,d,f,g} = function();

which prettier might format to

const {
  a,
  b,
  c,
  d,
  f,
  g
} = function();

So I'm also for disabling this and rather rely on max-statements

@eduardoboucas
Copy link
Member Author

So I'm also for disabling this and rather rely on max-statements

Sounds good! 🚀

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

3 participants