Rule to enforce airbnb dangling parameter/argument style
See original GitHub issuePlease describe what the rule should do: Enforce dangling argument and parameter style in functions
What category of rule is this?
- Enforces code style
- Warns about a potential error
- Suggests an alternate way of doing something
- Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
// bad
function foo(bar,
baz,
quux) {
// body
}
// good
function foo(
bar,
baz,
quux,
) {
// body
}
// bad
console.log(foo,
bar,
baz);
// good
console.log(
foo,
bar,
baz,
);
Why should this rule be included in ESLint (instead of a plugin)? It’s a pretty simple style and doesn’t address a specific / esoteric part of JS
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Airbnb JavaScript Style Guide()
Reassigning parameters can lead to unexpected behavior, especially when accessing the arguments object. It can also cause optimization issues, especially in V8.
Read more >Why you should enforce Dangling Commas for Multiline ...
Enforce it with Linting Personally, I prefer ESLint for JavaScript. Fortunately ESLint has the comma-dangle rule which allows you to enforce dangling commas ......
Read more >What rules do the community tend to override? #1089 - GitHub
I'm opening this issue specifically to gather a list of the rules that those in the community feel are controversial or problematic, ...
Read more >Rules - ESLint - Pluggable JavaScript Linter
Disallow duplicate arguments in `function` definitions. Categories: ✓ Extends ... Enforce consistent brace style for all control statements. Categories:.
Read more >Using a Code Style Guide to Enforce Team Best Practices
I'd already been using the Airbnb eslint rule-set, so I read Airbnb's style guide and found it to be an excellent jump-off point....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
What I mean with “fit on one line” is, simply, is on one line. line length is handled by
max-len
, and a separate rule or option(s) could handle pushing single-line over multi-line - i just want to enforce that if it’s single-line, it looks one way, and if it’s not single-line, it looks another.It would also be great if we could enforce
over
when there’s enough space on the line
Note: covered in https://github.com/eslint/eslint/issues/7526