Skip to content

function-paren-newline "multiline" errors for single arguments on their own line #9286

@TiddoLangerak

Description

@TiddoLangerak

Tell us about your environment

  • ESLint Version:
    v4.6.1
  • Node Version:
    v8.3.0
  • npm Version:
    v5.3.0

What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint

Please show your full configuration:

Configuration
// relevant section:
"function-paren-newline" : ["error", "multiline"],

What did you do? Please include the actual source code causing the issue.

function foo(
  param1
)

// or

foo(
  "some very long argument that I'd love to have on it's own line"
);

What did you expect to happen?

No errors

What actually happened? Please include the actual, raw output from ESLint.

    1:13  error  Unexpected newline after '('                                 function-paren-newline
    3:1   error  Unexpected newline before ')'                                function-paren-newline
    7:4   error  Unexpected newline after '('                                 function-paren-newline
    9:1   error  Unexpected newline before ')'                                function-paren-newline

Some elaboration: with the multiline setting it is only allowed to have newlines in function parenthesis if there are at least 2 arguments. I would expect it to also accept newlines in function parenthesis for single arguments as well (as long as it's done consistent).

I'm not sure if this is actually a bug or intended behaviour, if it's the latter then an option to allow newlines for single-argument functions would be very welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    archived due to ageThis issue has been archived; please open a new issue for any further discussionworks as intendedThe behavior described in this issue is working correctly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions