Vim-prettier: Unexpected token @

Created on 31 Jan 2018  Â·  7Comments  Â·  Source: prettier/vim-prettier

The prettier throw a exception when use the decorator.
enviroment: js with babel-env.

triage

Most helpful comment

@Luobata are you sure you want to use the flow parser which is the default in vim-prettier, but not the default in prettier?

It's likely that you want to add this to your .vimrc

let g:prettier#config#parser = 'babylon'

All 7 comments

Hi @Luobata ,

Thank you for submitting this issue, in order for me to better assist / debug this problem could you please provide me some more info on:

the resolved prettier cli version:

:PrettierCliVersion

the prettier executable path:

:PrettierCliPath

vim prettier version

:PrettierVersion

Other information is the extension of the file you were editing while running that command.

thanks a lot!

Could you also provide me the steps you did in other to encounter this issue ? Also does the prettier CLI for your project works on the file by ‘./node_modules/.bin/prettier yourfile’ ?

Not sure whAt issue you may be facing but worth checking on prettier itself https://github.com/prettier/prettier/issues/759 in the past the flow parser had some issues with decorators

@Luobata are you sure you want to use the flow parser which is the default in vim-prettier, but not the default in prettier?

It's likely that you want to add this to your .vimrc

let g:prettier#config#parser = 'babylon'

I am closing this issue since I cannot reproduce and did not have enough information to do so, please feel free to comment or reopen this issue if you can add some more information around it

@nelsyeung 3q! It work and solve my problem.

@mitermayer thanks for your support and sorry not leave enough information, and the problem was resolved by add
let g:prettier#config#parser = 'babylon'

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sleeplesslord picture sleeplesslord  Â·  8Comments

mitermayer picture mitermayer  Â·  5Comments

gko picture gko  Â·  5Comments

cdimitroulas picture cdimitroulas  Â·  5Comments

yshuman1 picture yshuman1  Â·  6Comments