Edit: Fixed!
The Google Apps Script team rolled this out for our team earlier this week (week of January 10th).
Original Post
I'm a frequent GAS user, and I've noticed that, since the upgrade to the V8 runtime, formatting in the GAS IDE is awful. I've seen a somewhat similar question here, but my problem is that the GAS IDE is terrible at formatting ES6 Javascript.
Expected Behavior
- variables defined with
const
orlet
appear similarly to variables defined withvar
- the omission of a semicolon will not completely break the indention / formatting of a script
- destructured variables will be recognized as variables by the IDE
- template literals will be recognized by the IDE
Current Behavior
The IDE basically doesn't recognize any of my JavaScript ES6 syntax. Here's an example:
/** Comments about some function.
* @dev Why does this look like garbage!?
*/
function foo() {
...
}
In the above example, it's impossible to get the IDE to properly indent the function. Instead, each line of code is indented to the same extent by default.
Has anyone figured out how to use ES6 syntax, omit semicolons, etc. and gotten the browser-based GAS IDE to format properly?
Thanks!