Proposal: "first" option for `indent/MemberExpression`
See original GitHub issueTell us about your environment
- ESLint Version: 4.8.0
- Node Version: 8.6.0
- npm Version: yarn-1.1.0
What parser (default, Babel-ESLint, etc.) are you using? default
What rule do you want to change? indent
Does this change cause the rule to produce more or fewer warnings? nope
How will the change be implemented? (New option, new default behavior, etc.)?
Option { "MemberExpression": "first" }
will allow member expressions to be indented just as the first member expression.
Please provide some example code that this change will affect:
foo.bar
.baz
.qux
What does the rule currently do for this code?
Depends on configuration, but .baz
& .qux
are indented by fixed number of spaces.
What will the rule do after it’s changed?
.baz
& .qux
will be indented as shown, i. e. dots before member name will be on the same column.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:29 (17 by maintainers)
Top Results From Across the Web
Which ESLint rule applies to Promise/Arrow function indent?
Which indent rule object option does apply here (has to be changed) as I want to keep the indentation as is? I don't...
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 >jscodeshift example | Better world by better software
We just use it as the first argument (the target object) to the j.memberExpression . The transformation prints the result: require('./calc').add ...
Read more >@babel/plugin-transform-member-expression-literals | Yarn
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >Attribution - Sandtime.io
... @babel/plugin-proposal-json-strings · @babel/plugin-proposal-logical-assignment-operators ... @babel/plugin-transform-member-expression-literals ...
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
About the simplest cases:
or
it seems to me that
1)
is the most used case, and that if the alignment should be on the very first dot, then2)
could/should be reformatted to:Sounds good to me. I’ll champion.
@eslint/eslint-team Any 👍s for this proposal?