{"id":16347579,"url":"https://github.com/privatenumber/tc-passing","last_synced_at":"2025-03-21T00:30:21.122Z","repository":{"id":246359337,"uuid":"820802086","full_name":"privatenumber/tc-passing","owner":"privatenumber","description":"TypeScript migration tool: only type check previously passing files","archived":false,"fork":false,"pushed_at":"2024-06-27T23:31:57.000Z","size":71,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-03-12T15:18:48.777Z","etag":null,"topics":["baseline","check","lint","type","typescript"],"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/privatenumber.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},"funding":{"github":"privatenumber"}},"created_at":"2024-06-27T07:55:41.000Z","updated_at":"2024-07-06T22:02:00.000Z","dependencies_parsed_at":"2024-06-27T12:40:50.207Z","dependency_job_id":"9d9b9526-1c1f-431f-8b19-93e0e88db0e8","html_url":"https://github.com/privatenumber/tc-passing","commit_stats":null,"previous_names":["privatenumber/tc-passing"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Ftc-passing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Ftc-passing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Ftc-passing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Ftc-passing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/privatenumber","download_url":"https://codeload.github.com/privatenumber/tc-passing/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244717072,"owners_count":20498279,"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","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":["baseline","check","lint","type","typescript"],"created_at":"2024-10-11T00:43:49.830Z","updated_at":"2025-03-21T00:30:20.689Z","avatar_url":"https://github.com/privatenumber.png","language":"TypeScript","funding_links":["https://github.com/sponsors/privatenumber","https://github.com/sponsors/privatenumber/sponsorships?tier_id=398771","https://github.com/sponsors/privatenumber/sponsorships?tier_id=397608"],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\n\ttc-passing\n\t\u003ca href=\"https://npm.im/tc-passing\"\u003e\u003cimg src=\"https://badgen.net/npm/v/tc-passing\"\u003e\u003c/a\u003e \u003ca href=\"https://npm.im/tc-passing\"\u003e\u003cimg src=\"https://badgen.net/npm/dm/tc-passing\"\u003e\u003c/a\u003e\n\u003c/h1\u003e\n\nA command that uses TypeScript to only type check previously passing files\n\n### Why?\nWhen integrating TypeScript into a large codebase, using `tsc --noEmit` type-checks all files and can result in an overwhelming flood of errors. This can make it difficult to spot new errors in files that were previously error-free.\n\n`tc-passing` records the list of files that pass type check so you can be sure your type safe files remain type safe!\n\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/sponsors/privatenumber/sponsorships?tier_id=398771\"\u003e\u003cimg width=\"412\" src=\"https://raw.githubusercontent.com/privatenumber/sponsors/master/banners/assets/donate.webp\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://github.com/sponsors/privatenumber/sponsorships?tier_id=397608\"\u003e\u003cimg width=\"412\" src=\"https://raw.githubusercontent.com/privatenumber/sponsors/master/banners/assets/sponsor.webp\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## 🚀 Install\n\n```bash\nnpm i tc-passing\n```\n\n\u003csup\u003eNote: `typescript` (or `vue-tsc`) is assumed to be installed already\u003c/sup\u003e\n\n## Usage\n\n### 1. Setup (Optional)\n\nYou can use `tc-passing` directly with [npx](https://docs.npmjs.com/cli/v10/commands/npx), but for your convenience, it's recommend to add the following commands to your `package.json`:\n\n```json5\n{\n    \"scripts\": {\n        // ...\n\n        \"type-check\": \"tc-passing\",\n        \"type-check:update\": \"tc-passing --update\"\n    },\n\n    \"lint-staged\": {\n        \"**/*.{js,ts}\": \"tc-passing\"\n    }\n}\n```\n\nYou can also add it to a commit hook or `lint-staged`, but note `tc-passing` does not accept any arguments (e.g. for staged files).\n\n\n### 2. Recording passing files\n\nStart by running `tc-passing --update` to record the list of files that pass type check. This creates a `.tc-passing` file in your current working directory serving as a baseline for when you type check.\n\nHere's an example of what this file looks like:\n\n```\n# Files passing type check (33.33%) (Generated by tc-passing)\npath/to/file-a.ts\npath/to/file-b.js\n```\n\nThe first line shows a percentage of how much of the codebase is passing.\n\nMake sure to check this file into version control: `git add .tc-passing`\n\n### 3. Type check\n\nSimply run `tc-passing` and it will only type check files in `.tc-passing`.\n\nMake sure you run `tc-passing --update` periodically or whenever you fix types in a file.\n\n### Type checker\n\nBy default, `tc-passing` will expect you to have [`typescript`](https://www.npmjs.com/package/typescript) installed for `tsc`. If you have [`vue-tsc`](https://www.npmjs.com/package/vue-tsc) installed, it will use that instead.\n\n## FAQ\n\n### How does `tc-passing` compare to [`tsc-baseline`](https://npmjs.com/package/tsc-baseline)?\n\nBoth tools aim to streamline TypeScript integration, but they approach baselining differently:\n\n#### tsc-baseline\n- **Focus**\n\n\tShow only the new type errors since last baseline update.\n\n- **Baseline file**\n\n\tJSON file of errors. Can grow large and may lead to merge conflicts in team settings.\n\n- **Workflow impact**\n\n\tRequires frequent updates to maintain an accurate baseline, often necessitating updates with every TypeScript-related commit. Running `tsc` on every commit can slow down development. A notable issue is it doesn't propagate errors to the exit code so CI doesn't fail.\n\n#### tc-passing\n- **Focus**\n\n\tOnly type check files that were previously passing to ensure they remain error-free.\n\n- **Baseline file**\n\n\tText file of passing files. Readable and easy to manage, reducing merge conflicts. Also shows progress to 100% type safety.\n\n- **Workflow impact**\n\n\tUpdating the baseline is generally optional. Recommended when failing files are now passing. Necessary when more type errors are being introduced and they need to be ignored.\n\n\n## Sponsors\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/sponsors/privatenumber\"\u003e\n\t\t\u003cimg src=\"https://cdn.jsdelivr.net/gh/privatenumber/sponsors/sponsorkit/sponsors.svg\"\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivatenumber%2Ftc-passing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprivatenumber%2Ftc-passing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivatenumber%2Ftc-passing/lists"}