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

indent split argument functions #3548

Closed
kentcdodds opened this issue Aug 27, 2015 · 6 comments
Closed

indent split argument functions #3548

kentcdodds opened this issue Aug 27, 2015 · 6 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon

Comments

@kentcdodds
Copy link
Contributor

When my function signature gets long (I realize this is an anti-pattern, but we're working on that), I get some odd indent warnings:

screen shot 2015-08-27 at 9 03 30 am

Here's the code (for copy/paste):

index.js (this is how lots of my code looks like today)

function foo(bar, baz,
             eggs, spam) {
  bar(eggs, baz, spam);
}

foo();

index.passes.js

function foo(bar, baz,
             eggs, spam) {
               bar(eggs, baz, spam); // <-- this is kinda crazy
             } // <-- crazy

foo();

.eslintrc

{
  "rules": {
    "indent": [2, 2]
  }
}

Is there anything I can do to tell ESLint to not care about the fact that the arguments are on multiple lines? Or could I somehow have my arguments on multiple lines in a different way to make it so I still get the indentation of 2?

@eslintbot
Copy link

Thanks for the issue! We get a lot of issues, so this message is automatically posted to each one to help you check that you've included all of the information we need to help you.

Reporting a bug? Please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. The source code that caused the problem
  3. The configuration you're using (for the rule or your entire config file)
  4. The actual ESLint output complete with line numbers

Requesting a new rule? Please be sure to include:

  1. The use case for the rule - what is it trying to prevent or flag?
  2. Whether the rule is trying to prevent an error or is purely stylistic
  3. Why you believe this rule is generic enough to be included

Requesting a feature? Please be sure to include:

  1. The problem you want to solve (don't mention the solution)
  2. Your take on the correct solution to problem

Including this information in your issue helps us to triage it and get you a response as quickly as possible.

Thanks!

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Aug 27, 2015
@BYK
Copy link
Member

BYK commented Aug 27, 2015

This should be fixed with #3467 - just not released yet.

@kentcdodds
Copy link
Contributor Author

Found an answer:

function foo(bar, baz,
             eggs, spam
) {
  bar(eggs, baz, spam);
}

foo();

This is sufficient... Now I just need to refactor a bunch of code :-)

@BYK
Copy link
Member

BYK commented Aug 27, 2015

Now I just need to refactor a bunch of code :-)

Or you can wait for the upcoming release ;)

@kentcdodds
Copy link
Contributor Author

Whoops, race condition with you @BYK. Thanks! Any word on when that next release will be? (As an open source author myself, I'm sorry to be asking that question).

@BYK
Copy link
Member

BYK commented Aug 27, 2015

@kentcdodds - Heh, no problem. Release is a @nzakas question though :)

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

3 participants