{"_id":"@deutschlandgpt/prettier-config","name":"@deutschlandgpt/prettier-config","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@deutschlandgpt/prettier-config","version":"1.0.0","description":"Fully customizable Prettier configuration used for projects at DeutschlandGPT.","keywords":["prettier","prettier-config","code-style","formatting","import-sorting","deutschlandgpt","eslint","typescript","javascript"],"homepage":"https://github.com/deutschlandgpt/prettier-config#readme","bugs":{"url":"https://github.com/deutschlandgpt/prettier-config/issues"},"repository":{"type":"git","url":"git+https://github.com/deutschlandgpt/prettier-config.git"},"license":"CC0-1.0","author":{"name":"deutschlandgpt"},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./presets":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","dependencies":{"@ianvs/prettier-plugin-sort-imports":"4.4.2","prettier-plugin-packagejson":"2.5.17","prettier-plugin-tailwindcss":"0.6.13"},"devDependencies":{"@types/node":"24.0.10","fix-tsup-cjs":"1.2.0","prettier":"3.6.2","tsup":"8.5.0","typescript":"5.8.3"},"peerDependencies":{"prettier":"^3.0.0"},"engines":{"node":">=18","pnpm":">=8"},"publishConfig":{"access":"public"},"scripts":{"build":"rm -rf dist && tsup && fix-tsup-cjs","format":"prettier --write .","format:check":"prettier --check ."},"_id":"@deutschlandgpt/prettier-config@1.0.0","_integrity":"sha512-E34aW2kvjy9XfFr6jceGeWmvYhpro59TaRLfWshxtycQbJ6cKMHhVtCMk/fm/6WjVegb1dYnI/ZWgAVuM7p/tg==","_resolved":"/private/var/folders/g8/gccz05sn7m5f9dfx65p6ph6h0000gn/T/54b992f66d5851789f915640f20b5d61/deutschlandgpt-prettier-config-1.0.0.tgz","_from":"file:deutschlandgpt-prettier-config-1.0.0.tgz","_nodeVersion":"18.20.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-E34aW2kvjy9XfFr6jceGeWmvYhpro59TaRLfWshxtycQbJ6cKMHhVtCMk/fm/6WjVegb1dYnI/ZWgAVuM7p/tg==","shasum":"99915f3423077a7bee3f44c16d45d989b57a7f98","tarball":"https://registry.npmjs.org/@deutschlandgpt/prettier-config/-/prettier-config-1.0.0.tgz","fileCount":9,"unpackedSize":32954,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDrcKQWKRPNfMCMMg8pW6fh3k2l5PPE/S2W2BqQqY5IMgIgTU0BMIKiI9qVAjtp8xyUVvx6XmaI9OpBF0jTPo1ij88="}]},"_npmUser":{"name":"alexanderberkov","email":"alexander.berkov@deutschlandgpt.de"},"directories":{},"maintainers":[{"name":"alexanderberkov","email":"alexander.berkov@deutschlandgpt.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/prettier-config_1.0.0_1760718901832_0.26674872478467826"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-17T16:35:01.747Z","1.0.0":"2025-10-17T16:35:02.017Z","modified":"2025-10-17T16:35:02.389Z"},"maintainers":[{"name":"alexanderberkov","email":"alexander.berkov@deutschlandgpt.de"}],"description":"Fully customizable Prettier configuration used for projects at DeutschlandGPT.","homepage":"https://github.com/deutschlandgpt/prettier-config#readme","keywords":["prettier","prettier-config","code-style","formatting","import-sorting","deutschlandgpt","eslint","typescript","javascript"],"repository":{"type":"git","url":"git+https://github.com/deutschlandgpt/prettier-config.git"},"author":{"name":"deutschlandgpt"},"bugs":{"url":"https://github.com/deutschlandgpt/prettier-config/issues"},"license":"CC0-1.0","readme":"# @deutschlandgpt/prettier-config\n\nFully customizable Prettier configuration used for projects at DeutschlandGPT.\n\n## Installation\n\n```bash\n# pnpm (recommended)\npnpm add -D @deutschlandgpt/prettier-config\n\n# npm\nnpm install -D @deutschlandgpt/prettier-config\n\n# yarn\nyarn add -D @deutschlandgpt/prettier-config\n```\n\n_Newer versions of `PNPM` starting `pnpm@^10.0.0` will not automatically install dependencies or peer dependencies so you have manually install the plugins as well as `prettier@^3.0.0`._\n\n```bash\npnpm add -D prettier @ianvs/prettier-plugin-sort-imports prettier-plugin-tailwindcss prettier-plugin-packagejson\n```\n\n## Quick Start\n\n### Basic Usage\n\nCreate a `prettier.config.js` file in your project root:\n\n```javascript\nimport defineConfig from '@deutschlandgpt/prettier-config';\n\n// Default config with no plugins enabled\nexport default defineConfig();\n```\n\n### Using Presets\n\n```javascript\nimport defineConfig, { presets } from '@deutschlandgpt/prettier-config';\n\n// No options (default values)\nexport default defineConfig(presets.nextjs())  // Next.js with Tailwind\nexport default defineConfig(presets.nodejs())  // Typical node project (No Tailwind)\n\n// Customizable\nexport default defineConfig(presets.nextjs({\n  order: {\n    enabled: true,\n    alias: ['@', '~', '#'],\n  },\n  tailwind: false,\n}));\n\nexport default defineConfig(presets.nodejs({\n  packageJson: true,\n  extend: {\n    printWidth: 140,\n  }\n}));\n\n```\n\n### Custom Configuration\n\n```javascript\nimport defineConfig from '@deutschlandgpt/prettier-config';\n\nexport default defineConfig({\n  order: {\n    enabled: true,\n    scope: ['components', 'hooks', 'utils', 'lib'],\n    alias: ['@', '~', '#'],\n  },\n  tailwind: true,\n  packageJson: true,\n  extend: {\n    printWidth: 120,\n    semi: false,\n    plugins: ['prettier-plugin-organize-attributes'], // Add additional plugins\n  },\n});\n```\n\n### Options\n\n#### `order`\n\nConfigure import sorting behavior:\n\n- **`enabled`** (boolean, default: `true`) - Enable/disable import sorting\n- **`scope`** (string | string[], default: `[]`) - Internal scopes for import organization\n- **`alias`** (string[], default: `[]`) - Path aliases used in your project\n\n#### `extend`\n\nExtend or override any Prettier configuration option.\n\n#### `tailwind`\n\n(boolean, default: `false`) - Enable Tailwind CSS class sorting\n\n#### `packageJson`\n\n(boolean, default: `false`) - Enable package.json formatting\n\n## Default Configuration\n\n```javascript\n{\n  printWidth: 100,\n  tabWidth: 2,\n  useTabs: false,\n  semi: true,\n  singleQuote: true,\n  quoteProps: \"as-needed\",\n  jsxSingleQuote: false,\n  trailingComma: \"all\",\n  bracketSpacing: true,\n  bracketSameLine: false,\n  arrowParens: \"always\",\n  requirePragma: false,\n  insertPragma: false,\n  proseWrap: \"preserve\",\n  htmlWhitespaceSensitivity: \"strict\",\n  endOfLine: \"lf\",\n  embeddedLanguageFormatting: \"off\",\n}\n```\n\n## Import Order\n\nWhen import sorting is enabled, imports are organized in the following order:\n\n1. Built-in Node.js modules\n2. Third-party packages\n3. Path aliases (configured via `alias` option)\n4. Internal scopes (configured via `scope` option)\n5. Relative imports\n6. CSS imports (always last)\n\n## Usage Examples\n\n### React Project with Tailwind\n\n```javascript\n// prettier.config.js\nimport defineConfig from '@deutschlandgpt/prettier-config';\n\nexport default defineConfig({\n  order: {\n    enabled: true,\n    scope: ['components', 'hooks', 'utils', 'types'],\n    alias: ['@', '~'],\n  },\n  tailwind: true,\n  extend: {\n    plugins: ['prettier-plugin-organize-attributes']\n  },\n});\n```\n\n### Monorepo Setup\n\n```javascript\n// prettier.config.js\nimport defineConfig from '@deutschlandgpt/prettier-config';\n\nexport default defineConfig({\n  order: {\n    enabled: true,\n    scope: ['packages', 'apps', 'libs'],\n    alias: ['@workspace', '@shared'],\n  },\n  extend: {\n    printWidth: 120,\n  },\n});\n```\n\nYou can see more examples [here](examples.ts).\n\n## Package.json Scripts\n\nAdd these scripts to your `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"format\": \"prettier --write .\",\n    \"format:check\": \"prettier --check .\",\n  }\n}\n```\n\n## Editor Integration\n\n### VS Code\n\nInstall the [Prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) and add to your settings:\n\n```json\n{\n  \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\n  \"editor.formatOnSave\": true  // optional\n}\n```\n\n## Peer Dependencies\n\nThis package requires Prettier 3.0.0 or higher:\n\n```json\n{\n  \"peerDependencies\": {\n    \"prettier\": \"^3.0.0\"\n  }\n}\n```\n\n## Contributing\n\nIssues and pull requests are welcome!\n","readmeFilename":"README.md","_rev":"1-1f1c8f8cd45ed720839463c09063a737"}