royriojas / esformatter-jsx

esformatter plugin: format jsx files (or js files with Facebook React JSX Syntax)
MIT License
142 stars 25 forks source link

SyntaxError: Unexpected token, expected ; #108

Open Kenshin-liu opened 7 years ago

Kenshin-liu commented 7 years ago

SyntaxError: Unexpected token, expected ; (1:8) at Parser.pp$5.raise (/Users/zrone/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/esformatter-jsx/node_modules/babylon/lib/index.js:4246:13) at Parser.pp.unexpected (/Users/zrone/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/esformatter-jsx/node_modules/babylon/lib/index.js:1627:8) at Parser.pp.semicolon (/Users/zrone/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/esformatter-jsx/node_modules/babylon/lib/index.js:1608:38) at Parser.pp$1.parseExpressionStatement (/Users/zrone/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/esformatter-jsx/node_modules/babylon/lib/index.js:2103:8) at Parser.parseExpressionStatement (/Users/zrone/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/esformatter-jsx/node_modules/babylon/lib/index.js:5240:20) at Parser.pp$1.parseStatement (/Users/zrone/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/esformatter-jsx/node_modules/babylon/lib/index.js:1779:17) at Parser.parseStatement (/Users/zrone/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/esformatter-jsx/node_modules/babylon/lib/index.js:5218:22) at Parser.pp$1.parseBlockBody (/Users/zrone/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/esformatter-jsx/node_modules/babylon/lib/index.js:2133:21) at Parser.pp$1.parseTopLevel (/Users/zrone/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/esformatter-jsx/node_modules/babylon/lib/index.js:1645:8) at Parser.parse (/Users/zrone/Library/Application Support/Sublime Text 3/Packages/jsfmt/node_modules/esformatter-jsx/node_modules/babylon/lib/index.js:1537:17)

lopezdp commented 5 years ago

any luck or what?

royriojas commented 5 years ago

I'm sorry can you provide a bit more of details for this one?

In any case you might want to try prettier https://prettier.io/ as an option

lopezdp commented 5 years ago

I solved this in my jsfmt.sublime-settings file by adding the semicolon plugin to the array below:

// plugins included
    "plugins": [
      "esformatter-jsx",
      // "esformatter-quotes",
      "esformatter-semicolons",
    // "esformatter-braces",
    // "esformatter-dot-notation"
    ],