Skip to content

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

@gkoberger

Description

@gkoberger

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions