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

JS formatting is too strict #85

Open
joshuahhh opened this issue Mar 27, 2023 · 0 comments
Open

JS formatting is too strict #85

joshuahhh opened this issue Mar 27, 2023 · 0 comments

Comments

@joshuahhh
Copy link
Collaborator

I thought I'd try out JS formatting. However, with the code:

import extractSynonymsProgram from "./extractSynonymsProgram.json";

as a ```js block, I got an error:

file:///Users/joshuah/Documents/coding/living-papers/node_modules/acorn/dist/acorn.mjs:3454
  var err = new SyntaxError(message);
            ^

SyntaxError: Unexpected token (1:7)
    at pp$4.raise (file:///Users/joshuah/Documents/coding/living-papers/node_modules/acorn/dist/acorn.mjs:3454:13)
    at CellParser.unexpected (file:///Users/joshuah/Documents/coding/living-papers/node_modules/@observablehq/parser/src/parse.js:207:10)
    at pp$9.expect (file:///Users/joshuah/Documents/coding/living-papers/node_modules/acorn/dist/acorn.mjs:749:26)
    at CellParser.parseImportSpecifiers (file:///Users/joshuah/Documents/coding/living-papers/node_modules/@observablehq/parser/src/parse.js:68:10)
    at CellParser.parseImport (file:///Users/joshuah/Documents/coding/living-papers/node_modules/@observablehq/parser/src/parse.js:55:28)
    at CellParser.parseCell (file:///Users/joshuah/Documents/coding/living-papers/node_modules/@observablehq/parser/src/parse.js:131:19)
    at CellParser.parseTopLevel (file:///Users/joshuah/Documents/coding/living-papers/node_modules/@observablehq/parser/src/parse.js:180:17)
    at CellParser.parse (file:///Users/joshuah/Documents/coding/living-papers/node_modules/acorn/dist/acorn.mjs:584:15)
    at CellParser.parse (file:///Users/joshuah/Documents/coding/living-papers/node_modules/acorn/dist/acorn.mjs:634:35)
    at parseCell (file:///Users/joshuah/Documents/coding/living-papers/node_modules/@observablehq/parser/src/parse.js:22:23) {
  pos: 7,
  loc: Position { line: 1, column: 7 },
  raisedAt: 29
}

I suppose living papers is trying to parse my code with Observable's parser? Doesn't surprise me that my code isn't runnable. But I just want to format it.

(Maybe there's an option for this already?)

P.S. no worries with this issue; I don't really need colored code for my paper.

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