{"id":16527341,"url":"https://github.com/u3u/prettier-config","last_synced_at":"2025-08-18T03:31:32.940Z","repository":{"id":156170985,"uuid":"197691832","full_name":"u3u/prettier-config","owner":"u3u","description":"🎨 The most perfect Prettier config","archived":false,"fork":false,"pushed_at":"2025-08-15T18:47:39.000Z","size":1150,"stargazers_count":13,"open_issues_count":7,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-15T20:41:26.939Z","etag":null,"topics":["prettier","prettier-config"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/u3u.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-07-19T02:59:56.000Z","updated_at":"2025-08-15T18:47:42.000Z","dependencies_parsed_at":"2023-11-20T19:38:33.600Z","dependency_job_id":"f2b42a4e-2a4d-40e7-8f64-bddd91c92557","html_url":"https://github.com/u3u/prettier-config","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/u3u/prettier-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/u3u%2Fprettier-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/u3u%2Fprettier-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/u3u%2Fprettier-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/u3u%2Fprettier-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/u3u","download_url":"https://codeload.github.com/u3u/prettier-config/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/u3u%2Fprettier-config/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270657715,"owners_count":24623465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["prettier","prettier-config"],"created_at":"2024-10-11T17:34:46.451Z","updated_at":"2025-08-18T03:31:32.642Z","avatar_url":"https://github.com/u3u.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# My Prettier config\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![License][license-src]][license-href]\n\n## Features\n\n- Sort/merge `import` statements\n- Sort JSON Key\n- Sort `package.json`\n- Sort Tailwind CSS classes\n- Format `jsdoc`\n- Format `nginx` config\n- Extend config\n- ...\n\n\u003e [!NOTE]\n\u003e\n\u003e Upgrade this config to `\u003e=3.x` version, Prettier should automatically infer the plugin parser. If you are using the [prettier-vscode](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) extension, you need to upgrade to [\u003e=9.17.0](https://github.com/prettier/prettier-vscode/blob/main/CHANGELOG.md) version for automatic inference of the plugin parser to take effect.  \n\u003e See this fix: https://github.com/prettier/prettier-vscode/pull/3027\n\n## Install\n\n```sh\npnpm add prettier @u3u/prettier-config -D\n```\n\n## Usage\n\nIn your `.prettierrc`\n\n```json\n\"@u3u/prettier-config\"\n```\n\nUse base config (without plugins)\n\n```json\n\"@u3u/prettier-config/base\"\n```\n\nWith Tailwind CSS (By default, the `clsx`, `tw`, and `twMerge`, `twJoin` methods will also be sorted.)\n\n```json\n\"@u3u/prettier-config/tw\"\n```\n\nAdd `format` script to `package.json`\n\n```json\n{\n  \"scripts\": {\n    \"format\": \"prettier --write .\"\n  }\n}\n```\n\nThen you can run `pnpm format` to format all files.\n\n## Recommend VSCode Config\n\nIn your `.vscode/settings.json`\n\n```json\n{\n  \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\n  \"editor.formatOnSave\": true,\n  \"prettier.documentSelectors\": [\"**/*\"],\n  \"prettier.enableDebugLogs\": true,\n  \"prettier.endOfLine\": \"lf\",\n  \"prettier.printWidth\": 120,\n  \"prettier.requireConfig\": true,\n  \"prettier.semi\": false,\n  \"prettier.singleQuote\": true\n}\n```\n\n## Lint Staged\n\nIf you want to format before every commit, you can add the following to your `package.json`:\n\n```json\n{\n  \"lint-staged\": {\n    \"*\": [\"prettier --write --ignore-unknown\"]\n  },\n\n  \"simple-git-hooks\": {\n    \"pre-commit\": \"npx lint-staged\"\n  }\n}\n```\n\nthen install them\n\n```sh\npnpm add lint-staged simple-git-hooks -D\nnpx simple-git-hooks\n```\n\n## Extend Config\n\nIn your `.prettierrc.js`\n\n```js\nconst { extendConfig } = require('@u3u/prettier-config/utils');\n\nmodule.exports = extendConfig({\n  printWidth: 80,\n});\n```\n\n## Global Default Format Config\n\nYou can place the config file in the user's home directory as the default config to format all files.\n\n```sh\ncd ~\npnpm add prettier @u3u/prettier-config -D\necho '\"@u3u/prettier-config\"' \u003e '.prettierrc'\n```\n\n## Related\n\n- [u3u/eslint-config](https://github.com/u3u/eslint-config) - My ESLint config\n\n## License\n\n[MIT](./LICENSE) License © 2023 [u3u](https://github.com/u3u)\n\n\u003c!-- Badges --\u003e\n\n[npm-version-src]: https://img.shields.io/npm/v/@u3u/prettier-config\n[npm-version-href]: https://npmjs.com/package/@u3u/prettier-config\n[npm-downloads-src]: https://img.shields.io/npm/dm/@u3u/prettier-config\n[npm-downloads-href]: https://npmjs.com/package/@u3u/prettier-config\n[license-src]: https://img.shields.io/github/license/u3u/prettier-config.svg\n[license-href]: ./LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fu3u%2Fprettier-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fu3u%2Fprettier-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fu3u%2Fprettier-config/lists"}