Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Error Parsing CodeMirror #16

Open
twigz20 opened this issue May 16, 2018 · 0 comments
Open

Syntax Error Parsing CodeMirror #16

twigz20 opened this issue May 16, 2018 · 0 comments

Comments

@twigz20
Copy link

twigz20 commented May 16, 2018

We're integrating precise-commits into our project and running into a failure when we try and commit our files:

√  [489/960] Processing file: src/editor/src/thirdparty/CodeMirror/addon/comment/comment.js
×  precise-commits: An Error occurred

{ SyntaxError: Unexpected token (1:9)
> 1 | function(mod) {
    |         ^
  2 |     if (typeof exports == "object" && typeof module == "object") // CommonJS
  3 |       mod(require("../../lib/codemirror"));
  4 |     else if (typeof define == "function" && define.amd) // AMD
    at createError (D:\Programming\WebDev\next\node_modules\prettier\parser-babylon.js:1:110)
    at Object.parse (D:\Programming\WebDev\next\node_modules\prettier\parser-babylon.js:1:170100)
    at Object.parse$3 [as parse] (D:\Programming\WebDev\next\node_modules\prettier\index.js:23660:19)
    at formatWithCursor (D:\Programming\WebDev\next\node_modules\prettier\index.js:29344:27)
    at format (D:\Programming\WebDev\next\node_modules\prettier\index.js:29389:10)
    at formatRange (D:\Programming\WebDev\next\node_modules\prettier\index.js:29626:26)
    at formatWithCursor (D:\Programming\WebDev\next\node_modules\prettier\index.js:29348:30)
    at format (D:\Programming\WebDev\next\node_modules\prettier\index.js:29389:10)
    at Object.format (D:\Programming\WebDev\next\node_modules\prettier\index.js:29649:12)
    at D:\Programming\WebDev\next\node_modules\precise-commits\lib\precise-formatters\prettier.js:42:64
  loc: { start: { line: 1, column: 9 } },
  codeFrame: '> 1 | function(mod) {\n    |         ^\n  2 |     if (typeof exports == "object" && typeof module == "object") // CommonJS\n  3 |       mod(require("../../lib/codemirror"));\n  4 |     else if (typeof define == "function" && define.amd) // AMD' }



husky > pre-commit hook failed (add --no-verify to bypass)

The file that's causing this is: comment.js

When we've tried running prettier on the file by itself it seems to work.
All of the following versions of prettier work stand-alone.

I'm not sure where the bug is, but I wanted to file with you to get some help because I'm stuck. It certainly looks like precise-commits is involved or the version of prettier it's using is involved.

cc @dsych

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant