# tsc-files

> A tiny tool to run tsc on specific files without ignoring tsconfig.json

Latest version **1.1.4** (published 2023-07-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install tsc-files
pnpm add tsc-files
yarn add tsc-files
bun add tsc-files
```

Provides the command `tsc-files`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2023-07-04 |
| First published | 2020-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 267 |
| Author | Gustavo P. Cardoso |
| Maintainers | gustavopch |

## Links

- npm: https://www.npmjs.com/package/tsc-files
- Repository: https://github.com/gustavopch/tsc-files
- Homepage: https://github.com/gustavopch/tsc-files#readme
- Issues: https://github.com/gustavopch/tsc-files/issues
- npm.io page: https://npm.io/package/tsc-files

## Recent versions

- 1.1.4 (latest) — 2023-07-04
- 1.0.0-alpha.2 (alpha) — 2020-03-19
- 1.1.3 — 2021-11-19
- 1.1.2 — 2021-01-18
- 1.1.1 — 2020-12-15
- 1.1.0 — 2020-05-28
- 1.0.0 — 2020-03-26
- 1.0.0-alpha.1 — 2020-03-18

## README

# tsc-files

![GitHub Workflow Status](https://img.shields.io/github/workflow/status/gustavopch/tsc-files/Release?style=flat-square)

A tiny tool to run `tsc` on specific files without ignoring `tsconfig.json`.

## Installation

```sh
npm i -D tsc-files
```

```sh
yarn add -D tsc-files
```

## Why

I wanted to type-check **only the staged files** with [lint-staged](https://github.com/okonet/lint-staged).

Unfortunately passing specific files like `tsc --noEmit file1.ts file2.ts` will cause TypeScript to simply ignore your `tsconfig.json`.

There's already an open issue in the TypeScript repo to support this use case — you may want to give a 👍 there: https://github.com/microsoft/TypeScript/issues/27379

## Usage

With lint-staged:

```json
{
  "lint-staged": {
    "**/*.ts": "tsc-files --noEmit"
  }
}
```

## How it works

For the most part, it just forwards all arguments to `tsc` with one exception: the specified files will not be forwarded — instead, they will be put at the `files` property of a temporary config that will be generated next to your original `tsconfig.json`. Other than that, just read `tsc --help`.

## License

Released under the [MIT License](./LICENSE.md).

---
_Source: https://npm.io/package/tsc-files · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
