Indent rule issue regarding object in multiline function parameters
See original GitHub issueWhat 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:
- Created 7 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top 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 >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
@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.
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.