Allow MemberExpressions to bump indentation body by one indentation mark
See original GitHub issueWhat rule do you want to change?
indent
Does this change cause the rule to produce more or fewer warnings?
fewer
How will the change be implemented? (New option, new default behavior, etc.)?
More permisive logic.
Please provide some example code that this change will affect:
Currently when I’m using "indent": [ "error", "tab" ]
rule, it will complain about following code:
let x = new Promise( ( resolve, reject ) => {
if ( window.abc ) {// ESLint expects one tab starting from here.
resolve()
} else {
reject();
}
} )// all the way until thils line.
.then(() => {
return 2;
} )
.then(() => {
return 1;
} );
So the request here is to allow indentation to be bumped by one when MemberExpression
is open.
This style makes more readable code in case when assigning to a variable, returning, throwing etc.
What does the rule currently do for this code?
With current ESLint logic it expects the following:
let x = new Promise( ( resolve, reject ) => {
if ( window.abc ) {
resolve()
} else {
reject();
}
} )
.then(() => {
return 2;
} )
.then(() => {
return 1;
} );
What will the rule do after it’s changed?
Allowing following code:
let x = new Promise( ( resolve, reject ) => {
if ( window.abc ) {
resolve()
} else {
reject();
}
} )
.then(() => {
return 2;
} )
.then(() => {
return 1;
} );
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Indentation, indentation, indentation — Coding for Data - 2020 ...
an expression that gives sequence of values followed by. the character : followed by. an indented block of one or more statements. This...
Read more >How to indent a few lines in Markdown markup?
One way to do it is to use bullet points, which allows you specify multiple levels of indentation. Bullet points are inserted using...
Read more >De-indenting blocks of code when everything is ... - GitHub
I expect the whole block of code to first be deindented by 4 spaces, then by the 1 last remaining space. Instead, the...
Read more >Indentation Without Dents - Vimways
Now say that we create a new MATLAB indent plugin in $HOME/.vim/indent/matlab.vim to replace the default one found at $VIMRUNTIME/indent/matlab.
Read more >Circular indentations on leg - Dermstore
My husband has these weird circular indentation on his legs. For years (30 or more) he's had one. It's about 1/2 inch across,...
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
@not-an-aardvark done, thank you for the assistance! 🍺
I think editing the original issue would probably be the best thing to do.