[indent] Add support for emacs-style indentation of MemberExpression
s
#1540
Labels
external
This issue is with another package, not typescript-eslint itself
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Uh oh!
There was an error while loading. Please reload this page.
Repro
Expected Result
I would like an option that would keep the indentation the same as in my example code, which is what emacs does (I believe it's a function called
typescript--proper-indentation
in thetypescript-mode
major mode).Actual Result
Currently my options are limited to specifying an absolute number of indentation levels, or turning the
MemberExpression
rule off. With the default value of1
, the code above gets "fixed" as:This is actually harmful, since the
.map
now lines up with the second.then
as if.map
were chained tocy.wrap
instead ofdataStore.getUsers()
.Changing
MemberExpression
to a higher number doesn't help either since it will continue indenting the second.then
as well, maintaining the false alignment.Currently my only option is to use
"off"
forMemberExpression
, but then I don't get any enforcement.I have similar issues with the ClassProperty and AssignmentPattern AST nodes but that's probably worth discussing in a separate issue (actually, looks like the ClassProperty issue already exists: #549)
I saw an old eslint proposal for adding support for a
"first"
option for theMemberExpression
rule (eslint/eslint#9383), but that doesn't seem to quite match what I'm looking for--none of the examples in the long thread there seem to cover my example above.Additional Info
N/A (new feature request, not a problem with an existing rule)
Versions
@typescript-eslint/eslint-plugin
2.17.0
@typescript-eslint/parser
2.17.0
TypeScript
3.5.3
ESLint
6.8.0
node
13.7.0
npm
6.13.6
The text was updated successfully, but these errors were encountered: