Almost all types of export statements break jsfmt.
I don't think the issue is with esformatter as it works as expected from CLI. I tried sublime-esformatter also based on esformatter and it formats as expected.
Example (fails both in Sublime and using jsfmt from terminal):
export const foo = Math.sqrt(2);
generates this error in console on save:
JSFMT ==>
Error: /Users/vedran/Library/Application Support/Sublime Text 3/Packages/jsfmt/jsfmt.js:31
throw err;
^
TypeError: Cannot read property 'indexOf' of undefined
at exports._transformNode (/Users/vedran/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/jsfmt/node_modules/esformatter-var-each/lib/esformatter-var-each.js:200:63)
at Array.forEach (native)
at Object.moonwalk (/Users/vedran/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/jsfmt/node_modules/esformatter-var-each/node_modules/rocambole/rocambole.js:414:11)
at Object.exports.transform (/Users/vedran/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/jsfmt/node_modules/esformatter-var-each/lib/esformatter-var-each.js:311:13)
at /Users/vedran/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/jsfmt/node_modules/esformatter/lib/plugins.js:83:26
at Array.forEach (native)
at Object.exec (/Users/vedran/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/jsfmt/node_modules/esformatter/lib/plugins.js:81:12)
at Object.transform (/Users/vedran/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/jsfmt/node_modules/esformatter/node_modules/mout/function/partial.js:15:22)
at transform (/Users/vedran/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/jsfmt/node_modules/esformatter/lib/transform.js:52:11)
at doFormat (/Users/vedran/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/jsfmt/node_modules/esformatter/lib/format.js:130:3)
Most of the other export statements also break jsfmt, though this one works OK:
Almost all types of export statements break jsfmt.
I don't think the issue is with esformatter as it works as expected from CLI. I tried sublime-esformatter also based on esformatter and it formats as expected.
Example (fails both in Sublime and using jsfmt from terminal):
generates this error in console on save:
Most of the other export statements also break jsfmt, though this one works OK: