TypeScript - incorrect semicolon added to method with ECMAScript 6 arrow syntax
See original GitHub issueExample of method declaration in a class.
receiveBroadcast = (message: string): void => { this.broadcastMessage = message; };
Prettier added the semicolon at the end of the method. I’ve confirmed this by flipping the semi setting to false and observing the result.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
One line arrow functions without braces - can't have a ...
I get a "Cannot find module" error. But if I remove the semicolon in the arrow function: return <input onChange={event => console. log(event....
Read more >SyntaxError: missing ; before statement - JavaScript | MDN
The JavaScript exception "missing ; before statement" occurs when there is a semicolon ( ; ) missing somewhere and can't be added by...
Read more >ECMAScript 6: arrow functions and method definitions - 2ality
ECMAScript.next will make things easy by introducing two constructs: arrow functions and method definitions. This blog posts explains what ...
Read more >13. Arrow functions - Exploring JS
13.9 FAQ: arrow functions ECMAScript 6 has syntax for functions with a lexical this , so-called arrow functions. However, it does not have...
Read more >semicolon rule false positives with class members with arrow ...
Expected behavior. the semicolon after the initializer expression is not unnecessary if you are requiring semi-colons.
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
You have to put those semi in a case like:
I think it’s not the case with a block statement tho.
Why is that incorrect? This is an assignment expression.