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

Set default "config_precendence" to "file-override" #160

Merged
merged 1 commit into from
Feb 23, 2019
Merged

Set default "config_precendence" to "file-override" #160

merged 1 commit into from
Feb 23, 2019

Conversation

shuLhan
Copy link
Contributor

@shuLhan shuLhan commented Nov 9, 2018

If user have custom file type plugin that set "parser" option, calling
":Prettier" will return error "Prettier: failed to parse buffer".

This was caused by running prettier with CLI option "--parser X" with
"--config-precedence prefer_file" will cause prettier to ignore the
"parser" option.

@mitermayer
Copy link
Member

I would like to investigate prettier cli itself. It sounds like a regression. Note that https://prettier.io/docs/en/cli.html#config-precedence

prefer-file
If a config file is found will evaluate it and ignore other CLI options. If no config file is found CLI options will evaluate as normal.
This option adds support to editor integrations where users define their default configuration but want to respect project specific configuration.

@mitermayer
Copy link
Member

mitermayer commented Feb 18, 2019

file-override will be the default behaviour on release/1.x but will test this PR. If it works I may merge it sooner in order to dogfood any potential issues prior to release

@mitermayer
Copy link
Member

Also please note that on release/1.x we do not have a default 'parser' and do not pass parsers based on filetype! So that above issue should not occur.

Would you mind testing the release/1.x branch to see if your above problem is fixed ?

You can test that branch by adding to your .vimrc

Plug 'prettier/vim-prettier', {
  \ 'do': 'yarn install',
  \ 'branch': 'release/1.x',
  \ 'for': [
    \ 'javascript',
    \ 'typescript',
    \ 'css',
    \ 'less',
    \ 'scss',
    \ 'json',
    \ 'graphql',
    \ 'markdown',
    \ 'vue',
    \ 'lua',
    \ 'php',
    \ 'python',
    \ 'ruby',
    \ 'html',
    \ 'swift' ] }

@shuLhan
Copy link
Contributor Author

shuLhan commented Feb 22, 2019

Still does not work. I will create new issue to describe the problem in detail.

If user have custom file type plugin that set "parser" option, calling
 ":Prettier" will return error "Prettier: failed to parse buffer".

This was caused by running prettier with CLI option "--parser X" with
"--config-precedence prefer_file" will cause prettier to ignore the
"parser" option.

Fix #178
@shuLhan shuLhan changed the base branch from master to release/1.x February 23, 2019 00:07
@mitermayer mitermayer merged commit 5debe18 into prettier:release/1.x Feb 23, 2019
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

Successfully merging this pull request may close these issues.

2 participants