Skip to content

Commit

Permalink
docs: restructuring, formatting and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgeiler committed May 28, 2024
1 parent 5db7e05 commit b71a20e
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
> [!NOTE]
> This is a fork of [`tsc-files`](https://www.npmjs.com/package/tsc-files) which modernizes the whole codebase a bit and implements some unmerged pull requests of the [original repository](https://github.com/gustavopch/tsc-files).
> This is a fork of [`tsc-files`](https://www.npmjs.com/package/tsc-files) which
> modernizes the whole codebase a bit and implements some unmerged pull requests
> of the [original repository](https://github.com/gustavopch/tsc-files).
# tsc-files

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

## 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

## Installation

```sh
Expand All @@ -19,14 +33,6 @@ yarn add --dev @jonasgeiler/tsc-files
pnpm add --save-dev @jonasgeiler/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:
Expand All @@ -41,4 +47,7 @@ With lint-staged:

## 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`.
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`.

0 comments on commit b71a20e

Please sign in to comment.