# line/tsr

TypeScript Remove (tsr) is a utility that removes unused code from TypeScript projects – It's like tree shaking, but for source files

Repository: https://github.com/line/tsr
Canonical: https://ross.abutalabs.com/products/tsr
Homepage: https://www.npmjs.com/package/tsr
Language: TypeScript
License: Apache-2.0
License Family: permissive
Topics: typescript
Archived: true
Last push: 2025-10-23T02:04:07+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 48, release rhythm 40, longevity 77
- inputs: {"age_days": 1085, "days_push": 315, "days_rel": 602, "gap_med": 1, "n_releases_24m": 22}
- flags: archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1285, forks 21 (observed 2026-08-28T04:04:14.663365+00:00)

## What it is
TypeScript Remove (tsr) is an npm-installed CLI utility that statically analyzes TypeScript projects to find unused files, exports, and declarations, then can automatically rewrite source files to remove them. It works like tree shaking but at the source level, using only the TypeScript compiler and a valid tsconfig.json with no extra configuration.

## Use cases
- find unused exports in a TypeScript project
- remove dead code from TypeScript codebase automatically
- delete unused source files that nothing imports
- detect unused code being added in CI
- clean up unused imports after refactoring
- tree shake source files instead of bundles

## When to choose
- You want automatic removal of unused code, not just detection, in a TypeScript project
- You want a zero-config tool that only requires a valid tsconfig.json and an entrypoint pattern
- You want to gate merges on unused-code checks in CI

## When to avoid
- The project has explicitly ended and is no longer maintained; the README recommends Knip for similar functionality
- Your project is plain JavaScript without a tsconfig.json
- You need runtime tree shaking of bundles rather than source-file cleanup

## Facets
- artifact type: cli-tool
- maturity: abandoned
- function: cli, developer-tools, linter
- domain: developer-tools, programming-languages
- platform: cli, cross-platform
- tags: typescript, static-analysis, dead-code-elimination, unused-exports, code-cleanup, tree-shaking, tsconfig, ci, deprecated, command-line, nodejs

## Member repositories
- line/tsr (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:14.663365+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:56:40.289216+00:00, confidence not recorded.
  - readme: https://github.com/line/tsr (fetched 2026-08-28T04:04:14.663365+00:00, sha 07cc7027b7e5)
  - registry_npm: https://registry.npmjs.org/tsr (fetched 2026-08-29T12:12:30.008547+00:00, sha bc3fc691d6b7)
- Data as of 2026-08-30T08:39:29.467469+00:00.
