airbnb / airbnb/javascript

Best practice for wrapping function arguments

Open
#532 11 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
148k
Forks
26.6k
PR merge metrics
No merged PRs in 30d

Description

Style guide should advise wrapping function arguments that go over maximum line length.

``` js
function someVeryLongFunctionName(someVeryLongArgumentName1, someVeryLongArgumentName2, someVeryLongArgumentName3) {
// Function body
}
```

or:

``` js
function myFunction(someArg1, someArg2, someArg3, someArg4, someArg5, someArg6, someArg7, someArg8) {
// Function body
}
```

Wrapped:

``` js
function myFunction(someArg1, someArg2, someArg3, someArg4,
someArg5, someArg6, someArg7, someArg8) {
// Function body
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Review the JavaScript style guide's existing guidance on function declarations and line length. Add a recommendation and examples for wrapping long function argument lists, then confirm the guidance clearly covers the shown cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.