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.

Indent rule issue regarding object in multiline function parameters

See original GitHub issue

What version of ESLint are you using? 3.3.1

What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration:

{
    "env": {
        "node": true
    },
    "rules": {
        "indent": ["error", "tab"]
    }
}

What did you do? Please include the actual source code causing the issue. I linted the following code:

"use strict";

var React = require("react");

React.DOM.div({
        className: "row"
    },
    React.createElement("h1"),
    React.createElement("h2"),
    React.createElement("h3"),
    React.createElement("h4")
);

What did you expect to happen? I expected to not have any lint errors.

What actually happened? Please include the actual, raw output from ESLint. I got the following lint errors:

/home/ubuntu/workspace/test.js
  6:3  error  Expected indentation of 1 tab character but found 2   indent
  7:2  error  Expected indentation of 0 tab characters but found 1  indent

✖ 2 problems (2 errors, 0 warnings)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
platinumazurecommented, Aug 30, 2016

@gyandeeps Could we consider trying to enhance this to support the use case in the original post? I’m fairly sure that style is common.

0reactions
not-an-aardvarkcommented, Apr 22, 2017

Thanks for your interest in improving ESLint. Unfortunately, it looks like this issue didn’t get enough support from the team and so I’m closing it. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach consensus after a long time tend to never do it, and as such, we close those issues. This doesn’t mean the idea isn’t interesting, just that it’s not something the team can commit to.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint wrongly indents single-return statement of multiline ...
After I manually ran eslint --fix on the file, I noticed it worked fine, so I found that VSCode has it's own formatter...
Read more >
Code style option to avoid indent for multiline call arguments ...
Use airbnb eslint config; Create function as 1st argument for another function like this: (usual case for React). useEffect(() => { if (!isEmpty(projects)) ......
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 >
Allow line wrapping/indentation rules to follow PSR-12 rules
Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the...
Read more >
Code Conventions for the Java Programming Language - Oracle
Four spaces should be used as the unit of indentation. The exact construction of the indentation (spaces vs. tabs) is unspecified. Tabs must...
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