Javascript ++ Operator get wrong indent
See original GitHub issueDescription
When I use ++, the next line get wrong indent. If I use += 1, or end with ; , the next line is ok.
Input
The code looked like this before beautification:
Actual Output
The code actually looked like this after beautification:
Environment
OS: macOS 10.13
Settings
Example:
"js": {
"brace_style": "collapse-preserve-inline",
"break_chained_methods": false,
"comma_first": false,
"e4x": false,
"jslint_happy": false,
"keep_array_indentation": false,
"keep_function_indentation": false,
"operator_position": "before-newline",
"space_after_anon_function": false,
"space_before_conditional": true,
"space_in_empty_paren": false,
"space_in_paren": false,
"unescape_strings": false,
"preserve_newlines": true,
"max_preserve_newlines": 2
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Incorrect indentation on ternary operator with object literal #4203
I have made a demo similar to the original one to demonstrate the ternary formatting with tabs, which I think could use some...
Read more >Emacs problematic JavaScript indentation - Stack Overflow
When I have parenthesis, and I have to break the expression, Emacs indent like this: this.offices.each(this.addOfficesToMap, this);.
Read more >JS: Indentation and Spacing | CSE 154 Unofficial Style Guide
In JavaScript, each nested statement (e.g., a statement following a "{" brace) should be indented exactly once more than the previous line's indentation....
Read more >Wrong formatting with "indent chained methods" enabled and ...
Wrong formatting with "indent chained methods" enabled and operators · Turn on "indent chained methods" in Editor > Code style > JavaScript >...
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 >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
@Gegoiuty Interesting. Here’s the minimal repro:
js
I don’t know when I’ll have time to look at this but at least we have a good repro vs non-repro example. Thanks!
Thanks! Create a fork, push to a branch there, and PR from there.
On Fri, May 4, 2018, 6:41 AM Oscar Walter notifications@github.com wrote: