You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, after searching I saw other issues causing this error string, caused by syntax errors or incomplete expressions passed to the engine. I'm observing it when saving a css file.
I have installed prettier with Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
I have configured prettier with:
augroup js
autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue PrettierAsync
au FileType js,html nmap <Leader>d :TernDef<CR>
au FileType js,html nmap <Leader>r :TernRename<CR>
let g:prettier#autoformat = 0
let g:prettier#config#single_quote = 'false'
let g:prettier#config#print_width = 120
let g:prettier#config#parser = 'babylon'
augroup END
Thanks for submitting this issue, could you please provide me a bit more information in order for me be able to help debugging your issue ?
can you please provide me the output of the commands
:PrettierVersion
:PrettierCliVersion
:PrettierCliPath
Also can you try commenting out that line from your .vimrc:
from:
letg:prettier#config#parser ='babylon'
to:
" let g:prettier#config#parser = 'babylon'
I wonder if you are using an older combination of vim-prettier and/or prettier CLI. Also it could be a bug where prettier is giving more precedence to the passed parser as opposed to the lang one.
I think if you can provide the above information I will be able to better understand what is happening and if it is a bug or just incompatible usage of prettier versions
:PrettierVersion
0.2.6
:PrettierCliVersion
Usage: prettier [opts] [filename ...]^@^@Available options:^@ --write Edit the file in-place (beware!)^@ --stdin Read input from
stdin^@ --print-width <int> Specify the length of line that the printer will wrap on. Defaults to 80.^@ --tab-width <int> Specify the number of spaces
per indentation-level. Defaults to 2.^@ --flow-parser Use the flow parser instead of babylon^@ --single-quote Use single quotes instead of dou
ble^@ --trailing-comma Print trailing commas wherever possible^@ --bracket-spacing Put spaces between brackets. Defaults to true, set false to turn
off^@
:PrettierCliPath
prettier
😂
All good after yarn global add prettier installed 1.11.1.
Hi, after searching I saw other issues causing this error string, caused by syntax errors or incomplete expressions passed to the engine. I'm observing it when saving a css file.
I have installed prettier with
Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
I have configured prettier with:
The file I'm saving,
foo.css
::messages
shows "Prettier: failed to parse buffer."Should Prettier succeed in parsing/formatting this CSS file?
The text was updated successfully, but these errors were encountered: