{"id":13727094,"url":"https://github.com/JamieMason/ts-import-types-cli","last_synced_at":"2025-05-07T22:30:50.310Z","repository":{"id":53722618,"uuid":"320899284","full_name":"JamieMason/ts-import-types-cli","owner":"JamieMason","description":"Autofix TypeScript types to be imported using `import type`","archived":false,"fork":false,"pushed_at":"2023-07-29T17:37:45.000Z","size":23,"stargazers_count":41,"open_issues_count":5,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-28T17:09:46.025Z","etag":null,"topics":["cli","codemod","codemods","jscodeshift","refactor","refactoring-tools","ts-morph","type-only-imports","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/JamieMason.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"JamieMason"}},"created_at":"2020-12-12T18:39:24.000Z","updated_at":"2025-03-18T21:29:51.000Z","dependencies_parsed_at":"2024-01-06T07:54:29.782Z","dependency_job_id":"68dca23d-d1af-4988-857f-9c8aa4d83abf","html_url":"https://github.com/JamieMason/ts-import-types-cli","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.0625,"last_synced_commit":"de9fee15c6be048b87c9f14170bb05e1f12a09fd"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fts-import-types-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fts-import-types-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fts-import-types-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fts-import-types-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamieMason","download_url":"https://codeload.github.com/JamieMason/ts-import-types-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252965211,"owners_count":21832839,"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":["cli","codemod","codemods","jscodeshift","refactor","refactoring-tools","ts-morph","type-only-imports","typescript"],"created_at":"2024-08-03T01:03:39.269Z","updated_at":"2025-05-07T22:30:49.650Z","avatar_url":"https://github.com/JamieMason.png","language":"TypeScript","readme":"# ts-import-types-cli\n\n\u003e Autofix TypeScript types to be imported using `import type`\n\n## Installation\n\n```\nnpm install -g ts-import-types-cli\n```\n\n## Usage\n\n```\nUsage: ts-import-types-cli [options] [patterns...]\n\nOptions:\n  -V, --version              output the version number\n  -d, --dry-run              write output to stdout instead of overwriting files\n  -p, --project [path]       path to tsconfig.json\n  -O, --no-organise-imports  disable use of VS Code's organise imports refactoring\n  -h, --help                 display help for command\n```\n\n## Example\n\n```\n$ ts-import-types-cli --project ./tsconfig.json 'src/**/*.ts' 'src/**/*.tsx'\n```\n\n```ts\nimport { interpret, StateValue } from 'xstate';\nimport { sendSearch } from '../../services/search-client/send-search';\nimport { createAlgoliaMachine } from '../machine';\nimport { AlgoliaInterpreter, AlgoliaMachine } from '../machine/types';\n\n// ...the rest of the file\n```\n\n\u003cp\u003e\u003ccenter\u003e↓↓↓↓↓\u003c/center\u003e\u003c/p\u003e\n\n```ts\nimport type { StateValue } from 'xstate'\nimport { interpret } from 'xstate'\nimport { sendSearch } from '../../services/search-client/send-search'\nimport { createAlgoliaMachine } from '../machine'\nimport type { AlgoliaInterpreter, AlgoliaMachine } from '../machine/types'\n\n// ...the rest of the file\n```\n\n## Triple-Slash Directives\n\nMoving triple-slash directives such as `/// \u003creference lib=\"webworker\" /\u003e` back\nto the top of the file is not yet supported. If you know how to do this using\nhttps://ts-morph.com please [open a\nPR](https://github.com/JamieMason/ts-import-types-cli/pulls) or otherwise let me\nknow.\n\nUnfortunately until then, files will need their triple-slash directives manually\nmoving back to the top of the file.\n\n`ts-import-types-cli` will output a list of which files are affected.\n","funding_links":["https://github.com/sponsors/JamieMason"],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJamieMason%2Fts-import-types-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJamieMason%2Fts-import-types-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJamieMason%2Fts-import-types-cli/lists"}