Giter Club home page Giter Club logo

Comments (7)

sindresorhus avatar sindresorhus commented on May 27, 2024

@jamestalmage @vdemedes @novemberborn I tried setting it to 3 and it would affect AVA:

lib/assert.js:14:1
✖   14:1   This function has too many parameters (5). Maximum allowed is 3.  max-params

lib/serialize-error.js:5:1
✖    5:1   This function has too many parameters (4). Maximum allowed is 3.  max-params

lib/test.js:17:1
✖   17:1   This function has too many parameters (4). Maximum allowed is 3.  max-params

lib/watcher.js:42:1
✖   42:1   This function has too many parameters (4). Maximum allowed is 3.  max-params

test/test.js:8:1
✖    8:1   This function has too many parameters (4). Maximum allowed is 3.  max-params
✖   14:10  This function has too many parameters (4). Maximum allowed is 3.  max-params

test/visual/run-visual-tests.js:28:1
✖   28:1   This function has too many parameters (4). Maximum allowed is 3.  max-params

from eslint-config-xo.

jamestalmage avatar jamestalmage commented on May 27, 2024

I think 4 then!

Honestly, 4 is pushing it, but might be a nuisance to fail builds over.

Would be nice if you could define rules twice with different severity:

  • warn on 4 parameters
  • error on 5+

from eslint-config-xo.

novemberborn avatar novemberborn commented on May 27, 2024

Rules like these seem rather nebulous. There's best practices for public APIs, and specifics of internal implementations. While I'll accept the argument for the former, this rule can't differentiate with the latter.

from eslint-config-xo.

sindresorhus avatar sindresorhus commented on May 27, 2024

@novemberborn Do you really think it's a good idea to have more than 4 arguments in a function, even if internal?

from eslint-config-xo.

SamVerschueren avatar SamVerschueren commented on May 27, 2024

I agree with 4 being the maximum. Actually I might even prefer 3 but I understand that most devs don't want this restrictive.

from eslint-config-xo.

novemberborn avatar novemberborn commented on May 27, 2024

@sindresorhus most cases? No. I just don't think that's something a linter should enforce. Projects can have sordid histories, code can't always be refactored straight away, etc.

from eslint-config-xo.

sindresorhus avatar sindresorhus commented on May 27, 2024

@novemberborn That applies to pretty much any linter rule though. That's why we have ignore directives.

from eslint-config-xo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.