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

Prettier config commands not working properly. #309

Open
whal-e3 opened this issue Aug 4, 2021 · 1 comment
Open

Prettier config commands not working properly. #309

whal-e3 opened this issue Aug 4, 2021 · 1 comment

Comments

@whal-e3
Copy link

whal-e3 commented Aug 4, 2021

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.

@mrded
Copy link

mrded commented Jan 5, 2022

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

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

2 participants