Invalid syntax output when a
See original GitHub issueWhen prettier v0.14.1 is executed on the following code:
var obj = {
// comment here
};
It converts it to this, causing a syntax error:
var obj = {
// comment here};
I use this pattern in example js files where I describe a function’s options object and default values, without actually specifying any. For example:
var textToSpeech = new TextToSpeechV1({
// if left unspecified here, the SDK will fall back to the TEXT_TO_SPEECH_USERNAME and TEXT_TO_SPEECH_PASSWORD
// environment properties, and then Bluemix's VCAP_SERVICES environment property
//username: 'INSERT YOUR USERNAME FOR THE SERVICE HERE',
//password: 'INSERT YOUR PASSWORD FOR THE SERVICE HERE'
});
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Invalid Syntax in Python: Common Reasons for SyntaxError
If the interpreter can't parse your Python code successfully, then this means that you used invalid syntax somewhere in your code. The interpreter...
Read more >Python print statement “Syntax Error: invalid syntax” [duplicate]
In Python 3 print "Hello world" gives invalid syntax error. To display string content in Python3 have to use this ("Hello world") brackets....
Read more >How to Fix Invalid SyntaxError in Python - Rollbar
The Python SyntaxError occurs when the interpreter encounters invalid syntax in code. When Python code is executed, the interpreter parses ...
Read more >SyntaxError in Python: How to Handle Invalid Syntax in Python
In this tutorial, I will teach you how to handle SyntaxError in Python, including numerous strategies for handling invalid syntax in Python.
Read more >SyntaxError: invalid syntax - Python Morsels
Python's "invalid syntax" error message comes up often, especially when you're first learning Python. What usually causes this error and how can you...
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 Free
Top 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
And, it’s live
I’m going to close this, as the original issue has been fixed!