{"id":20347,"library":"prettier-plugin-curly-and-jsdoc","title":"Prettier Plugin Curly and JSDoc","description":"Prettier plugin that resolves incompatibilities between prettier-plugin-curly and prettier-plugin-jsdoc, allowing both to be used together without conflicts. Current stable version is 3.4.0. The package is a thin compatibility layer that re-exports and combines the two plugins. It is part of the codestyle-config monorepo and ships TypeScript definitions. Key differentiator: no configuration needed beyond adding it to your Prettier plugins list. Released as needed to keep up with upstream plugin changes.","status":"active","version":"3.4.0","language":"javascript","source_language":"en","source_url":"https://github.com/so1ve/codestyle-config","tags":["javascript","curly","jsdoc","prettier","prettier-plugin","prettierplugin","typescript"],"install":[{"cmd":"npm install prettier-plugin-curly-and-jsdoc","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-plugin-curly-and-jsdoc","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-plugin-curly-and-jsdoc","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: requires Prettier ^3.0.0; this plugin is a Prettier plugin and will not work without it.","package":"prettier","optional":false}],"imports":[{"note":"ESM-only since v3; CJS require will fail.","wrong":"const prettierPluginCurlyAndJsdoc = require('prettier-plugin-curly-and-jsdoc')","symbol":"default","correct":"import prettierPluginCurlyAndJsdoc from 'prettier-plugin-curly-and-jsdoc'"},{"note":"As of v3, you must import the plugin and pass the object, not just the package name string.","wrong":"// Adding the plugin name as a string in .prettierrc:\n{\"plugins\": [\"prettier-plugin-curly-and-jsdoc\"]}","symbol":"plugins","correct":"// In prettier.config.mjs:\nimport prettierPluginCurlyAndJsdoc from 'prettier-plugin-curly-and-jsdoc';\nexport default { plugins: [prettierPluginCurlyAndJsdoc] };"},{"note":"The package does not export any types; use Prettier's own Plugin type.","wrong":"import { Plugin } from 'prettier-plugin-curly-and-jsdoc'","symbol":"Plugin","correct":"import type { Plugin } from 'prettier';\nimport plugin from 'prettier-plugin-curly-and-jsdoc'; // type is Plugin"}],"quickstart":{"code":"// Install the plugin and its dependencies:\n// npm install --save-dev prettier prettier-plugin-curly prettier-plugin-jsdoc prettier-plugin-curly-and-jsdoc\n\n// prettier.config.mjs\nimport prettierPluginCurlyAndJsdoc from 'prettier-plugin-curly-and-jsdoc';\n\nexport default {\n  semi: true,\n  singleQuote: true,\n  plugins: [prettierPluginCurlyAndJsdoc],\n  // No need to add curly or jsdoc plugins separately; this plugin includes them.\n};\n\n// Then run: npx prettier --check .","lang":"javascript","description":"Shows installation and configuration to enable both curly and JSDoc formatting via Prettier without conflicts."},"warnings":[{"fix":"Switch to ESM: use 'import' or ensure your project is ESM (type: module in package.json).","message":"In v3.0.0, the plugin became ESM-only. CommonJS require() will throw.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Only include this plugin in the 'plugins' array; remove 'prettier-plugin-curly' and 'prettier-plugin-jsdoc' from config.","message":"Do NOT add curly and jsdoc plugins individually in Prettier config if using this plugin; it includes them and adding duplicates may cause conflicts.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Pin exact versions of all three plugins and test after updates.","message":"The package does not follow semantic versioning for the compatibility layer; minor bumps may break due to upstream changes in prettier-plugin-curly or prettier-plugin-jsdoc.","severity":"deprecated","affected_versions":"<3.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change to dynamic import() or convert your project to ESM (e.g., use .mjs extension or type: module in package.json).","cause":"Using CommonJS require() for an ESM-only package (v3+).","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/prettier-plugin-curly-and-jsdoc/dist/index.js from ... not supported."},{"fix":"Install the package: npm install --save-dev prettier-plugin-curly-and-jsdoc. And use the object reference as shown in quickstart.","cause":"The package is not installed when using the string reference in Prettier config (e.g., \".prettierrc\" with plugin name).","error":"Cannot find module 'prettier-plugin-curly-and-jsdoc'"},{"fix":"Change your Prettier config to export a config object that imports the plugin and passes the object in the plugins array.","cause":"Prettier v3+ requires plugin objects, not strings, when using external ESM plugins.","error":"Error: Couldn't resolve plugin \"prettier-plugin-curly-and-jsdoc\" from your Prettier config. Did you mean to import it instead of using the string name?"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}