Change indentation of arrow function in Javascript
Hi
which JavaScript formatting option do I have to modify to instead of this formatting result:
client
.setClaimForUser({ userId, claim })
.then(() => {
return resolve(true);
},
err => reject(err));
get this one:
client
.setClaimForUser({ userId, claim })
.then(() => {
return resolve(true);
},
err => reject(err));
Thanks
Please sign in to leave a comment.
No, it's not possible. The motivation for not placing a callback at the same level as function call in this case was to be consistent with regular parameters: when wrapped, they are always indented
doesn't look good, does it?
I was fine with this indentation until I ran into an issue with the ESLint "indent" rule yesterday.
I asked at Stackoverflow and some people think the ESLint rule is right and my indentation based on WebStorm is wrong:
https://stackoverflow.com/questions/44271554/which-eslint-rule-applies-to-promise-arrow-function-indent
I think ESLint handles the mentioned param issue with another rule option so it can differentiate between callbacks and params.
Has there been any resolve here? I too am experiencing the same problem as Alexander.