{"id":31696693,"url":"https://github.com/rokstrnisa/ts-prune-filter","last_synced_at":"2026-05-19T07:31:39.146Z","repository":{"id":318136047,"uuid":"1070109177","full_name":"rokstrnisa/ts-prune-filter","owner":"rokstrnisa","description":"A simple and configurable tool for finding unused exports in TypeScript projects.","archived":false,"fork":false,"pushed_at":"2025-10-05T10:39:26.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-13T21:23:55.786Z","etag":null,"topics":["dead-code","dead-code-removal","nextjs","static-analysis","ts-prune","typescript","unused-exports"],"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/rokstrnisa.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-05T09:35:55.000Z","updated_at":"2025-10-09T05:33:46.000Z","dependencies_parsed_at":"2025-10-05T11:36:37.167Z","dependency_job_id":"7a70228f-8969-4652-836a-93953beb356e","html_url":"https://github.com/rokstrnisa/ts-prune-filter","commit_stats":null,"previous_names":["rokstrnisa/ts-prune-filter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rokstrnisa/ts-prune-filter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rokstrnisa%2Fts-prune-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rokstrnisa%2Fts-prune-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rokstrnisa%2Fts-prune-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rokstrnisa%2Fts-prune-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rokstrnisa","download_url":"https://codeload.github.com/rokstrnisa/ts-prune-filter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rokstrnisa%2Fts-prune-filter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33206300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T07:16:55.748Z","status":"ssl_error","status_checked_at":"2026-05-19T07:16:54.366Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dead-code","dead-code-removal","nextjs","static-analysis","ts-prune","typescript","unused-exports"],"created_at":"2025-10-08T17:13:54.743Z","updated_at":"2026-05-19T07:31:39.127Z","avatar_url":"https://github.com/rokstrnisa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ts-prune-filter\n\nA simple and configurable tool for finding unused exports in TypeScript projects.\n\nThe tool wraps [`ts-prune`](https://github.com/nadeesha/ts-prune) and filters its output using configurable pattern-matching rules.\n\nYou can specify which files and exports to ignore. See [.ts-prune.json](.ts-prune.json) for a starter configuration.\n\n## Installation\n\n1. Install `ts-prune` and `ts-node` as dev dependencies in your project:\n\n```bash\nnpm install --save-dev ts-prune ts-node\n# or\npnpm add -D ts-prune ts-node\n# or\nyarn add -D ts-prune ts-node\n```\n\n2. Copy [`check-unused.ts`](check-unused.ts) to your project, e.g. to `scripts/check-unused.ts`.\n\n3. Copy [`.ts-prune.json`](.ts-prune.json) to your project's root and adapt it to your needs.\n\n4. Add a script to your `package.json`:\n\n```json\n{\n    \"scripts\": {\n        \"check-unused\": \"ts-node scripts/check-unused.ts\"\n    }\n}\n```\n\n## Configuration\n\n### `ignoreUsedInModule`\n\nWhen `true`, exports marked as \"used in module\" by `ts-prune` are ignored.\n\n### `rules`\n\nAn array of filtering rules. Each rule has:\n\n- **`files`**: Array of regex patterns to match file paths.\n- **`exports`**: Array of regex patterns to match export names.\n\nIf a file matches a rule's file patterns _and_ the export matches that rule's export patterns, the export is ignored.\n\nFor example, the following rule will ignore `config` and `middleware` exports in `middleware.ts`:\n\n```json\n{\n    \"files\": [\"middleware.ts\"],\n    \"exports\": [\"config\", \"middleware\"]\n}\n```\n\nSee [.ts-prune.json](.ts-prune.json) for a starter configuration.\n\n## Usage\n\n```bash\nnpm run check-unused\n# or\npnpm check-unused\n# or\nyarn check-unused\n```\n\n### Exit Codes\n\n- **0**: No unused exports found.\n- **1**: Unused exports detected.\n\n### Sample Output\n\n```\n✓ No unused exports found!\n```\n\nor\n\n```\nFound 5 potentially unused export(s):\n\nsrc/utils/helper.ts:42 - unusedFunction\nsrc/components/Old.tsx:10 - default\nlib/legacy.ts:15 - deprecatedExport\nlib/legacy.ts:23 - oldHelper\nconfig/unused.ts:8 - UNUSED_CONSTANT\n```\n\n## Contributing\n\nFound a bug or have an idea?\n\n1. Open an issue.\n2. Fork the repo, make a change on a new branch, and open a pull request.\n\n## Credits\n\nBuilt on top of [ts-prune](https://github.com/nadeesha/ts-prune) by [Nadeesha Cabral](https://github.com/nadeesha).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frokstrnisa%2Fts-prune-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frokstrnisa%2Fts-prune-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frokstrnisa%2Fts-prune-filter/lists"}