Closed ghost closed 6 years ago
Is there an ESLint rule for that? Otherwise you'll need to request it on the ESLint issue tracker.
Apparently there is not, as I was unable to find one in the ESLint documentation (v2.11.1).
Unfortunately, according to the ESlint contributing guide page, to request a new rule and for it to be accepted, you also need to be the one to create and maintain it. Currently I would be unable to do that.
Wouldn't that be the case to create a custom rule for this configuration?
to request a new rule and for it to be accepted, you also need to be the one to create and maintain it.
That's not entirely correct. Open an issue and if there's merit to the idea, someone will come along and implement it.
I just found that a parameter indentation rule is currently being evaluated by ESLint members. So it's just a question of time now.
The indent rule has been updated to be more configurable.
I found this repo while tweaking eslint configs for Google style. If you're still updating it, here's what I'm using for indentation so far:
"indent": [
"error", 2, # Google use 2-space indents
# Google uses +4 space indents for line continuations.
{
"SwitchCase": 1,
"MemberExpression": 2,
"FunctionDeclaration": {
"body": 1,
"parameters": 2
},
"FunctionExpression": {
"body": 1,
"parameters": 2
},
"CallExpression": {
"arguments": 2
},
# Ignore default rules for ternary expressions.
"ignoredNodes": ["ConditionalExpression"]
}
],
I haven't sorted out what version of the Object Expression rule applies.
Thanks for providing that snippet, @rachel-fenichel! I've added an object expression rule and submitted a PR: #50.
Closing now that #50 is merged.
According to the Google JavaScript Style:
This ESLint configuration (version 0.5.0) does not enforce that indentation. No warning is throw when I use less or more indentation in line-wrapped function arguments. By comparison the Closure Linter does this. It also throws indentation warnings on line-wrapped variable initializations and method chaining, which this ESLint configuration also does not enforce.