Indent with only one object
See original GitHub issueeslint version 1.1.0
Code example:
// Case 1
var object = { // Legal
x: 2,
y: 3
};
// Case 2
var object2 = { // Not legal
x: 2
};
// Case 3
var object3 = { // Legal
x: 2
},
variable;
Rules:
"one-var": [2, "always"],
"indent": [2, 2, {"SwitchCase": 1, "VariableDeclarator": 2}]
eslint Output:
7:7 error Expected indentation of 2 characters but found 6 indent
Case 2 should be legal
<bountysource-plugin>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 8 years ago
- Comments:29 (20 by maintainers)
Top Results From Across the Web
How to apply indenting serialization only to some properties?
Currently I'm using JSON.NET's JsonConvert.SerializeObject(object, Formatting, JsonSerializerSettings) method for serialization, but it seems I ...
Read more >Indent the first line of a paragraph - Microsoft Support
To indent the first line of a paragraph, put your cursor at the beginning of the paragraph and press the tab key. When...
Read more >How to indent just the second lines of citations in Google Docs?
To create one: Highlight the citation; Select "Format" in the top menu; Select "Align and Indent" in the drop down; Then click "Indentation...
Read more >Operate on an Indented Block of Lines with vim-indent-object
vim-indent-object is a great Vim plugin that adds an i text object for an indented block of text, very useful in Python! vii...
Read more >All About Indents and Other Paragraph Separators
Choosing the right method to create paragraph separations not only helps with ... line indents, except for the very first line, which does...
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
It’s an accepted bug though, so I wouldn’t say it’s working as intended.
@nzakas this seems related to an issue im trying to patch right now https://github.com/eslint/eslint/issues/4161. Waiting for feedback to proceed on the issue. Id be happy to take a swing at this one as well if the community would like. If you’d like them separate I can tackle this once the other PR is up and ready!
Thanks and let me know how you reccomend proceeding.