question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enforce indentation in member expressions

See original GitHub issue

I propose adding { "MemberExpression": 1 } to the indent option.

Example of incorrect code:

foo
.bar
.baz()

foo
    .bar
  .baz()

Examples of correct code:

foo
  .bar
  .baz()

// Any indentation is permitted in variable declarations and assignments.
var bip = aardvark.badger
                  .coyote

A small change, but adds more consistency.

Rule: http://eslint.org/docs/rules/indent#memberexpression

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:13
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
glukkicommented, Mar 1, 2017

Please, set it to some value!

Different code editors have different default settings for chain indentation when you run their code reformat tool. Lines jump left-right without any rule, and git history gets messed (like in my current project 😢 ).

1reaction
ferosscommented, Feb 19, 2018

🗣 Standard 11 is released! Run npm install standard@latest --save-dev to update to the latest version. This will also update the version in package.json

Changelog: https://github.com/standard/standard/blob/master/CHANGELOG.md#1100---2018-02-18

Read more comments on GitHub >

github_iconTop Results From Across the Web

enforce consistent indentation (indent) - ESLint - Breword 文档集合
"FunctionDeclaration" takes an object to define rules for function declarations. ... "FunctionExpression" takes an object to define rules for function expressions ...
Read more >
Is there a way to enforce indentation in the .log file? Or a script ...
This simple code is working for me. #include<string.h> #include<iostream> #include <fstream> using namespace std; int main(int argc, ...
Read more >
Indentation | IntelliJ IDEA Documentation - JetBrains
Open indentation settings in code style scheme · Click the widget and select Configure Indents for 'Language'. · In the dialog that opens,...
Read more >
Enforce exact 4-spaces indentation with Checkstyle
By default, Checkstyle's indentation check only ensures that your line wrapping indentation is at least 4.
Read more >
indent | typescript-eslint
Enforce consistent indentation. ... indent. danger. We strongly recommend you do not use this rule or any other formatting linter rules.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found