Rule Enhancement Proposal: indent and multiline parameters.
See original GitHub issueFrom requireAlignedMultilineParams.
JSCS has the rule to align parameters vertically. I think this is a responsibility of indent rule.
{
"indent": ["error", 4, {
"FunctionDeclaration": {
"parameters": "first", // or an integer
"body": 1
},
"FunctionExpression": {
"parameters": "first", // or an integer
"body": 1
}
}]
}
Those options are similar to existing SwitchCase
and VariableDeclarator
options.
But "parameters": "first"
is special.
If "parameters": "first"
is specified, 2nd line of parameters and later will be aligned with the same column as the first parameter item.
/*eslint indent: ["error", 4, {"FunctionDeclaration": {"parameters": "first"}}]*/
function foo(aaa, bbb,
ccc, ddd) {
doSomething();
}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:14 (11 by maintainers)
Top Results From Across the Web
PEP 8 – Style Guide for Python Code
Python Enhancement Proposals (PEPs) ... Python disallows mixing tabs and spaces for indentation. ... Pick a rule and stick to it.
Read more >PEP8 — Python Enhancement Proposal | Analytics Vidhya
PEP-8 or the Python Enhancement Proposal presents some of the key points that you can use to make your code more organized and...
Read more >Nim Enhancement Proposal #1 - Standard Library Style Guide
This enhancement proposal aims to list a series of guidelines that the standard library should follow. Note that there can be exceptions to...
Read more >indent - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Manual :: Split function call on several lines
The CS require lines to have a maximum length of 80 chars. Calling functions or methods with many parameters while adhering to CS...
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 FreeTop 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
Top GitHub Comments
@eslint/doctrine-team we need three 👍s and a champion right? I can champion this and giving my 👍. 2 more to go I guess?
It looks like with the current behavior, the indentation of function parameters isn’t checked at all:
So we should only check parameter indentation if the user explicitly includes the
parameters
option.