{"id":13527500,"url":"https://github.com/antfu/case-police","last_synced_at":"2026-04-15T03:03:00.713Z","repository":{"id":38321977,"uuid":"476254167","full_name":"antfu/case-police","owner":"antfu","description":"🚨 Make the case correct, PLEASE!","archived":false,"fork":false,"pushed_at":"2025-11-14T06:13:30.000Z","size":565,"stargazers_count":1413,"open_issues_count":8,"forks_count":88,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-14T08:17:38.160Z","etag":null,"topics":[],"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/antfu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["antfu"],"open_collective":"antfu"}},"created_at":"2022-03-31T10:19:12.000Z","updated_at":"2025-11-14T06:13:33.000Z","dependencies_parsed_at":"2023-11-17T02:24:48.880Z","dependency_job_id":"62a8125a-9b40-4d3a-94d2-c6964e2c061f","html_url":"https://github.com/antfu/case-police","commit_stats":{"total_commits":206,"total_committers":84,"mean_commits":"2.4523809523809526","dds":0.5825242718446602,"last_synced_commit":"deea41dff44406a6dc69c8cc07ed0a5abf87fdc8"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/antfu/case-police","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antfu%2Fcase-police","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antfu%2Fcase-police/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antfu%2Fcase-police/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antfu%2Fcase-police/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antfu","download_url":"https://codeload.github.com/antfu/case-police/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antfu%2Fcase-police/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285181867,"owners_count":27128370,"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-11-19T02:00:05.673Z","response_time":65,"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":"2024-08-01T06:01:49.399Z","updated_at":"2026-04-15T03:03:00.700Z","avatar_url":"https://github.com/antfu.png","language":"TypeScript","funding_links":["https://github.com/sponsors/antfu","https://opencollective.com/antfu"],"categories":["TypeScript","Quality Assurance","others","General Tools"],"sub_categories":["Checker \u0026 Formatter"],"readme":"# 🚨 CasePolice\n\n[![NPM version](https://img.shields.io/npm/v/case-police?color=a1b858\u0026label=)](https://www.npmjs.com/package/case-police)\n\n\u003c!-- @case-police-ignore --\u003e\n\n- Git**H**ub, not _Github_\n- Type**S**cript, not _Typescript_\n- **m**acOS, not _MacOS_\n- **VS C**ode, not _Vscode_\n- [...](./packages/case-police/dict)\n\nMake the case correct, PLEASE!\n\n## Usage\n\n**Make sure you have committed all unsaved works**, and then\n\n```bash\nnpx case-police --fix\n```\n\nIt will scan all your source files and fix the cases of [known names](./packages/case-police/dict).\n\nOnly the word including both uppercase and lowercase will be fixed. (e.g. `Github` -\u003e `GitHub`; `github` and `GITHUB` will be left untouched).\n\n### Use in ESLint\n\nWe also provide an ESLint plugin that can be used to lint your codebase.\n\n#### Flat Config\n\n```bash\nnpm i -D eslint-plugin-case-police\n```\n\n\u003c!-- eslint-skip --\u003e\n\n```js\n// .eslint.config.js\nimport pluginCasePolice from \"eslint-plugin-case-police\";\n\nexport default [\n  ...pluginCasePolice.configs.recommended,\n];\n```\n\nOR\n\n\u003c!-- eslint-skip --\u003e\n\n```js\n// .eslint.config.js\nimport pluginCasePolice from \"eslint-plugin-case-police\";\n\nexport default [\n  {\n    name: 'case-police',\n    files: ['**/*.?([cm])[jt]s?(x)'],\n    plugins: {\n      'case-police': pluginCasePolice,\n    },\n    rules: {\n      'case-police/string-check': 'warn',\n    },\n  },\n]\n```\n\n#### Legacy Config\n\n\u003e Since v2.0.0, we only support the flat config style. If you are using the legacy config, please use the version `1.x.x` of the plugin.\n\n```bash\nnpm i -D eslint-plugin-case-police@^1.0.0\n```\n\n\u003c!-- eslint-skip --\u003e\n\n```jsonc\n// .eslintrc\n{\n  \"extends\": [\n    \"plugin:case-police/recommended\"\n  ]\n}\n```\n\n### Use in CI\n\nSimply add `case-police` (without `--fix`) to your workflow and it will exit with a non-zero code for your CI to catch it.\n\n### Specific files\n\nBy default it will scan all the text files under the current directory (respects `.gitignore`), if you want it to check only specific files, you can pass the file paths of glob patterns to it.\n\n```bash\nnpx case-police \"**/*.md\" path/to/file.html\n```\n\n## CLI Options\n\n| Options                   | Description                                                                    |\n| ------------------------- | ------------------------------------------------------------------------------ |\n| `[...globs]`              | Files or glob to be checked, if not provided, all the text files will be check |\n| `--fix`                   | Rewrite changes to file                                                        |\n| `-d, --dict \u003cpath\u003e`       | Custom dictionary JSON, will be merged with original dict                      |\n| `-p, --presets \u003cpresets\u003e` | Filter the default [presets](./packages/case-police/dict), comma separated     |\n| `--no-default`            | Disable the default dictionary                                                 |\n| `--disable \u003crules\u003e`       | Disable rules, comma separated                                                 |\n| `--ignore \u003cglobs\u003e`        | Files or globs to be ignore, comma separated                                   |\n\n### Ignores\n\nYou can add `@case-police-disable` in your file to disable the case check for the particular file, or add `@case-police-ignore xxx` to ignore certain words in that file (use comma to separate mutliple words).\n\nFor example:\n\n```ts\n// @case-police-ignore Uri\n\nconsole.log(something.Uri.path)\n```\n\n## Sponsors\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg\"\u003e\n    \u003cimg src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg' alt='Sponsors' /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Related Projects\n\n[actions-case-police](https://github.com/Namchee/actions-case-police). Use the correct letter case in GitHub issues and pull requests\n\n## License\n\n[MIT](./LICENSE) License © 2021 [Anthony Fu](https://github.com/antfu)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantfu%2Fcase-police","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantfu%2Fcase-police","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantfu%2Fcase-police/lists"}