question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`SyntaxError: Unexpected token` for prettier definition

See original GitHub issue

Do you want to request a feature or report a bug? Bug

What is the current behavior? Prettier linting throws an error on recent flow-typed update

script command: "qa::lint": "eslint --ext .jsx --ext .js src tests"

SyntaxError: Unexpected token (5:55)
  3 |
  4 | declare module "prettier" {
> 5 |   declare export type AST = { [key: string]: any, ... };
    |                                                       ^
  6 |   declare export type Doc = {
  7 |     [key: string]: any,
  8 |     ...

If the current behavior is a bug, please provide the steps to reproduce. Run above script cmd and it throws and error.

What is the expected behavior? Linting passes without errors

Local Environment Information https://gist.github.com/NigelGreenway/206fbe6b7c0e3b0004e6edcb9876a054

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
retyuicommented, Aug 2, 2019

@NigelGreenway

Add to you .eslintignore

flow-typed/
0reactions
pascalduezcommented, Aug 2, 2019

Hi @NigelGreenway,

as @retyui said, you should definitely not lint the flow-typed directory.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected token, expected ";" for .css files using Prettier ...
When I am running npm run prettier -- --list-different all of my css files are getting the error SyntaxError: Unexpected token, expected ";" ......
Read more >
SyntaxError: Unexpected token - JavaScript - MDN Web Docs
The JavaScript exceptions "unexpected token" occur when a specific language construct was expected, but something else was provided.
Read more >
Prettier 1.19: Long awaited Vue option, TypeScript 3.7 and ...
Prettier 1.18 SyntaxError: Unexpected token (1:23) > 1 | const addOne = add(1, ?) ... which means Prettier's idempotence rule was broken.
Read more >
Syntax Error : Unexpected Token **RESOLVED** | Codecademy
Pretty sure there are some flaws in my method here; but I can't seem to get past this "Syntax Error: Unexpected Token" error....
Read more >
doctype html unexpected token - You.com | The AI Search ...
The error message indicates a JavaScript syntax error. The code you quoted is XHTML, which is not JavaScript. Trying to treat it as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found