space_after_named_function not working inside an ES6 class
See original GitHub issueDescription
space_after_named_function not working inside an ES6 class. I don’t know if this is the indented behaviour or not, but it was not what I was expecting
Input
The code looked like this before beautification:
class blah {
constructor() {
this.doStuff()
}
doStuff() {
console.log("stuff")
}
}
function test() {}
Expected Output
The code should have looked like this after beautification:
class blah {
constructor () {
this.doStuff()
}
doStuff () {
console.log("stuff")
}
}
function test () {}
Actual Output
The code actually looked like this after beautification:
class blah {
constructor() {
this.doStuff()
}
doStuff() {
console.log("stuff")
}
}
function test () {}
Steps to Reproduce
Run on https://beautifier.io/
Environment
https://beautifier.io/ Also, ubuntu 18.10
Settings
Example:
{
"indent_size": "2",
"indent_char": " ",
"max_preserve_newlines": "5",
"preserve_newlines": true,
"keep_array_indentation": false,
"break_chained_methods": false,
"indent_scripts": "normal",
"brace_style": "collapse",
"space_before_conditional": true,
"unescape_strings": false,
"jslint_happy": false,
"end_with_newline": false,
"wrap_line_length": "0",
"indent_inner_html": false,
"comma_first": false,
"e4x": true,
"space_after_anon_function": true,
"space_after_named_function": true
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
javascript - Why is "this" in an ES6 class not implicit?
I know that ES6 solved a lot of problems that existed with the this keyword in ES5, such as arrow functions and classes....
Read more >Classes - JavaScript - MDN Web Docs
Classes are a template for creating objects. They encapsulate data with code to work on that data. Classes in JS are built on...
Read more >As a JS Developer, This Is What Keeps Me Up at Night
The answer here is there isn't one. These do effectively the same thing, it's only a question of whether ES6 class syntax was...
Read more >15. Classes
Under the hood, ES6 classes are not something that is radically new: They mainly ... not become a variable outside of the class,...
Read more >An Overview of ES6 Classes
In this article, I'll provide an overview of how classes work in ... TypeError: Class constructor MyClass cannot be invoked without 'new' ...
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
Turns out this was in the 1.14.4 - released today.
Yup, not fixed.