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

Vim-Prettier is using its own defaults, not the defaults from prettier (in my case, trailingComma) #353

Open
gkoberger opened this issue Jan 11, 2024 · 1 comment

Comments

@gkoberger
Copy link

gkoberger commented Jan 11, 2024

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

A bug

What is the current/expected behavior?

When I run vim-prettier, trailingComma is using 'es5' rather than 'all'. In 3.0.0, prettier switched the default from es5->all.

However, for some reason prettier.vim (line 125) decided to override it: https://github.com/prettier/vim-prettier/blob/master/plugin/prettier.vim#L134

This line is the problem:

let g:prettier#config#trailing_comma = get(g:,'prettier#config#trailing_comma', 'es5')

It doesn't seem to be loading the actual prettier#config#trailing_comma from prettier, so it always goes with the "default" provided in that file.

If I change es5 to all on that line, everything works (although ideally I wouldn't do it there, of course, and it would load the proper defaults from the prettier version)

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

1.0.0

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

3.1.1

What is your prettier executable path - (output of :PrettierCliPath) ?

/Users/gkoberger/.nvm/versions/node/v18.18.2/bin/prettier

Did this work in previous versions of vim-prettier and/or prettier ?

Sort of. It worked because prettier hadn't yet changed the default for trailingComma. Once prettier switched the default, however, it started to be overridden by vim-prettier

@gkoberger gkoberger changed the title Vim-Prettier is using its own defaults, not the defaults from prettier (specifically, trailingComma) Vim-Prettier is using its own defaults, not the defaults from prettier (in my case, trailingComma) Jan 11, 2024
@twm
Copy link

twm commented Aug 28, 2024

Do you have let g:prettier#config#config_precedence='prefer-file' in your config?

See #266 (comment)

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