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

Ignored unknown option: --config-precedence #53

Closed
dnmct opened this issue Sep 17, 2017 · 19 comments
Closed

Ignored unknown option: --config-precedence #53

dnmct opened this issue Sep 17, 2017 · 19 comments

Comments

@dnmct
Copy link

dnmct commented Sep 17, 2017

I get this error one every save

This is the configuration in my vimrc file:

let g:prettier#config#print_width = 120
let g:prettier#config#bracket_spacing = 'false'
let g:prettier#quickfix_enabled = 1
let g:prettier#autoformat = 0
autocmd BufWritePre .js,.jsx,.mjs,.ts,.tsx,.css,.less,.scss,.json,.graphql Prettier

@kahl-dev
Copy link

You need to update your global prettier to the latest version.

@dnmct
Copy link
Author

dnmct commented Sep 17, 2017

Done that already it's 1.7.0

@kahl-dev
Copy link

Do you use nvm?

@dnmct
Copy link
Author

dnmct commented Sep 17, 2017

you mean node version manager?

@kahl-dev
Copy link

Yes

@dnmct
Copy link
Author

dnmct commented Sep 17, 2017

no i dont

@kahl-dev
Copy link

Did you updated vim-prettier. They released a new version three days ago.

@dnmct
Copy link
Author

dnmct commented Sep 17, 2017

yep

@mitermayer
Copy link
Member

mitermayer commented Sep 17, 2017

@damcatee the prettier CLI resolution will first look for local prettier installed on your project, then will look on the global one and if nothing is found will check on the vim-prettier installation directory.

Could you please check the following:

1 - are you running prettier in a folder of a project that have would have a node_modules directory somewhere along the parent ancestry? If any is found can you check the version for it ?

2 - confirm that prettier is installed globally and is accessible and is of Version 1.7+

3 - if no prettier is found globally go to your 'vim-prettier' installation directory and do either 'npm install' or 'yarn install'

If your are on a unix system you can also run locate "bin/prettier" to search for bin installations to help investigating where is the old prettier executable

@mitermayer
Copy link
Member

mitermayer commented Sep 17, 2017

Since you have mentioned that you have prettier installed globally it's most likely that along the parent ancestry of where you started your vim session you will find a node_modules folder that have an older version of prettier

@mitermayer
Copy link
Member

Hi @danmcatee,

To avoid confusion I have just done a new vim-prettier release 0.1.1 which adds some new commands that can help debugging this issue:

  • :PrettierVersion - prints the vim-prettier plugin version
  • :PrettierCli <q-args> - send commands to the resolved prettier cli
  • :PrettierCliPath - check what is the resolved prettier cli path
  • :PrettierCliVersion - check what is the resolved prettier cli version

To further debug this issue I recomend the following steps:

  1. Update to the new version of vim-prettier
  2. Run the command :PrettierCliVersion to check the version of your prettier resolved CLI.
  3. Run the command :PrettierCliPath to check where is the installation of your prettier resolved CLI.

Please let me know if that helps resolving your issue

@mitermayer
Copy link
Member

Hi @danmcatee,

Will close this issue for now, if you feel like the above commands have no helped you identify the problem please feel free to re-open it.

@samumist
Copy link

I had the same problem that's due to a local installed version (version 1.3) of the project though my global version is the latest (1.7). Once I updated the local version to the latest, the problem is solved.

@mitermayer mitermayer moved this from Backlog to Approved in vim-prettier 1.0 Sep 22, 2017
@mitermayer mitermayer moved this from Approved to Merged in vim-prettier 1.0 Sep 22, 2017
@magicmark
Copy link

magicmark commented Sep 25, 2017

Is there a way to override and specify a specific path for prettier to vim-prettier? (I cannot update the version of prettier in a project i'm working on)

@mitermayer
Copy link
Member

@magicmark currently there is not, but its a good idea, will create a task for it and see if I can deploy a new vim-prettier version with that option tonight.

In the meantime a work-around is delete the prettier local installation folder from the project you are working on node_modules/prettier that will than cause it to default to either the global prettier or the vim-prettier.

@mitermayer
Copy link
Member

@magicmark created the task for it #56 will try to get into it ASAP

@mitermayer
Copy link
Member

@magicmark Just did new release of vim-prettier to version 0.1.2.

You should now be able to overwrite the default path by adding this flag to your .vimrc file:

" Set the prettier CLI executable path
let g:prettier#exec_cmd_path = "~/path/to/cli/prettier"

@mitermayer
Copy link
Member

mitermayer commented Oct 31, 2017

Hi @jojoyuji

Could you please confirm that:

  1. Vim prettier version is 0.2.4 by checking output of:
:PrettierVersion
  1. Check that you are really using a prettier CLI with version over 1.7.4 by checking output of:
:PrettierCliVersion
  1. If the above version is not what you expected you can check what is the resolved prettier cli by checking output of:
:PrettierCliPath

Sometimes you may have the global installed prettier version of 1.7.4+ but you may be working on projects that still have the old prettier installed on their package.json and available on their node_modules in that case vim-prettier will resolve that prettier version instead of your global one

@mitermayer
Copy link
Member

Quoting the comment from #73 (comment) to this thread in case some other users may have been facing similar issue:

Woah, found the issue!
I had updated my prettier globaly indeed, however I realized that vim-prettier was using my current project's Prettier by running the :PrettierCliPath
Thx @mitermayer for the help.

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

No branches or pull requests

5 participants