prettier / vim-prettier

A Vim plugin for Prettier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prettier config commands not working properly.

whal-e3 opened this issue · comments

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

What is the current/expected behavior?
current behavior

Only when I add both these commands in init.vim
let g:prettier#autoformat = 1
let g:prettier#autoformat_require_pragma = 0
Prettier works (with and without @format or @prettier tags).
And If at least one of those is commented out or deleted, prettier stops working.

What version of vim-prettier are you using - (output of :PrettierVersion) ?
1.0.0-beta

What version of prettier are you using - (output of :PrettierCliVersion) ?
2.3.1

What is your prettier executable path - (output of :PrettierCliPath) ?
/Users/ericwhale/.config/nvim/plugged/vim-prettier/node_modules/.bin/prettier

Did this work in previous versions of vim-prettier and/or prettier ?
This is my first time using vim-prettier.

In my case, prettier is not formating TS files by default on save. Only when I add @format comment to the file.
Changing g:prettier#autoformat_require_pragma variable makes no difference.

Also using 1.0.0-beta tag.

Update: sorry, above is the mistake in my configuration, g:prettier#autoformat_require_pragma is working to me as expected.

Not sure why, but the following conditions didn't work:

if match(&runtimepath, 'vim-prettier') != -1
  let g:prettier#autoformat = 1
  let g:prettier#autoformat_require_pragma = 0
endif