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

Confused by file type overrides #60

Closed
michaeljones opened this issue Oct 3, 2017 · 3 comments · Fixed by #61
Closed

Confused by file type overrides #60

michaeljones opened this issue Oct 3, 2017 · 3 comments · Fixed by #61
Assignees
Labels

Comments

@michaeljones
Copy link

Thanks for writing the plugin. Keen to start using it but I've just had a very confusing 30 mins whilst I tried to figure out why vim-prettier seemed to be ignoring my prettier project config file.

I feel that the README indicates that prettier defaults to 'prefer-file'. But in order to get that behaviour when using typescript I have to delete these lines:

let b:prettier_ft_default_args = {
\ 'parser': 'typescript',
\ 'configPrecedence': 'cli-override',
\ }

Though I've used vim for a long time, I'm one of those that has never really learnt even the basics of vim script so I'm not sure how to override that setting myself.

Hope this is a reasonable concern to raise. I'm sure I could work around it if I knew more about vim but it seems confusing behaviour to start with. Maybe I'm missing something basic. It wouldn't be the first time I've missed something in the docs.

Thanks for the project though :)

@mitermayer
Copy link
Member

Hi @michaeljones,

Thank you for this message, the reason why I had to manually add cli-override was due to this issue prettier/prettier#2946, but now that I just noticed prettier release 1.7.4 I should be able to properly fix this in vim-prettier.

I will be working on this issue now and do a release for it soon, once release it should just work with your project file without needing any configuration

@mitermayer
Copy link
Member

Hi @michaeljones,

I have just done a release with this fix, please upgrade your vim-prettier plugin. It should work now as you expected assuming the project you work on is using prettier 1.7.4+

@michaeljones
Copy link
Author

Wow, thanks for such a quick resolution @mitermayer! Updating now :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants