{"id":20371,"library":"prettier-plugin-groovy","title":"prettier-plugin-groovy","description":"A Prettier plugin to format Groovy files, including Jenkinsfiles. Version 0.2.1 requires Node >=20.0.0 || ^18.12.0 and Prettier ^3.3.3. It internally uses groovy-beautify for formatting. Key differentiator: integrates Groovy formatting into the Prettier ecosystem, enabling consistent code style with other languages.","status":"active","version":"0.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/nice-move/prettier-plugin-groovy","tags":["javascript","groovy","jenkins","jenkinsfile","prettier","prettier-plugin"],"install":[{"cmd":"npm install prettier-plugin-groovy","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-plugin-groovy","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-plugin-groovy","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin requires Prettier to function","package":"prettier","optional":false}],"imports":[{"note":"The plugin is not a JS module to import directly; it's loaded by Prettier's plugin mechanism via config file (.prettierrc) or CLI.","wrong":"Direct import and use as a module","symbol":"default (plugin registration)","correct":"Add to Prettier config plugins array"},{"note":"Prettier plugins are strings in config, not required modules. The plugin must be installed as a package.","wrong":"require('prettier-plugin-groovy') in config","symbol":"plugins","correct":"\"plugins\": [\"prettier-plugin-groovy\"] in .prettierrc"},{"note":"The plugin automatically detects Groovy files; no special CLI flag needed if plugin is in config.","wrong":"Running prettier on non-Groovy files with plugin","symbol":"CLI usage","correct":"prettier --write --plugin=prettier-plugin-groovy path/to/file.groovy"}],"quickstart":{"code":"// Install the plugin as a dev dependency\nnpm install prettier-plugin-groovy --save-dev\n\n// Add to .prettierrc (JSON format)\n{\n  \"plugins\": [\"prettier-plugin-groovy\"]\n}\n\n// Or use CLI with plugin flag\nprettier --write --plugin=prettier-plugin-groovy Jenkinsfile\n","lang":"javascript","description":"Installation and usage of prettier-plugin-groovy to format Groovy files (e.g., Jenkinsfile) via Prettier."},"warnings":[{"fix":"Upgrade Node to version 18.12.0 LTS or higher.","message":"Requires Node >=20.0.0 or >=18.12.0. Older Node versions are not supported.","severity":"breaking","affected_versions":"<18.12.0"},{"fix":"Update Prettier to version 3.3.3 or later.","message":"Requires Prettier ^3.3.3. Incompatible with Prettier v2.","severity":"breaking","affected_versions":"<3.3.3"},{"fix":"Review formatting output and adjust Prettier options as needed.","message":"Plugin uses groovy-beautify internally; formatting behavior may differ from standard Groovy linters.","severity":"gotcha","affected_versions":"*"},{"fix":"Test plugin with your specific Groovy file types.","message":"The plugin is designed for Groovy and Jenkinsfiles; testing on other Groovy dialects is limited.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install prettier-plugin-groovy --save-dev' to install the plugin.","cause":"Plugin is not installed or not in node_modules.","error":"Cannot find module 'prettier-plugin-groovy'"},{"fix":"Update Prettier to version 3.3.3 or later: 'npm install prettier@latest --save-dev'.","cause":"Installed Prettier version is too old.","error":"prettier-plugin-groovy requires prettier@>=3.3.3. Please upgrade."},{"fix":"Ensure the plugin is installed and listed as 'prettier-plugin-groovy' in the plugins array.","cause":"Plugin name in Prettier config is incorrect or not installed.","error":"Plugin 'prettier-plugin-groovy' is not found when parsing config."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}