{"id":19409,"library":"coc-prettier","title":"coc-prettier","description":"Prettier formatter extension for coc.nvim, version 11.0.1. Fork of prettier-vscode adapted for Neovim/Vim via the coc.nvim async completion framework. Supports formatting for JavaScript, TypeScript, CSS, HTML, Markdown, YAML, and more via Prettier plugins. Uses project-local or global Prettier installation with fallback to bundled version. Configure via coc-settings.json or Prettier config files. Release cadence follows coc.nvim ecosystem. Key differentiator: native integration with coc.nvim's async formatting pipeline vs standalone formatters.","status":"active","version":"11.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/neoclide/coc-prettier","tags":["javascript","coc.nvim","prettier"],"install":[{"cmd":"npm install coc-prettier","lang":"bash","label":"npm"},{"cmd":"yarn add coc-prettier","lang":"bash","label":"yarn"},{"cmd":"pnpm add coc-prettier","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required runtime plugin host; coc-prettier is an extension that runs within coc.nvim","package":"coc.nvim","optional":false},{"reason":"Core formatter engine; bundled but project-local or global installation recommended","package":"prettier","optional":true}],"imports":[],"quickstart":{"code":":CocInstall coc-prettier\n\n\" In your project, after prettier is installed locally:\n\" format current buffer\n:call CocAction('format')\n\" or use a key mapping\nnmap <silent> <Leader>f <Plug>(coc-format)\n\" Automatically format on save via coc-settings.json:\n\" {\n\"   \"coc.preferences.formatOnSaveFiletypes\": [\"javascript\", \"typescript\", \"json\", \"html\", \"css\", \"markdown\"]\n\" }","lang":"vim","description":"Installs the extension via :CocInstall, then demonstrates formatting the current buffer and setting up format-on-save for common filetypes."},"warnings":[{"fix":"Run `npm install prettier -D --save-exact` inside your project and verify it is resolved correctly.","message":"Local prettier installation overrides bundled version; ensure prettier is listed in project's devDependencies or root package.json to avoid version mismatch.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Add `\"coc.preferences.formatOnSaveFiletypes\": [...]` to your coc-settings.json.","message":"Format-on-save requires explicit configuration in coc-settings.json; the extension does not enable it by default.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Install the desired plugin (e.g., `@prettier/plugin-ruby`) and ensure it appears in your project's package.json.","message":"Plugins for additional languages (e.g., Ruby, PHP) must be installed separately and registered in package.json; this extension only activates plugins from a local or global prettier resolution.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Set `\"prettier.resolveGlobalModules\": false` (default) and always use local prettier.","message":"The `prettier.resolveGlobalModules` option (default false) if set to true may load global prettier which could mismatch project config or be untrusted; user will be prompted to confirm.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Create .prettierrc in your project root and avoid relying on coc-settings.json for non-project files.","message":"Settings defined in coc-settings.json apply only when formatting via the extension, not via CLI; always use Prettier config files for consistent behavior across tools.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Update coc.nvim via `:CocUpdate` and install with `:CocInstall coc-prettier` (note hyphen).","cause":"The coc.nvim version is older than 0.0.82 or the extension name is misspelled.","error":"CocInstall error: invalid extension"},{"fix":"Run `npm install prettier -D --save-exact` in your project root.","cause":"Prettier is not installed locally nor globally, and the bundled version is missing or corrupted.","error":"Prettier module not found"},{"fix":"Ensure prettier supports the filetype, or add a Prettier config. Check `:CocInfo` to see registered formatters.","cause":"Format action called but no formatter registered for the current filetype.","error":"Cannot read property 'format' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}