{"id":31970676,"url":"https://github.com/winjs-dev/prettier-config-win","last_synced_at":"2025-10-14T19:18:15.904Z","repository":{"id":88652549,"uuid":"543408635","full_name":"winjs-dev/prettier-config-win","owner":"winjs-dev","description":"prettier 配置","archived":false,"fork":false,"pushed_at":"2025-05-27T05:13:49.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-27T06:23:57.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/winjs-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-09-30T03:03:37.000Z","updated_at":"2025-05-27T05:13:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a229019-e9d7-4040-9241-6fb35cab55e1","html_url":"https://github.com/winjs-dev/prettier-config-win","commit_stats":null,"previous_names":["winjs-dev/prettier-config-win"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/winjs-dev/prettier-config-win","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winjs-dev%2Fprettier-config-win","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winjs-dev%2Fprettier-config-win/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winjs-dev%2Fprettier-config-win/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winjs-dev%2Fprettier-config-win/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winjs-dev","download_url":"https://codeload.github.com/winjs-dev/prettier-config-win/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winjs-dev%2Fprettier-config-win/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020654,"owners_count":26086895,"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-10-14T02:00:06.444Z","response_time":60,"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":[],"created_at":"2025-10-14T19:18:10.697Z","updated_at":"2025-10-14T19:18:15.898Z","avatar_url":"https://github.com/winjs-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prettier-config-win\n\n\u003e 团队内部 prettier 配置，支持 CommonJS 和 ESM\n\n## Install\n\n```bash\nnpm install @winner-fed/prettier-config-win --save-dev\n# 或\nyarn add @winner-fed/prettier-config-win --dev\n# 或\npnpm add @winner-fed/prettier-config-win -D\n```\n\n## Usage\n\n### 方式一：在 `package.json` 中配置\n\n```json\n{\n  \"prettier\": \"@winner-fed/prettier-config-win\"\n}\n```\n\n### 方式二：在 `.prettierrc` 中配置\n\n```json\n\"@winner-fed/prettier-config-win\"\n```\n\n### 方式三：直接使用 JSON 配置（向前兼容）\n\n```json\n\"@winner-fed/prettier-config-win/index.json\"\n```\n\n### 方式四：在 `prettier.config.js` 中配置（ESM）\n\n```javascript\nexport { default } from '@winner-fed/prettier-config-win';\n```\n\n### 方式五：在 `prettier.config.cjs` 中配置（CommonJS）\n\n```javascript\nmodule.exports = require('@winner-fed/prettier-config-win');\n```\n\n### 方式六：扩展配置\n\n```javascript\n// prettier.config.js (ESM)\nimport baseConfig from '@winner-fed/prettier-config-win';\n\nexport default {\n  ...baseConfig,\n  // 你的自定义配置\n  printWidth: 100,\n};\n```\n\n## 兼容性说明\n\n本库同时支持多种模块格式，确保向前兼容：\n\n- **JSON 格式**：保留原有的 `index.json` 文件，现有项目无需修改\n- **ESM 格式**：支持现代 ES 模块语法，适用于新项目\n- **CommonJS 格式**：支持传统的 Node.js 模块系统\n\n### 迁移建议\n\n如果你正在使用旧版本，可以选择以下迁移路径：\n\n1. **保持现状**：继续使用 JSON 配置，无需任何修改\n2. **渐进式迁移**：新项目使用 ESM/CommonJS 格式，旧项目保持不变\n3. **完全迁移**：将所有项目迁移到 JavaScript 配置格式，获得更好的扩展性\n\n```javascript\n// prettier.config.cjs (CommonJS)\nconst baseConfig = require('@winner-fed/prettier-config-win');\n\nmodule.exports = {\n  ...baseConfig,\n  // 你的自定义配置\n  printWidth: 100,\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinjs-dev%2Fprettier-config-win","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinjs-dev%2Fprettier-config-win","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinjs-dev%2Fprettier-config-win/lists"}